Improve bootstrap static theme: visible search feedback, loading state, data-i18n-alt#3175
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Functional review fixes for the bundled
bootstrapreference 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:Visible search-failure feedback. Network, server (5xx) and auth failures during a search were written only to the screen-reader-only
#results-metasink, so a sighted user saw stale/blank results with no indication the search had failed. These errors are now surfaced in the visible#search-errorbanner (which is alreadyrole="alert"), falling back to#results-metaonly when a theme has no visible banner. Theinvalid_request/400 path is unchanged.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-loadingspinner is now shown while a/searchrequest 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 newlabels.search_loadingkey was added to all 16 message bundles.data-i18n-altsupport. Both logos carried adata-i18n-altattribute, buti18n.js applyDom()only processeddata-i18n/-placeholder/-aria-label, so the intended localizedalttext was never applied.applyDom()now handlesdata-i18n-alt. The home logo referenced a key (labels.index_title) that did not exist in any bundle; it has been repointed to the existingpage.headingkey (the header brand already uses the existinglabels.header_brand_name).Changes
assets/i18n.js—applyDom()now localizesaltviadata-i18n-alt.assets/search.js— visible error feedback for network/server/auth failures;showSearchLoading()helper + supersede-safe loading toggle inrunSearch().index.html—#search-loadingindicator in the results view; home logodata-i18n-altrepointed topage.heading.i18n/messages.*.json(16) — newlabels.search_loadingkey.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.