Skip to content

feat(app): find settings and preferences from the Cmd+K menu - #3707

Merged
kodiakhq[bot] merged 2 commits into
mainfrom
cursor/spotlight-settings-a951
Nov 18, 2026
Merged

kodiakhq[bot] merged 2 commits into
mainfrom
cursor/spotlight-settings-a951

Conversation

@MikeShi42

Copy link
Copy Markdown
Contributor

Summary

Settings were only reachable by clicking through Team settings tabs or the user menu. The Cmd+K menu now finds them and opens the right place:

  • Settings group (hidden in local mode, matching the nav, since /team renders nothing there): Team settings, Sources, Connections, Team members, API keys, Organization API keys, MCP server, Export to Terraform (flag-gated), Webhooks, Query settings. Each one opens /team?tab=<tab>#<section-id>, using the tab values and section ids TeamPage already defines.
  • Preferences group: "Preferences" opens the preferences modal. It also matches searches like time zone, 12h/24h, font, and row click. "Use light mode", "Use dark mode", and "Use system color mode" switch the theme without opening anything.

Supporting changes:

  • The preferences modal's open state now lives in a jotai atom (useUserPreferencesModal), so the spotlight can open the modal that AppNav renders.
  • TeamTabContent scrolls the anchored section into view once the team has loaded. Next's own hash scroll runs before the tab content exists on a cold load, so without this the onboarding MCP link (/team?tab=api-agents#team-api-agents-mcp-server) also landed at the top.
  • The new actions live in spotlightSettingsActions.tsx so Spotlights.tsx stays under 300 lines. The old "Team Settings" menu entry moved into the new group as "Team settings".

Not included: the Access tab (security policies). It only appears when the team has allowedAuthMethods, and adding it would mean fetching the team on every page.

Screenshots or video

The "Before" column is empty because main returns "Nothing found" for these queries. I took these screenshots in local mode, so the Settings group doesn't appear in them.

Before After
Typing light shows color mode actions
Typing time zone shows Preferences
Preferences modal opened from Cmd+K

How to reproduce

Starting point: yarn app:dev:local connected to the demo server for preferences. Use yarn dev for the Settings group, which needs the API.

On main:

  1. Press Cmd+K and type "light", "time zone", or "mcp". Nothing matches except the generic "Team Settings" entry.

On this branch:

  1. Press Cmd+K, type "light", and select "Use light mode". The theme switches.
  2. Press Cmd+K, type "time zone", and select "Preferences". The preferences modal opens.
  3. (yarn dev) Press Cmd+K, type "mcp", and select "MCP server". Team settings opens on the "API & Agents" tab, scrolled to "Connect your AI Agents". Try "users" (Team members) and "api key" (API keys) too.

How to test on Vercel preview

Preview routes: /search

Steps:

  1. Press Control+K (Cmd+K on macOS) to open the search menu.
  2. Type "light mode" and select "Use light mode".
  3. Verify the app switches to the light theme.
  4. Press Control+K, type "time zone", and select "Preferences".
  5. Verify the "Preferences" modal opens.

References

  • Linear Issue:
  • Related PRs:
Open in Web Open in Cursor 

Team settings sections open their tab and scroll to the section, Preferences
opens the preferences modal, and color mode entries switch the theme.

Co-authored-by: Mike Shi <mike@hyperdx.io>
@MikeShi42
MikeShi42 requested a review from a team as a code owner November 18, 2026 07:37
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Nov 18, 2026 7:45am UTC
hyperdx-storybook Ready Ready Preview Nov 18, 2026 7:45am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87d0e97

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the review/tier-3 Standard — full human review required label Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Tier 3 — Standard

Introduces new logic, modifies core functionality, or touches areas with non-trivial risk.

Why this tier:

  • Diff size: 271 production lines changed (Tier 2 max: < 250)

Review process: Full human review — logic, architecture, edge cases.
SLA: First-pass feedback within 1 business day.

Stats
  • Production files changed: 5
  • Production lines changed: 271 (+ 50 in test files, excluded from tier calculation)
  • Branch: cursor/spotlight-settings-a951
  • Author: MikeShi42

To override this classification, remove the review/tier-3 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@MikeShi42 MikeShi42 added the autoapprove label Nov 18, 2026 — with Cursor
@github-actions

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 106 in total (1.13%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 P0/P1 in code this PR adds or changes: fix before asking for review.
  • 🟡 P2 in code this PR changes: your call. Fix if small, otherwise reply.
  • 🔵 P3 is collapsed at the bottom: nobody needs to act on it before merge.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    priority. Reply with one sentence; if it is P0, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

3 finding(s): 🔴 0 P0/P1 · 🟡 2 P2 · 🔵 1 P3

None could be anchored to changed lines; they are listed below. 1 P3 folded at the bottom.

Findings outside the changed lines

  • 🟡 P2 packages/app/src/spotlightSettingsActions.tsx:455 — "Preferences" sets a global atom that only AppNav reads, so it does nothing in dashboard kiosk mode and the modal opens later → withAppNav (packages/app/src/layout.tsx:105-111) mounts HDXSpotlightProvider on every page, but PageWrapper skips <AppNav /> when isDashboardKioskMode (layout.tsx:87). On /dashboards/x?kiosk=true, choosing Cmd+K → Preferences sets userPreferencesModalOpenedAtom to true and nothing appears. The atom stays true, so the modal opens by itself as soon as the user leaves kiosk mode. Fix: render UserPreferencesModal next to the Spotlight in HDXSpotlightProvider, which is mounted wherever the action exists, or hide the action when AppNav isn't rendered.
  • 🟡 P2 packages/app/src/spotlightSettingsActions.tsx:324 — The IS_LOCAL_MODE check on the Organization API keys entry can never take effect → TEAM_SETTINGS_ENTRIES is only used inside the IS_LOCAL_MODE ? [] : [...] branch at line 395, so in local mode the whole list is already dropped. The ...(IS_LOCAL_MODE ? [] : [...]) around settings-org-api-keys never removes anything. Drop that conditional and list the entry directly.
🔵 1 P3 — no action needed before merge
  • 🔵 P3 packages/app/src/spotlightSettingsActions.tsx:297 — Tab values and section ids are hand-copied from TeamPage, and only one href is tested → Each href repeats the tab value and section id strings from TeamPage.tsx (lines 131-233). The MCP string is now written in three places, counting OnboardingChecklist/onboardingTasks.ts:40. If a section is renamed in TeamPage, the link silently lands on the first tab with no scroll, and the only test covers the MCP entry. Fix: export the tab and section ids as constants from a shared module that TeamPage, onboarding and the spotlight all import. Failing that, add a test that checks every TEAM_SETTINGS_ENTRIES href against TeamPage's tab and section ids.

Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 474 passed • 1 skipped • 1037s

Status Count
✅ Passed 474
❌ Failed 0
⚠️ Flaky 3
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

@github-actions

Copy link
Copy Markdown
Contributor

Deep Review

Spotlight (Cmd+K) settings/preferences feature. No P0/P1 issues surfaced: I independently cross-checked all nine deep-link href values in spotlightSettingsActions.tsx against the value: and id: strings in TeamPage.tsx and every one resolves to a real tab and section, the IS_LOCAL_MODE/IS_IAC_EXPORT_ENABLED gating matches TeamPage, setUserPreference({ colorMode }) is well-typed, and the jotai atom migration preserves the previous useDisclosure behavior. The remaining findings are maintainability coupling and test-coverage gaps.

✅ No critical issues found.

🟡 P2 -- recommended

  • packages/app/src/spotlightSettingsActions.tsx:38 -- The nine deep-link href strings hardcode TeamPage's tab values and section ids with no shared constant, so renaming or removing a tab/section id in TeamPage.tsx silently breaks the spotlight links with no compile-time error, and only the mcp link is test-covered.
    • Fix: Export the tab values and section ids from TeamPage.tsx (or a shared module) and build the TEAM_SETTINGS_ENTRIES hrefs from those named constants.
  • packages/app/src/spotlightSettingsActions.tsx:142 -- The core new behavior "Settings group is hidden in local mode" has no test; Jest runs with IS_LOCAL_MODE false, so the IS_LOCAL_MODE ? [] : [...] empty branch is never exercised.
    • Fix: Add a test that re-imports the module with NEXT_PUBLIC_IS_LOCAL_MODE='true' and asserts no Settings group / team-settings action is produced.
  • packages/app/src/TeamPage.tsx:72 -- The new TeamTabContent deep-link scroll effect (scrollTargetId derivation + requestAnimationFrame + scrollIntoView) is the point of the refactor but has no test; the spotlight test only asserts router.push was called, never that the section scrolls into view.
    • Fix: Add a TeamTabContent test spying on Element.scrollIntoView for matching/non-matching hash and active/inactive tab cases.
🔵 P3 nitpicks (3)
  • packages/app/src/spotlightSettingsActions.tsx:71 -- The IS_LOCAL_MODE / IS_IAC_EXPORT_ENABLED section gating is re-implemented here and in TeamPage.tsx; if the two diverge, the spotlight deep-links to a section that no longer renders.
    • Fix: Derive both the spotlight entries and the TeamPage sections from a single gated source of truth.
  • packages/app/src/spotlightSettingsActions.tsx:91 -- The conditional org-api-keys and terraform-export entries have no test asserting presence or absence under either flag state, so a regression dropping or duplicating them would pass.
    • Fix: Assert the generated action ids for both flag configurations.
  • packages/app/src/spotlightSettingsActions.tsx:174 -- All three COLOR_MODE_ENTRIES share an identical keywords array, so searching "light" surfaces light/dark/system together rather than disambiguating.
    • Fix: Derive per-entry keywords from entry.colorMode/label, or hoist the shared list to a named constant to mark the duplication intentional.

Reviewers (4): testing, maintainability, agent-native, learnings-researcher. Agent-native found no parity gaps (spotlight is a human-convenience layer over navigation/theme; the agent surface is the MCP server, unaffected). Learnings-researcher found no applicable prior solutions in docs/solutions/.

Testing gaps:

  • No local-mode (IS_LOCAL_MODE=true) coverage for the hidden Settings spotlight group.
  • TeamTabContent scroll-into-view effect and its branches are untested.
  • Only the light color-mode entry is exercised; dark and system onClick handlers are untested.
  • The correctness, adversarial, kieran-typescript, frontend-races, and project-standards reviewers did not return before synthesis; the orchestrator independently verified the href cross-checks, type safety of the color-mode call, scroll-effect mount timing, and jotai migration parity in their place, but a follow-up pass on the single-requestAnimationFrame scroll robustness (silent no-op if the section mounts a frame later) is worth confirming.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond

@kodiakhq
kodiakhq Bot merged commit 0e9fb1b into main Nov 18, 2026
28 checks passed
@kodiakhq
kodiakhq Bot deleted the cursor/spotlight-settings-a951 branch November 18, 2026 07:50

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 87d0e97a Deployed Nov 18, 2026 by vercel[bot]
Preview – hyperdx-storybook — 87d0e97a Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge review/tier-3 Standard — full human review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants