From 8ff4a3e62d36e62de379b1c8cd3551c701abb340 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Fri, 28 Aug 2026 04:24:17 -0400 Subject: [PATCH] fix: edit nav UI + extract translations --- backend/locales/en.json | 16 ++- .../public/_assets/icons/fluent-search.svg | 1 + frontend/src/components/HeaderSearch.vue | 103 ++++++++++++++---- frontend/src/components/NavEditMenu.vue | 30 ++--- frontend/src/components/shared/WBar.vue | 15 ++- frontend/src/css/tailwind.css | 7 ++ frontend/src/layouts/MainLayout.vue | 2 +- 7 files changed, 136 insertions(+), 38 deletions(-) create mode 100644 frontend/public/_assets/icons/fluent-search.svg diff --git a/backend/locales/en.json b/backend/locales/en.json index 8a3da79b6..34fe7beda 100644 --- a/backend/locales/en.json +++ b/backend/locales/en.json @@ -1888,9 +1888,9 @@ "editor.redirect.pageTitle": "Redirect Title", "editor.redirect.pageTitleHint": "The name this page appears under in navigation and in the file manager.", "editor.redirect.pickerTitle": "Select Redirection Target", + "editor.redirect.showInTreeHint": "List this redirection in the site's browse menu. Off keeps it out, which is usually what a doorway left behind for an old path should do. It is listed in the file manager either way.", "editor.redirect.showInterstitial": "Show Interstitial", "editor.redirect.showInterstitialHint": "Show a short notice saying where the reader is going before taking them there. Off sends them straight on.", - "editor.redirect.showInTreeHint": "List this redirection in the site's browse menu. Off keeps it out, which is usually what a doorway left behind for an old path should do. It is listed in the file manager either way.", "editor.redirect.summaryDirect": "Readers arriving at this page are sent to {target} right away.", "editor.redirect.summaryIncomplete": "This redirection has no target yet, and cannot be saved until it does.", "editor.redirect.summaryInterstitial": "Readers arriving at this page are told they are being sent to {target}, then taken there a few seconds later.", @@ -2198,6 +2198,20 @@ "navEdit.label": "Label", "navEdit.labelHint": "Text to display on the menu item.", "navEdit.link": "Link", + "navEdit.modeHide": "Hide Current + Descendants", + "navEdit.modeHideExact": "Hide Current Only", + "navEdit.modeHideExactHint": "Completely hide the site navigation sidebar only for this path.", + "navEdit.modeHideHint": "Completely hide the site navigation sidebar for this path and all descendants.", + "navEdit.modeInherit": "Inherit", + "navEdit.modeInheritHint": "Use the menu items and settings from the parent path.", + "navEdit.modeOverride": "Override Current + Descendants", + "navEdit.modeOverrideExact": "Override Current Only", + "navEdit.modeOverrideExactHint": "Set menu items and settings only for this path.", + "navEdit.modeOverrideHint": "Set menu items and settings for this path and all descendants.", + "navEdit.modeRootHide": "Hide", + "navEdit.modeRootHideHint": "Completely hide the left sidebar navigation.", + "navEdit.modeRootShow": "Show", + "navEdit.modeRootShowHint": "Show the left sidebar navigation menu items.", "navEdit.nestItem": "Nest Item", "navEdit.nestingWarn": "The previous menu item must be a normal link or another nested link. Invalid nested items will be shown in red.", "navEdit.noSelection": "Select a menu item from the left to start editing.", diff --git a/frontend/public/_assets/icons/fluent-search.svg b/frontend/public/_assets/icons/fluent-search.svg new file mode 100644 index 000000000..7e382184c --- /dev/null +++ b/frontend/public/_assets/icons/fluent-search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/components/HeaderSearch.vue b/frontend/src/components/HeaderSearch.vue index 5585423b0..37929c137 100644 --- a/frontend/src/components/HeaderSearch.vue +++ b/frontend/src/components/HeaderSearch.vue @@ -85,7 +85,7 @@
Popular Tags - +
Search Operators
-
- !foo or -bar to exclude "foo" and "bar". -
-
- bana* for to match any term starting with "bana" (e.g. banana). -
-
- foo,bar or foo|bar to search for "foo" OR "bar". -
-
- "foo bar" to match exactly the phrase "foo bar". +
+
+ !foo or -bar to exclude "foo" and "bar". +
+
+ foo* to match any term starting with "foo". +
+
+ foo,bar or foo|bar to search for "foo" OR "bar". +
+
+ "foo bar" to match exactly the phrase "foo bar". +
@@ -270,6 +272,17 @@ defineExpose({ focus }) diff --git a/frontend/src/components/NavEditMenu.vue b/frontend/src/components/NavEditMenu.vue index dadf4e4d4..8c87115bd 100644 --- a/frontend/src/components/NavEditMenu.vue +++ b/frontend/src/components/NavEditMenu.vue @@ -9,15 +9,15 @@ - Show - Show the left sidebar navigaiton menu items. + {{ t(`navEdit.modeRootShow`) }} + {{ t(`navEdit.modeRootShowHint`) }} - Hide - Completely hide the left sidebar navigation. + {{ t(`navEdit.modeRootHide`) }} + {{ t(`navEdit.modeRootHideHint`) }} @@ -25,36 +25,36 @@ - Inherit - Use the menu items and settings from the parent path. + {{ t(`navEdit.modeInherit`) }} + {{ t(`navEdit.modeInheritHint`) }} - Override Current + Descendants - Set menu items and settings for this path and all descendants. + {{ t(`navEdit.modeOverride`) }} + {{ t(`navEdit.modeOverrideHint`) }} - Override Current Only - Set menu items and settings only for this path. + {{ t(`navEdit.modeOverrideExact`) }} + {{ t(`navEdit.modeOverrideExactHint`) }} - Hide Current + Descendants - Completely hide the left sidebar navigation for this path and all descendants. + {{ t(`navEdit.modeHide`) }} + {{ t(`navEdit.modeHideHint`) }} - Hide Current Only - Completely hide the left sidebar navigation only for this path. + {{ t(`navEdit.modeHideExact`) }} + {{ t(`navEdit.modeHideExactHint`) }} @@ -214,7 +214,7 @@ async function save() { }).json() // -> The API client does not throw on 400, so a refusal comes back as a parsed error if (resp?.ok === false) { - throw new Error(resp.message || 'An unexpected error occured.') + throw new Error(resp.message || t(`common.error.unexpected`)) } notify({ type: 'positive', diff --git a/frontend/src/components/shared/WBar.vue b/frontend/src/components/shared/WBar.vue index d7de05317..7252c9129 100644 --- a/frontend/src/components/shared/WBar.vue +++ b/frontend/src/components/shared/WBar.vue @@ -1,7 +1,7 @@ @@ -13,11 +13,18 @@ * Metrics taken from Quasar's own variables so migrated chrome keeps its exact size: * standard height 32px (16px inner font x2), padding 0 12px, font-size 18px, buttons 11px * dense height 24px (14px + 10), padding 0 8px, font-size 14px, buttons 8px + * + * `flush` drops the side padding, for a bar whose contents are meant to reach its edges -- a single + * full-width button rather than a row of controls inset from the sides. */ defineProps({ dense: { type: Boolean, default: false + }, + flush: { + type: Boolean, + default: false } }) @@ -39,6 +46,12 @@ defineProps({ font-size: 14px; } +/* -> After the two size rules, so it overrides whichever of them is in play */ +.w-bar--flush { + padding-left: 0; + padding-right: 0; +} + /* Quasar sized buttons inside a bar well below the bar's own font size, and spaced them by 2px. Reproduced here so a bar full of buttons keeps its compact look. diff --git a/frontend/src/css/tailwind.css b/frontend/src/css/tailwind.css index b9d86cf5e..4efe3dbf3 100644 --- a/frontend/src/css/tailwind.css +++ b/frontend/src/css/tailwind.css @@ -105,6 +105,13 @@ */ --color-primary-light: color-mix(in srgb, var(--color-primary) 60%, white); + /* + A step lighter again, for brand-coloured text that is small AND on a dark surface -- the search + panel's operator names. `primary-light` is mixed for headings, which carry their contrast partly + in their weight; the same shade at 12px on black reads as dim rather than as a highlight. + */ + --color-primary-lighter: color-mix(in srgb, var(--color-primary) 35%, white); + /* And the sidebar's colour a shade lighter, for the one control that sits INSIDE that column and has to read as a button against it rather than as a second accent beside it: scroll-to-top, tucked into diff --git a/frontend/src/layouts/MainLayout.vue b/frontend/src/layouts/MainLayout.vue index 3881aebec..56e369bcf 100644 --- a/frontend/src/layouts/MainLayout.vue +++ b/frontend/src/layouts/MainLayout.vue @@ -80,7 +80,7 @@ - +