Skip to content

πŸ› Settings search: scroll to and highlight the exact setting, resolve tab from the DOM - #12035

Merged
hivecommons-hive[bot] merged 4 commits into
v5from
fix/settings-search-scroll
Oct 15, 2026
Merged

hivecommons-hive[bot] merged 4 commits into
v5from
fix/settings-search-scroll

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #12034

What

Settings search now takes you to the exact setting.

  • Result rows are clickable (also Enter/Space; role=button), and Open tab / Enter in the search box all go through settingsSearchOpenHit: resolve the tab, switchConfigTab, then after a frame scroll the row into view inside #config-body (scrollIntoView({block:'center'})), apply a transient .cfg-row-flash (1.6s, token colours, prefers-reduced-motion β†’ static outline) and focus the row's input/select/toggle. Ancestor <details>/.collapsed groups are opened first. Rows a tab fills in after its own fetch get a few short retries; because Features-like tabs grow above the row for a moment after render, the scroll is instant and re-centres once if the row left the viewport.
  • Tab resolution comes from the live DOM, not the index. Every setting row now carries a stable data-setting-key (settingsAnnotateRows: own attribute β†’ yaml-hint <code> β†’ data-section/data-key), and settingsSearchResolveTab(tab, key) picks the tab where the key actually renders, falling back to the index's tab only when nothing is rendered. Result groups and "Open tab" use the resolved tab, so a drifted entry can no longer strand you (verified by a test that injects a deliberately wrong entry).
  • Rows that had no yaml hint got explicit anchors (logging, watchdog mode/probe, otel, ioscan, retro, rotation, restart thresholds β†’ governor.modes.*.threshold, SLA targets, acmm_level).
  • Index clean-up: Strategy Lab β†’ Dashboard, Trajectory review β†’ Features, Maturity Level key acmm_level, Restart thresholds key governor.modes, removed Release channel (lives in the dashboard release notice, not Settings) and Knowledge channel (no such control), marked the two Context7 entries lazy.

Tests (pkg/dashboard/webstatic/settings_search_test.go, node-backed, no time.Sleep)

A mini-DOM harness (testdata/settings_search_harness.js) runs the real index.html functions, including rendering all 24 governor tabs:

  • TestSettingsSearchOpenTabRevealsRow β€” groups = [Dashboard], Dashboard active, row has cfg-row-flash, scrollIntoView called once on that row with block:'center', focus on it, search cleared.
  • TestSettingsSearchRowClickAndEnter, TestSettingsSearchRevealExpandsDetails, TestSettingsSearchDriftedEntryResolvesFromDOM, TestSettingsSearchRevealRetriesLazyRows.
  • TestSettingsSearchIndexResolvesToControls β€” iterates every static index entry, renders all tabs, asserts each key resolves to exactly one rendered control in the tab it claims (group keys β‰₯1). On v6 it flags Experiment Lab as control renders in Dashboard, not Features until that entry is corrected.

Style/tooltip ratchets unchanged; existing ids/classes kept. go build ./... && go test ./pkg/dashboard/... green.

Live verification (v5 spoke, patched index served over live data)

Before β€” "strategy" lists under Features and Dashboard; Open tab on Features lands on a tab with no such control:

before results

After β€” single Dashboard result; Open tab lands on the flashed row:

after results
after open tab

Deep row β€” "trajectory" β†’ Features, scrolled 7658px into the tab, row centred and highlighted:

trajectory

Input focus β€” "max backups" β†’ Logging, input focused:

max backups

Forward-merge to v6 (needed)

The Settings dialog code is shared; the console v6 hive shows the same bug with dashboard.experiment_lab. Trial cherry-pick onto origin/v6: only index.html conflicts, both hunks inside SETTINGS_SEARCH_STATIC_HITS (v6 renamed Strategy Lab β†’ Experiment Lab and added entries). Resolution: keep v6's entries, set Maturity Level key: 'acmm_level', change the Experiment Lab entry to tab: 'Dashboard', section: 'Dashboard runtime'. The test scenarios reference dashboard.strategy_lab and must be renamed to dashboard.experiment_lab on v6; with that, all six tests and the audit (326 entries, 208 keys, 0 problems) pass on v6.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 15, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 15, 2026
clubanderson added a commit that referenced this pull request Oct 15, 2026
Generated by changelog-fragment-guard from the PR title (#5675).
Edit the wording freely, or replace this file with the no-changelog
label if the change is not user-visible.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#12046 ✨ dashboard settings: expose data/deployment/evidence/forge/mint/… keys (parity batch 3) same files src/pkg/dashboard/static/index.html

clubanderson and others added 4 commits October 15, 2026 11:20
Clicking a result or "Open tab" switched tabs and left the user at the
top of a long tab; hits in the hand-maintained index could also point at
a tab that has no such control (dashboard.strategy_lab under Features).

- Result rows and Open tab resolve the target tab from where the key is
  rendered, scroll the row into view inside #config-body, flash it
  (.cfg-row-flash, reduced-motion aware) and focus its control.
- Enter in the search box opens the first result.
- Every setting row carries data-setting-key; rows that lacked a yaml
  hint got explicit anchors (logging, watchdog, otel, ioscan, retro,
  rotation, thresholds, SLA targets, acmm_level).
- Fixed/removed drifted index entries; node-backed webstatic tests audit
  every entry against the rendered tabs.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Smooth-scrolling a ~10k px dialog body landed short when sections above
the row grew from their own fetches mid-scroll (Features tab). Scroll
instantly and re-centre once if the row left the viewport.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Generated by changelog-fragment-guard from the PR title (#5675).
Edit the wording freely, or replace this file with the no-changelog
label if the change is not user-visible.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/settings-search-scroll branch from 09eddb4 to 7bdbb83 Compare October 15, 2026 15:27
@hivecommons-hive
hivecommons-hive Bot merged commit a97a6d3 into v5 Oct 15, 2026
69 of 71 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 7bdbb83.

@kubestellar-prow
kubestellar-prow Bot deleted the fix/settings-search-scroll branch October 15, 2026 15:35
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› Settings search: "Open tab" doesn't scroll to the setting, and the index can point at the wrong tab

1 participant