Skip to content

[codex] add settings search command palette - #140

Merged
Quick104 merged 1 commit into
mainfrom
codex/admin-settings-search
Jun 12, 2026
Merged

Quick104 merged 1 commit into
mainfrom
codex/admin-settings-search

Conversation

@Quick104

@Quick104 Quick104 commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add shared settings search primitives for admin and user settings pages.
  • Add a dashboard-only admin Cmd+K command dialog that searches admin destinations, plugin admin routes, and individual admin setting labels.
  • Refactor admin navigation and admin settings search metadata so the sidebar, dashboard command dialog, and settings page use shared sources.

Why

The dashboard command search originally only knew about top-level admin sections. It now indexes the detailed admin settings metadata as well, so searches like Pool Max Open resolve directly to the Database settings tab.

Validation

  • pnpm --dir web exec vitest run src/components/AdminSectionCommandDialog.test.tsx src/components/AdminSidebar.test.tsx src/components/settings/settingsSearch.test.ts src/pages/admin-settings/AdminSettingsLayout.test.tsx src/pages/SettingsLayout.test.tsx
  • pnpm --dir web exec tsc -b --pretty false
  • pnpm --dir web run lint (0 errors; existing warnings remain)
  • git diff --cached --check

AI Use

Implemented with Codex.

Summary by CodeRabbit

  • New Features

    • Added command palette search for admin navigation sections with keyboard shortcut (Cmd/Ctrl+K)
    • Added search functionality to admin settings with live filtering and result counts
    • Added search functionality to personal settings with live filtering and result counts
    • Search supports keyboard navigation, mouse selection, and Escape to close
  • Tests

    • Added comprehensive test coverage for new search components and filtering behavior

@coderabbitai

coderabbitai Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ce69c7c-ae6f-4449-a171-396804ae30e9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/admin-settings-search

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/src/components/AdminSectionCommandDialog.tsx`:
- Around line 35-37: Replace use of `href` as the unique identifier with a
stable per-result identity: change the `resultIndexByHref` mapping to use a
unique id field (e.g., `result.id`) or a generated stable id stored on each
result, and update all places that rely on `href` (the `resultIndexByHref` map,
selection logic that reads/writes selection state, ARIA id generation, and React
element `key` usage in the component methods referenced) to use that stable id
instead; ensure any fallback generation attaches the stable id to the result
objects so every reference (selection mapping, aria-owns/aria-controls ids, and
React keys) uses the same unique symbol (e.g., `resultId`) rather than `href`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2db12f1c-8d9e-431d-bce8-122d14d53650

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd8996 and c0ecfcf.

📒 Files selected for processing (13)
  • web/src/components/AdminSectionCommandDialog.test.tsx
  • web/src/components/AdminSectionCommandDialog.tsx
  • web/src/components/AdminSidebar.tsx
  • web/src/components/settings/SettingsSearchInput.tsx
  • web/src/components/settings/settingsSearch.test.ts
  • web/src/components/settings/settingsSearch.ts
  • web/src/lib/adminNavigation.ts
  • web/src/lib/adminSettingsSearch.ts
  • web/src/pages/AdminDashboard.tsx
  • web/src/pages/SettingsLayout.test.tsx
  • web/src/pages/SettingsLayout.tsx
  • web/src/pages/admin-settings/AdminSettingsLayout.test.tsx
  • web/src/pages/admin-settings/AdminSettingsLayout.tsx

Comment on lines +35 to +37
const resultIndexByHref = useMemo(
() => new Map(results.map((item, index) => [item.href, index])),
[results],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use a stable per-result identity instead of href as the unique key.

Line 35 indexes results by href, and Lines 167/215/247 also treat href as unique. If two
results share the same href, selection mapping and ARIA ids collide (and React keys duplicate).

Suggested fix
-  const resultIndexByHref = useMemo(
-    () => new Map(results.map((item, index) => [item.href, index])),
+  const resultIndexByItem = useMemo(
+    () => new Map(results.map((item, index) => [item, index] as const)),
     [results],
   );
@@
-            aria-activedescendant={selectedResult ? resultId(selectedResult.href) : undefined}
+            aria-activedescendant={
+              selectedResult ? resultId(selectedResult.href, selectedIndex) : undefined
+            }
@@
-                      const index = resultIndexByHref.get(item.href) ?? -1;
+                      const index = resultIndexByItem.get(item) ?? -1;
@@
-                          key={item.href}
+                          key={resultId(item.href, index)}
                           item={item}
+                          resultIndex={index}
@@
-function AdminCommandResultRow({
+function AdminCommandResultRow({
   item,
+  resultIndex,
@@
   onPick,
 }: {
   item: AdminNavItem;
+  resultIndex: number;
@@
-      id={resultId(item.href)}
+      id={resultId(item.href, resultIndex)}
@@
-function resultId(href: string) {
-  return `admin-command-${href.replace(/[^a-z0-9]+/gi, "-")}`;
+function resultId(href: string, index: number) {
+  return `admin-command-${index}-${href.replace(/[^a-z0-9]+/gi, "-")}`;
 }

Also applies to: 164-168, 215-216, 247-248

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/AdminSectionCommandDialog.tsx` around lines 35 - 37,
Replace use of `href` as the unique identifier with a stable per-result
identity: change the `resultIndexByHref` mapping to use a unique id field (e.g.,
`result.id`) or a generated stable id stored on each result, and update all
places that rely on `href` (the `resultIndexByHref` map, selection logic that
reads/writes selection state, ARIA id generation, and React element `key` usage
in the component methods referenced) to use that stable id instead; ensure any
fallback generation attaches the stable id to the result objects so every
reference (selection mapping, aria-owns/aria-controls ids, and React keys) uses
the same unique symbol (e.g., `resultId`) rather than `href`.

@Quick104
Quick104 marked this pull request as ready for review June 12, 2026 18:38
@Quick104
Quick104 merged commit a4f7102 into main Jun 12, 2026
3 checks passed
@Quick104
Quick104 deleted the codex/admin-settings-search branch June 12, 2026 18:50
@fluxis fluxis added the v1.0 Silo v1 scope - auto-adds to the Silo v1 project label Jun 12, 2026
@fluxis fluxis added this to the v1 milestone Jun 12, 2026
@fluxis fluxis moved this to Done in Silo v1.0.0 Jun 12, 2026
@fluxis fluxis added v1.0-proposed Proposed for the v1 scope lock; awaiting triage v1.0 Silo v1 scope - auto-adds to the Silo v1 project and removed v1.0 Silo v1 scope - auto-adds to the Silo v1 project v1.0-proposed Proposed for the v1 scope lock; awaiting triage labels Jun 13, 2026
Quick104 added a commit that referenced this pull request Jun 17, 2026
[codex] add settings search command palette
@zZebrahz zZebrahz removed this from the v1.0 milestone Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v1.0 Silo v1 scope - auto-adds to the Silo v1 project

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants