Skip to content

Improve bootstrap static theme: visible search feedback, loading state, data-i18n-alt#3175

Merged
marevol merged 1 commit into
masterfrom
improve-bootstrap-theme-search-feedback
Jun 22, 2026
Merged

Improve bootstrap static theme: visible search feedback, loading state, data-i18n-alt#3175
marevol merged 1 commit into
masterfrom
improve-bootstrap-theme-search-feedback

Conversation

@marevol

@marevol marevol commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Functional review fixes for the bundled bootstrap reference static theme. Three gaps were found where the theme consumes the /api/v2/* API correctly but the front-end did not give the user complete feedback:

  1. Visible search-failure feedback. Network, server (5xx) and auth failures during a search were written only to the screen-reader-only #results-meta sink, so a sighted user saw stale/blank results with no indication the search had failed. These errors are now surfaced in the visible #search-error banner (which is already role="alert"), falling back to #results-meta only when a theme has no visible banner. The invalid_request/400 path is unchanged.

  2. Search loading indicator. The cache and chat views had a loading state; the main search did not, so a slow query left the previous results on screen with no progress hint. A #search-loading spinner is now shown while a /search request is in flight and hidden when it settles. The hide is guarded so a superseded request never clears the spinner belonging to a newer one. A new labels.search_loading key was added to all 16 message bundles.

  3. data-i18n-alt support. Both logos carried a data-i18n-alt attribute, but i18n.js applyDom() only processed data-i18n / -placeholder / -aria-label, so the intended localized alt text was never applied. applyDom() now handles data-i18n-alt. The home logo referenced a key (labels.index_title) that did not exist in any bundle; it has been repointed to the existing page.heading key (the header brand already uses the existing labels.header_brand_name).

Changes

  • assets/i18n.jsapplyDom() now localizes alt via data-i18n-alt.
  • assets/search.js — visible error feedback for network/server/auth failures; showSearchLoading() helper + supersede-safe loading toggle in runSearch().
  • index.html#search-loading indicator in the results view; home logo data-i18n-alt repointed to page.heading.
  • i18n/messages.*.json (16) — new labels.search_loading key.
  • BundledBootstrapThemeTest — 7 regression tests covering the three fixes.

Testing

mvn test -Dtest='org.codelibs.fess.theme.*Test,org.codelibs.fess.i18n.LabelMessageThemeParityTest' — all green (BundledBootstrapThemeTest 120, LabelMessageThemeParityTest 5+2, ThemeManifestTest 11, StaticThemeResponderTest 34, StaticThemeInstallerTest 23, ThemeRegistryTest 7). i18n key parity preserved across all 16 bundles.

…e, data-i18n-alt

- Surface network/server/auth search failures in the visible #search-error
  banner instead of only the screen-reader-only #results-meta sink.
- Add a #search-loading indicator shown while a /search request is in flight,
  with a supersede-safe hide guard; add labels.search_loading to all 16 bundles.
- Localize the alt attribute via data-i18n-alt in i18n.js applyDom(); repoint the
  home logo from the undefined labels.index_title key to the existing page.heading.
- Add BundledBootstrapThemeTest regression coverage for the three fixes.
@marevol marevol merged commit 2b74ec3 into master Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant