Repository navigation
Conversation
The picker becomes multi-select (Base UI Combobox multiple mode). The selected set is the list scope: - exactly one namespace keeps the existing live-watch path byte-for-byte; - the empty selection stays the All-namespaces cluster-wide snapshot; - two or more namespaces fan out as ordinary single-namespace snapshot requests (limit 100 each) merged in selection order — no watch streams, so "at most one watch per list view" and the no-global-informer boundary are untouched. The cap is 32 (renderer-only constant). New pure seam lib/namespace-scope.ts owns toggle/cap/summary/canonical scope-key serialization plus the merged-response helpers. useNamespaces holds namespaceScope: string[] (bail-out on equal contents so a context switch cannot churn array identity); useResourceList/useHelm key their effects on the order-insensitive scope key and read the scope through a ref. Pod usage and Helm releases fan out per selected namespace; usage is keyed by namespace/name so same-named pods cannot trade rows. Picker UX: click applies immediately, direct-Enter appends (IME guard kept), the All-namespaces row clears the selection, the trigger summarizes (a, b +N with a full-list tooltip), and the 32-cap rejection shows a footer message. Palette/context-switch/create-dialog/reset flows pin, replace or clear the scope as before. Covers #31
Owner
Author
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.
Closes #31
Implements the spec in the issue: the toolbar namespace picker becomes multi-select, and the selected set becomes the list scope for the resource table, Helm releases, and Pod metrics.
Scope model (renderer-only; the wire stays single-namespace)
[]= All namespaces (cluster-wide snapshot, unchanged); one name = the existing single-namespace live-watch path, byte-for-byte; two or more = bounded per-namespace snapshot fan-out (limit 100 each, parallel, merged in selection order). No watch streams are opened for multi-scope.DesktopApisignatures are untouched.Changes
lib/namespace-scope.ts(vitest-covered): toggle/cap, trigger summary (a, b +N), canonical order-insensitive scope-key serialization, merged-response helpers (per-ns pages → ordered rows, per-ns load-more token advancement).useNamespacesownsnamespaceScope: string[](+setNamespaceScope); context switch resets to[context default]/[]with a content-equality bail-out so array identity cannot churn scope-keyed effects.useResourceListkeys its effects on the scope key and reads the scope through a ref: single-namespace watch path untouched; multi path fans out one ordinary list request per namespace with a shared generation counter (scope change/refresh supersedes in-flight pages), merges rows in selection order, and advances load-more for every namespace that still has a token. A failed namespace degrades to "no rows from it"; the multi view is snapshot-only and the pane heading saysN namespaces (snapshot, refresh to update). Stale-while-revalidate snapshots use the canonical scope key, so A→B→A retention works for merged scopes too.multiplemode; click applies immediately (no Done step); direct-Enter toggles the typed name into the selection (IME-safe guard kept); the All-namespaces row clears the whole selection (zero-selection state); trigger shows the summary with a full-list tooltip past three names; selected rows keep the checkbox-style ItemIndicator; Escape closes without changing the selection; large-cluster progressive narrowing and the truncated footer are unchanged.select-namespace/openResourcereplace the selection with one namespace; create-dialog default uses a single selected namespace, else context default; checked-row reset and detail-close reset gate on the canonical scope key; context switch resets the selection.Testing
lib/namespace-scope.test.ts: toggle/cap, key canonicalization, summary formatting, merge/load-more helpers.renderer-smoke.spec.ts(57 passing): new end-to-end cases — multi-select merge with grouped rows + per-namespace request recording (and no watch), 32-cap rejection with footer message, Helm merged fan-out, pod usage across namespaces; existing single-namespace, IME, direct-Enter, cache-revisit, and Helm paging cases updated to toggle semantics and all green.pnpm checkgreen (typecheck, vitest, build, cargo test + clippy);go -C core test -race ./...andgo vetgreen (no core changes).