Skip to content

Build your personal knowledge base with Trilium Notes

fix(menu): fit a row of five actions on a narrow phone

Elian Doran922acb605f81
diff --git a/apps/client/src/menus/context_menu.spec.ts b/apps/client/src/menus/context_menu.spec.ts
index 74ea64a46c..66bfaacd33 100644
--- a/apps/client/src/menus/context_menu.spec.ts
+++ b/apps/client/src/menus/context_menu.spec.ts
@@ -1089,8 +1089,8 @@ describe("contextMenu", () => {
});
it("keeps its top while filtered, as its height follows the matches", async () => {
- // A browser's layout, which happy-dom has none of: a submenu taller than the room
- // beside its row, low in the viewport, which moves it up to fit.
+ // A submenu taller than the room beside its row, low in the viewport, which moves it
+ // up to fit.
let height = 400;
vi.spyOn(document.documentElement, "clientWidth", "get").mockReturnValue(1000);
vi.spyOn(document.documentElement, "clientHeight", "get").mockReturnValue(800);
diff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.css
index f47ca9e359..37fcb52ef1 100644
--- a/apps/client/src/stylesheets/theme-next/base.css
+++ b/apps/client/src/stylesheets/theme-next/base.css
@@ -468,8 +468,6 @@ body.mobile .dropdown-menu:where(:not(.note-autocomplete-menu)) {
backdrop-filter: var(--dropdown-backdrop-filter);
position: relative;
- /* A submenu opens as a page in the menu's place, so its arrow points to the end, as on the
- desktop, and stands in the row's end padding. */
.dropdown-submenu .dropdown-toggle::after {
bottom: 0;
inset-inline-end: calc(var(--dropdown-menu-padding-horizontal) / 2);
diff --git a/apps/client/src/widgets/react/Menu.css b/apps/client/src/widgets/react/Menu.css
index 8aca524f4e..faf6becb5f 100644
--- a/apps/client/src/widgets/react/Menu.css
+++ b/apps/client/src/widgets/react/Menu.css
@@ -250,7 +250,7 @@ body.desktop .dropdown-item.dropdown-submenu.submenu-open,
flex-direction: column;
align-items: center;
gap: 2px;
- min-width: 4.5em;
+ min-width: min(4.5em, 18%);
padding: 4px 6px;
border: 0;
border-radius: 6px;
@@ -295,7 +295,6 @@ body.desktop .dropdown-item.dropdown-submenu.submenu-open,
font-size: 1.5em;
}
-/* The circle must stay centered on `.tn-menu-action-badge`, whose offset and size place it. */
.tn-menu-action-badged {
mask-image: radial-gradient(circle at 80% 80%, transparent 0.36em, #000 0.37em);
}