Skip to content

feat(app): team settings sidebar with search and one page per setting - #3820

Open
jordan-simonovski wants to merge 2 commits into
mainfrom
jordansimonovski/team-settings-sidebar
Open

jordan-simonovski wants to merge 2 commits into
mainfrom
jordansimonovski/team-settings-sidebar

Conversation

@jordan-simonovski

@jordan-simonovski jordan-simonovski commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Team settings moves from six tabs to a grouped sidebar (Data, Team, Alerting, Developer) with one page per setting. The search box also finds settings inside a page, so typing "parallelize" opens Query settings, scrolls to "Parallelize queries when possible" and highlights it.

  • Search matches page names, descriptions and keywords, plus the settings registered inside a page. Enter opens the best match, and cmd-K finds the same settings.
  • Ingestion, personal and organisation API keys now share one API keys page, which links to the Cloud API reference and the Terraform provider docs.
  • On narrow screens a searchable select replaces the sidebar.
  • Query settings labels are now sentence case, as the code style guide requires.

Breaking changes

None. Old ?tab= values and section anchors redirect to the matching page, so ?tab=api-agents#team-api-agents-mcp-server opens AI agents and /team#sources opens Sources. #source-<id> links still open their source. Spotlight and onboarding links point at the new pages.

Key decisions

  • The team name stays editable in the page header. A separate "General" page would have held only that field.
  • Only query settings and the three key types are registered for search so far. Query settings labels are read from the same registry, so a renamed label can't fall out of step with search.

Screenshots or video

Before After
Data tab Sources page
before-1-data after-1-data
API & Agents tab API keys page
before-2-api after-2-api
Integrations tab Webhooks page
before-3-integrations after-3-integrations
Query Settings tab Query settings page
after-4-query before-4-query
(no search) Search for "parallelize" jumps to the setting
after-5-search

How to reproduce

Starting point: yarn dev. Team settings doesn't render in local mode, so play.hyperdx.io and the Vercel preview can't show it.

On main:

  1. Open Team settings from the left nav.
  2. Open "API & Agents": personal keys, organisation keys, MCP setup and Terraform export are stacked on one tab, and there is no search.

On this branch:

  1. Open Team settings: a sidebar lists each setting under Data, Team, Alerting and Developer.
  2. Type "parallelize" in "Search settings" and press Enter: Query settings opens and "Parallelize queries when possible" is scrolled into view and highlighted.
  3. Open /team?tab=api-agents#team-api-agents-mcp-server: it redirects to ?tab=mcp (AI agents).
  4. Narrow the window below 860px: a select replaces the sidebar.

How to test on Vercel preview

N/A. Team settings doesn't render in local mode, which the preview runs.

Implementation detail
  • settingsPages.tsx is the single list of pages and their searchable settings. The sidebar, spotlight and resolveSettingsPage (legacy ?tab= and anchor mapping) all read from it.
  • Only the active page mounts, so the old per-tab active flag for lazy fetching is gone.
  • useScrollToSetting waits for the field to render once the team has loaded, then scrolls to it and highlights it. Reduced-motion users get an outline instead of the fade.
  • Tests: unit tests for page resolution (every legacy tab and anchor), search matching and spotlight settings; the team.spec.ts e2e suite (13 passing) covers navigation, search, jump-to-setting and the legacy redirect.

Team settings moves from six tabs to a grouped sidebar with a search box that
also finds individual settings, such as "Parallelize queries when possible",
and jumps to them. API keys and organization API keys share one page, with
links to the API and Terraform docs. Old ?tab= and section links redirect to
the new pages, and spotlight and onboarding point at them.
@jordan-simonovski
jordan-simonovski requested a review from a team as a code owner November 25, 2026 06:03
@vercel

vercel Bot commented Nov 25, 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 25, 2026 7:11am UTC
hyperdx-storybook Ready Ready Preview Nov 25, 2026 7:11am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1f26823

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-4 Critical — deep review + domain expert sign-off label Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔴 Tier 4 — Critical

Touches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI.

Why this tier:

  • Large diff: 1547 production lines changed (threshold: 1000)

Review process: Deep review from a domain expert. Synchronous walkthrough may be required.
SLA: Schedule synchronous review within 2 business days.

Stats
  • Production files changed: 20
  • Production lines changed: 1547 (+ 368 in test files, excluded from tier calculation)
  • Branch: jordansimonovski/team-settings-sidebar
  • Author: jordan-simonovski

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

@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 107 in total (1.12%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

github-actions Bot commented Nov 25, 2026 •

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 · 🟡 1 P2 · 🔵 2 P3

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

Findings outside the changed lines

  • 🟡 P2 packages/app/src/components/TeamSettings/ApiKeysSection.tsx:575 — Rotate buttons' aria-label doesn't contain their visible text 'Rotate key' (WCAG 2.5.3, label in name) → Both buttons show 'Rotate key', but their accessible names are 'Rotate ingestion API key' and 'Rotate personal access key', which don't contain that phrase. A voice-control user who says 'click Rotate key' won't match either one. Put the qualifier in visible text (e.g. 'Rotate ingestion key'), or tie each button to its row title with aria-describedby instead of replacing the name.
🔵 2 P3 — no action needed before merge
  • 🔵 P3 packages/app/src/components/TeamSettings/IacMigrationSection.tsx:121 — active prop on IacMigrationSection is now dead: its only caller passes nothing, so it is always true → renderSettingsPage in TeamPage.tsx now renders a bare <IacMigrationSection /> and only the active page mounts. Remove the active prop and its doc comment, and call useIacImportManifest() without the enabled: active plumbing, so no one later thinks the lazy-fetch gate still works.
  • 🔵 P3 packages/app/src/components/TeamSettings/TeamSettingsNav.tsx:1402 — value as SettingsPageId cast breaks the 'Avoid as casts' convention → Narrow the value with a type guard instead, e.g. const page = pages.find(p => p.id === value); if (page) onSelect(page.id);. Then an unexpected value is dropped rather than cast through as a page id.

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 25, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

Team settings is refactored from six Mantine Tabs to a grouped sidebar with one page per setting, in-page search, legacy ?tab=/anchor redirects, a consolidated API keys page, and a useScrollToSetting scroll-and-highlight hook. Nine reviewers traced the routing, redirect, search, and scroll paths. No ship-blockers surfaced: resolveSettingsPage always falls back to a valid page, the redirect effect is loop-safe (guarded by queryTab === activeId && !legacyAnchor), #source-<id> deep links are preserved, and the renderSettingsPage switch is exhaustive over currently-reachable ids. The findings below are quality and edge-case improvements.

✅ No critical issues found.

🟡 P2 — recommended

  • packages/app/src/components/TeamSettings/settingsPages.tsx:178 — In local mode the api-keys page still registers the setting-org-api-keys search/spotlight item, but OrgApiKeysSection (which owns that anchor) only renders when !IS_LOCAL_MODE, so searching "org" and pressing Enter runs useScrollToSetting's requestAnimationFrame poll for the full 3s with no scroll and no feedback, landing on a page without the section.
    • Fix: Gate the setting-org-api-keys item (and the rarely-hit setting-personal-access-key item on me == null) on the same condition that renders its section, or short-circuit the scroll when the anchor never mounts.
    • correctness, adversarial, agent-native
  • packages/app/src/components/TeamSettings/settingsPages.tsx:169 — The anchors setting-ingestion-api-key, setting-personal-access-key, and setting-org-api-keys are typed as raw string literals in both the registry and the section components (ApiKeysSection.tsx, OrgApiKeysSection.tsx), so renaming one side silently breaks search and scroll with no type error and no failing test — unlike the query-settings path, which shares QUERY_SETTINGS/querySettingAnchor.
    • Fix: Export named anchor constants and reference them from both the registry items and the section id props, mirroring querySettingAnchor.
    • maintainability
🔵 P3 nitpicks (8)
  • packages/app/src/TeamPage.tsx:46 — The renderSettingsPage switch covers all nine SettingsPageId members but has no default/assertNever, and with noImplicitReturns:false a future union member compiles clean and renders a blank page body under the header.
    • Fix: Add a default branch that assigns id to a never binding so new ids fail at compile time.
    • maintainability, kieran-typescript
  • packages/app/src/components/TeamSettings/settingsPages.tsx:245 — resolveSettingsPage only sets legacyAnchor: true when the anchor resolves to a surviving page, so a legacy anchor pointing at a filtered-out page (e.g. ?tab=access#team-access-security-policies with no auth methods) is left in the URL, and because anchor lookup precedes the tab, reloading that stale URL once the page becomes available overrides the resolved tab.
    • Fix: Strip any hash whose LEGACY_ANCHORS mapping exists regardless of whether the target page is currently visible.
    • adversarial
  • packages/app/src/components/TeamSettings/useScrollToSetting.ts:29 — scrollIntoView({ behavior: 'smooth' }) is unconditional; the prefers-reduced-motion block in the stylesheet neutralizes only the highlight animation, not the scroll motion.
    • Fix: Use behavior: 'auto' when matchMedia('(prefers-reduced-motion: reduce)').matches.
    • julik-frontend-races
  • packages/app/src/components/TeamSettings/TeamSettingsNav.tsx:84 — The filtered result list and the "No settings match" message have no aria-live/role="status", so screen-reader users hear neither result-count changes nor the empty state as they type.
    • Fix: Wrap the results/empty region in role="status" aria-live="polite".
    • agent-native
  • packages/app/src/components/TeamSettings/TeamSettingsNav.tsx:113 — Nav setting sub-item links carry no aria-current even when the current hash equals item.anchor, so there is no programmatic "you are here" at setting granularity.
    • Fix: Thread the active hash into the nav and set aria-current on the matching sub-item.
    • agent-native
  • packages/app/src/components/TeamSettings/TeamSettings.module.scss:217 — Below 860px .nav (which holds the search box and the only affordance that surfaces per-setting sub-items) is display:none and only the page-level <Select> shows, so mobile has no in-UI way to reach a specific setting anchor.
    • Fix: Surface the search box or the sub-items in the narrow-screen layout.
    • agent-native
  • packages/app/src/components/TeamSettings/settingsPages.tsx:219 — Precise legacy subsection anchors (e.g. team-advanced-query-settings, team-api-agents-org-api-keys) map to a page id with legacyAnchor:true and the hash is then dropped, so old bookmarks land at the page top instead of the corresponding setting-* anchor.
    • Fix: Where an old anchor has a clear new equivalent, map it to the matching setting-* anchor rather than dropping it.
    • agent-native
  • packages/app/src/TeamPage.tsx:59 — The webhooks page renders IntegrationsSection, a now-vestigially-named pass-through wrapper (Box id="integrations"/Card/Stack around WebhooksSection) left over from the old "Integrations" tab.
    • Fix: Inline the wrapper into WebhooksSection or rename it and drop the stale integrations ids.
    • maintainability
  • packages/app/src/components/TeamSettings/TeamMembersSection.tsx:222 (pre-existing) — "Team Members" heading and "Invite Team Member" button use Title Case, against the sentence-case style rule; unchanged by this PR but in a touched file.
    • Fix: Rephrase to "Team members" / "Invite team member".
  • packages/app/src/TeamPage.tsx:228 (pre-existing) — The icon-only edit-team-name control is a Button wrapping IconPencil where the style guide requires ActionIcon; unchanged by this PR but in a touched file.
    • Fix: Convert to ActionIcon.

Reviewers (9): correctness, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races, adversarial, agent-native, learnings-researcher.

Testing gaps:

  • CI e2e (team.spec.ts) covers the happy paths, but useScrollToSetting's timing edge cases (wait-for-element timeout, jumpNonce replay, highlight restart, unmount cleanup) have no unit coverage and are hard to assert via e2e.
  • No unit/component test for TeamSettingsNav's Enter "best match" selection (page-match vs items[0].anchor) or the TeamPage redirect-effect convergence (legacy tab, legacy anchor, page-owned hash, no-loop guarantee).
  • No test asserts each SETTINGS_PAGES item anchor maps to a rendered element id (the drift path above), that renderSettingsPage returns a node for every id, or the terraform/requiresAuthPolicy filtered-out routing.
  • 2 low-confidence findings were suppressed by the confidence gate: a possible target-drift when sibling rows render after the scroll, and the unchecked as SettingsPageId cast on the <Select> onChange.

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

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 478 passed • 1 skipped • 1114s

Status Count
✅ Passed 478
❌ Failed 0
⚠️ Flaky 13
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

This branch was successfully deployed

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

Labels

review/tier-4 Critical — deep review + domain expert sign-off

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant