1.6 KiB
1.6 KiB
HAC-22 DB Switcher Hardening
Date: 2026-03-31 UTC
Owner: Senior Frontend Engineer
Issue: HAC-22
Scope: desktop-v1 user-visible frontend hardening only
Context
apps/desktopalready ships a visible DB switcher, but the current UI only renders four fixed choices:db0,db1,db2, anddb5.- Current product scope already includes one active standalone Redis connection, explicit DB context, and DB-scoped browse / inspect / command flows.
- The hardcoded four-item list is weaker than the current product boundary and makes shell-level verification less representative for operators who need to move across common DB indexes.
Decision
- Do not expand product scope or alter backend contracts.
- Keep the existing rail placement and interaction model for the DB switcher.
- Widen the visible DB switcher to a predictable default operator range and ensure the currently active DB remains selectable even when it falls outside the default range.
Implemented Slice
- Added a shared frontend helper that returns DB labels for the switcher.
- Defaulted the visible range to
db0throughdb15. - Preserved the currently active DB when it falls outside that range and kept the options numerically ordered.
- Covered the helper with focused Vitest cases.
Acceptance
- The visible DB switcher no longer depends on a four-item hardcoded list.
- Operators can select common DB indexes from
db0throughdb15without editing connection drafts. - An active DB outside the default range still appears in the switcher and stays selectable.
pnpm --filter @redis-gui/desktop testandpnpm run desktop:buildremain green.