From fbbef49bb3c8e32a5bbbd28786cf9cf66210b844 Mon Sep 17 00:00:00 2001 From: Abhinav Raut Date: Sun, 9 Aug 2026 19:47:57 +0530 Subject: [PATCH] fix help center feedback counts, empty state, mobile logo and a11y --- .../src/components/editor/EditorToolbar.vue | 23 ++++++++++++++----- .../admin/help-center/ArticleEditSheet.vue | 4 ++-- i18n/en-US.json | 3 ++- static/public/static/help-center-classic.css | 6 ++--- static/public/static/help-center-docs.css | 6 ++--- static/public/static/help-center-search.js | 3 ++- .../web-templates/help/classic/home.html | 2 +- .../web-templates/help/classic/layout.html | 2 +- .../public/web-templates/help/docs/home.html | 2 +- .../web-templates/help/docs/layout.html | 2 +- 10 files changed, 33 insertions(+), 20 deletions(-) diff --git a/frontend/apps/main/src/components/editor/EditorToolbar.vue b/frontend/apps/main/src/components/editor/EditorToolbar.vue index c4ac9a0c..af3069d3 100644 --- a/frontend/apps/main/src/components/editor/EditorToolbar.vue +++ b/frontend/apps/main/src/components/editor/EditorToolbar.vue @@ -51,6 +51,7 @@ type="button" size="sm" variant="ghost" + :aria-label="$t('globals.terms.bold')" @click.prevent="editor?.chain().focus().toggleBold().run()" :class="{ 'bg-secondary': editor?.isActive('bold') }" > @@ -65,6 +66,7 @@ type="button" size="sm" variant="ghost" + :aria-label="$t('globals.terms.italic')" @click.prevent="editor?.chain().focus().toggleItalic().run()" :class="{ 'bg-secondary': editor?.isActive('italic') }" > @@ -79,6 +81,7 @@ type="button" size="sm" variant="ghost" + :aria-label="$t('editor.tooltip.strikethrough')" @click.prevent="editor?.chain().focus().toggleStrike().run()" :class="{ 'bg-secondary': editor?.isActive('strike') }" > @@ -93,6 +96,7 @@ type="button" size="sm" variant="ghost" + :aria-label="$t('editor.tooltip.underline')" @click.prevent="editor?.chain().focus().toggleUnderline().run()" :class="{ 'bg-secondary': editor?.isActive('underline') }" > @@ -107,6 +111,7 @@ type="button" size="sm" variant="ghost" + :aria-label="$t('editor.tooltip.bulletList')" @click.prevent="editor?.chain().focus().toggleBulletList().run()" :class="{ 'bg-secondary': editor?.isActive('bulletList') }" > @@ -121,6 +126,7 @@ type="button" size="sm" variant="ghost" + :aria-label="$t('editor.tooltip.orderedList')" @click.prevent="editor?.chain().focus().toggleOrderedList().run()" :class="{ 'bg-secondary': editor?.isActive('orderedList') }" > @@ -135,6 +141,7 @@ type="button" size="sm" variant="ghost" + :aria-label="$t('editor.tooltip.link')" @click.prevent="emit('openLink')" :class="{ 'bg-secondary': editor?.isActive('link') }" > @@ -150,6 +157,7 @@ type="button" size="sm" variant="ghost" + :aria-label="$t('editor.tooltip.codeBlock')" @click.prevent="editor?.chain().focus().toggleCodeBlock().run()" :class="{ 'bg-secondary': editor?.isActive('codeBlock') }" > @@ -164,6 +172,7 @@ type="button" size="sm" variant="ghost" + :aria-label="$t('editor.tooltip.blockquote')" @click.prevent="editor?.chain().focus().toggleBlockquote().run()" :class="{ 'bg-secondary': editor?.isActive('blockquote') }" > @@ -178,6 +187,7 @@ type="button" size="sm" variant="ghost" + :aria-label="$t(a.label)" @click.prevent="editor?.chain().focus().setTextAlign(a.dir).run()" :class="{ 'bg-secondary': editor?.isActive({ textAlign: a.dir }) }" > @@ -190,7 +200,7 @@ - @@ -211,7 +221,7 @@ - @@ -219,7 +229,7 @@ - @@ -227,7 +237,7 @@ - @@ -235,7 +245,7 @@ - @@ -250,6 +260,7 @@ size="sm" variant="ghost" class="flex items-center" + :aria-label="$t('editor.tooltip.callout')" :class="{ 'bg-secondary': editor?.isActive('callout') }" > @@ -269,7 +280,7 @@ - diff --git a/frontend/apps/main/src/features/admin/help-center/ArticleEditSheet.vue b/frontend/apps/main/src/features/admin/help-center/ArticleEditSheet.vue index a8c19b72..a58572e4 100644 --- a/frontend/apps/main/src/features/admin/help-center/ArticleEditSheet.vue +++ b/frontend/apps/main/src/features/admin/help-center/ArticleEditSheet.vue @@ -283,9 +283,9 @@ {{ t('helpCenter.createdBy') }} {{ loadedArticle.created_by_name }} -
+
{{ t('globals.terms.feedback') }} - ๐Ÿ‘ {{ article.helpful_count }} ยท ๐Ÿ‘Ž {{ article.not_helpful_count }} + ๐Ÿ‘ {{ loadedArticle.helpful_count }} ยท ๐Ÿ‘Ž {{ loadedArticle.not_helpful_count }}
{{ t('globals.terms.createdAt') }} diff --git a/i18n/en-US.json b/i18n/en-US.json index 891962c3..78f55320 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -1197,7 +1197,7 @@ "helpCenter.noSearchData": "No searches recorded yet.", "helpCenter.onThisPage": "On this page", "helpCenter.skipToContent": "Skip to main content", - "helpCenter.resultsCount": "{count} results", + "helpCenter.resultsCount": "{count} result | {count} results", "helpCenter.supportedLanguages": "Supported languages", "helpCenter.visitSite": "Visit site", "helpCenter.supportedLanguagesHint": "Language codes this help center supports, e.g. en, es, fr. Add a language before authoring articles in it.", @@ -1258,6 +1258,7 @@ "helpCenter.newCollection": "New collection", "helpCenter.noArticles": "This collection has no articles yet. Try searching, or browse the other collections.", "helpCenter.noCollections": "No collections yet.", + "helpCenter.noPublishedContent": "Nothing has been published here yet. Please check back later.", "helpCenter.noCollectionsInLanguage": "No collections in this language. Create one before saving the article in it.", "helpCenter.noResults": "No articles matched your search. Try fewer or different words.", "helpCenter.pageTitle": "Page title", diff --git a/static/public/static/help-center-classic.css b/static/public/static/help-center-classic.css index ea633245..a99aafd8 100644 --- a/static/public/static/help-center-classic.css +++ b/static/public/static/help-center-classic.css @@ -82,10 +82,10 @@ a:hover { text-decoration: underline; } gap: 1.25rem; padding: 2rem 1.5rem; } -.hc-brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--hc-header-text, var(--hc-ink)); } +.hc-brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--hc-header-text, var(--hc-ink)); min-width: 0; } .hc-brand:hover { text-decoration: none; } -.hc-brand img { max-height: 1.9rem; width: auto; display: block; } -.hc-brand .hc-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; } +.hc-brand img { max-height: 1.9rem; max-width: 100%; width: auto; object-fit: contain; display: block; } +.hc-brand .hc-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hc-nav-links { margin-left: auto; display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center; } .hc-nav-links a { color: var(--hc-header-text, var(--hc-muted)); font-size: .95rem; font-weight: 500; opacity: .92; } .hc-nav-links a:hover { opacity: 1; text-decoration: none; } diff --git a/static/public/static/help-center-docs.css b/static/public/static/help-center-docs.css index b14c61e5..a2928665 100644 --- a/static/public/static/help-center-docs.css +++ b/static/public/static/help-center-docs.css @@ -106,10 +106,10 @@ body[data-hcd-modal-open] { overflow: hidden; } padding: 0 1.5rem; } .hcd-topbar-start { display: flex; align-items: center; gap: .8rem; min-width: 0; } -.hcd-brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--hc-ink); flex: none; } +.hcd-brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--hc-ink); flex: 0 1 auto; min-width: 0; } .hcd-brand:hover { text-decoration: none; } -.hcd-brand img { max-height: 1.7rem; width: auto; display: block; } -.hcd-brand-name { font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; } +.hcd-brand img { max-height: 1.7rem; max-width: 100%; width: auto; object-fit: contain; display: block; } +.hcd-brand-name { font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hcd-topnav { display: flex; gap: 1.35rem; flex-wrap: nowrap; overflow: hidden; } .hcd-topnav a { color: var(--hc-muted); font-size: .92rem; font-weight: 500; white-space: nowrap; } .hcd-topnav a:hover { color: var(--hc-ink); text-decoration: none; } diff --git a/static/public/static/help-center-search.js b/static/public/static/help-center-search.js index 09a5b874..b95e812e 100644 --- a/static/public/static/help-center-search.js +++ b/static/public/static/help-center-search.js @@ -7,6 +7,7 @@ var locale = form.getAttribute('data-hc-locale'); var emptyText = form.getAttribute('data-hc-empty') || 'No results'; var resultsText = form.getAttribute('data-hc-results') || '{count} results'; + var resultsTextOne = form.getAttribute('data-hc-results-one') || '{count} result'; if (!input || !slug) return; var DEBOUNCE = 250; @@ -76,7 +77,7 @@ panel.hidden = false; active = -1; input.setAttribute('aria-expanded', 'true'); - status.textContent = list.length ? resultsText.replace('{count}', list.length) : emptyText; + status.textContent = list.length ? (list.length > 1 ? resultsText : resultsTextOne).replace('{count}', list.length) : emptyText; pending = q; } diff --git a/static/public/web-templates/help/classic/home.html b/static/public/web-templates/help/classic/home.html index c09f042c..974887af 100644 --- a/static/public/web-templates/help/classic/home.html +++ b/static/public/web-templates/help/classic/home.html @@ -40,7 +40,7 @@ {{ end }}
{{ else }} -

{{ $.L.T "helpCenter.noArticles" }}

+

{{ $.L.T "helpCenter.noPublishedContent" }}

{{ end }} {{ template "classic-footer" . }} diff --git a/static/public/web-templates/help/classic/layout.html b/static/public/web-templates/help/classic/layout.html index 8d7ebf62..fc8f7e4e 100644 --- a/static/public/web-templates/help/classic/layout.html +++ b/static/public/web-templates/help/classic/layout.html @@ -24,7 +24,7 @@

{{ $heroText }}

{{ if .Data.HelpCenter.TaglineHTML }}

{{ .Data.HelpCenter.TaglineHTML }}

{{ end }} {{ end }} -
{{ else }} -

{{ .L.T "helpCenter.noArticles" }}

+

{{ .L.T "helpCenter.noPublishedContent" }}

{{ end }} {{ template "docs-footer" . }} diff --git a/static/public/web-templates/help/docs/layout.html b/static/public/web-templates/help/docs/layout.html index 50565919..18947d37 100644 --- a/static/public/web-templates/help/docs/layout.html +++ b/static/public/web-templates/help/docs/layout.html @@ -32,7 +32,7 @@