Skip to content

Build your personal knowledge base with Trilium Notes

client/content manager: improve the mobile UI

Adorian Doran2de190d70e42
diff --git a/apps/client/src/widgets/type_widgets/options/active_content.css b/apps/client/src/widgets/type_widgets/options/active_content.css
index 714d689ffe..d4f73e7ea7 100644
--- a/apps/client/src/widgets/type_widgets/options/active_content.css
+++ b/apps/client/src/widgets/type_widgets/options/active_content.css
@@ -121,7 +121,20 @@ body.mobile {
}
}
-/* Broken where it must be: a path is one long run, and the menu is no wider than the screen. */
-.active-content-item-location {
+/* Broken where they must be: a path is one long run, a title may be, and the menu is no wider than
+ the screen. */
+.active-content-item-location,
+.active-content-item-name {
overflow-wrap: anywhere;
}
+
+/* The one thing in the summary that is the item itself rather than something about it, so it is
+ read as the note was named. The heading it sits in is set in small uppercase, which suits the
+ word introducing a group but not a title someone typed. */
+.active-content-item-name {
+ color: var(--main-text-color);
+ font-size: 1.25em;
+ font-weight: 500;
+ letter-spacing: normal;
+ text-transform: none;
+}
diff --git a/apps/client/src/widgets/type_widgets/options/active_content.tsx b/apps/client/src/widgets/type_widgets/options/active_content.tsx
index aff93ed827..77ff0f5f95 100644
--- a/apps/client/src/widgets/type_widgets/options/active_content.tsx
+++ b/apps/client/src/widgets/type_widgets/options/active_content.tsx
@@ -52,8 +52,10 @@ function ContentItemMenu({ note, categories }: { note: FNote, categories: Conten
// Out of the row and into the body: nested, the open menu would still count as hovering
// the row, leaving it highlighted while the cursor is over the menu.
portalToBody
+ // Asked for as a sheet rather than dressed as one: the prop brings the cover over the
+ // rest of the screen with it, which the class alone does not.
+ mobileBottomSheet
title={t("content_manager.item_menu")}
- dropdownContainerClassName={isMobile() ? "mobile-bottom-menu" : undefined}
>
{isMobile() && (
<FormListHeader text={<ItemSummary note={note} categories={categories} />} />
@@ -161,6 +163,9 @@ function ItemSummary({ note, categories }: { note: FNote, categories: ContentCat
return (
<span className="active-content-item-summary">
{location && <span className="active-content-item-location">{location}</span>}
+ {/* Under the path rather than over it: the path reads as the heading of the menu, and
+ the name says which of the notes in it this menu belongs to. */}
+ <span className="active-content-item-name">{note.title}</span>
{categories.map((category) => (
<ItemDetail key={category.id} note={note} category={category} showCategory />
))}
@@ -533,7 +538,7 @@ function SortOrderMenu({ currentValue, onChange }: { currentValue: string, onCha
buttonClassName="bx bx-sort"
hideToggleArrow noSelectButtonStyle noDropdownListStyle iconAction
title={t("content_manager.sort_order")}
- dropdownContainerClassName={isMobile() ? "mobile-bottom-menu" : undefined}
+ mobileBottomSheet
>
{SORT_ORDERS.map(({ value, label }) => (
<FormListItem key={value} checked={currentValue === value} onClick={() => onChange(value)}>
diff --git a/apps/client/src/widgets/type_widgets/options/shortcuts.tsx b/apps/client/src/widgets/type_widgets/options/shortcuts.tsx
index c85ed79b4b..064e42120e 100644
--- a/apps/client/src/widgets/type_widgets/options/shortcuts.tsx
+++ b/apps/client/src/widgets/type_widgets/options/shortcuts.tsx
@@ -139,7 +139,7 @@ export default function ShortcutSettings() {
iconAction
title={t("shortcuts.filter")}
dropdownRef={filterDropdownRef}
- dropdownContainerClassName={isMobile() ? "mobile-bottom-menu" : undefined}
+ mobileBottomSheet
// The row is a container, and so a backdrop root: left inside it the
// menu loses its blur and reads as a flat tint.
portalToBody