Skip to content

feat(console): rank search results in one list and say where each is - #2968

Merged
fforootd merged 6 commits into
mainfrom
claude/global-search-ux-console-b7d37f
Nov 11, 2026
Merged

fforootd merged 6 commits into
mainfrom
claude/global-search-ux-console-b7d37f

Conversation

@fforootd

@fforootd fforootd commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Context

  • No issue. Comes from testing the console's search (⌘K) on preview.zitadel.com beside Vercel's Find. Vercel puts a handful of rows in one list, best match first, puts the current project's rows before the team's (Logs · cloud above Logs · zitadel), and says beneath every row where it is.
  • Ours grouped hits by kind and named the selected project only in the pages' heading. A page of the project and a project of that name sat in two groups (Branding / test-branding). Two projects called my_shop looked the same. "admin" answered "Nothing matches" without saying it had searched one project, or none.

Summary

  • Once something is typed, the palette shows one list of at most eight rows instead of a group per kind. Rows are ranked by how the name matches (whole, start, start of a word, anywhere inside). Among equally good matches, the selected project's rows come before what is above every project, then pages, actions, users, teams, configuration, projects and the account (closeness / ranked in features/search/model.ts).
  • Beneath every row is where it is:
    • for pages, actions and hits, the project, after the hit's own second line (grace@example.com · console-dev);
    • for a project, its site's host or else its ID, as the switcher shows it (D21);
    • for Settings' pages, Settings;
    • for a project's page while no project is selected, Choose a project (D22).
  • "See all users matching…" also shows when the eight-row cap hid a user, not only when the server reports more.
  • When nothing matches, the palette names the project it searched ("Nothing in console-dev matches 'admin'") and says users, teams and configuration are found in the selected project only. With no project selected, it says to choose one.
  • Before anything is typed it stays the grouped menu (D33). Its Projects group now opens as the project switcher does: the selected and recent projects, then the rest by name while one page holds them all, instead of the first page in the server's order.
  • Shared pieces, so the palette is not a second copy:
    • CommandItemText in components/ui/command.tsx, the label-over-description row text, now used by the combobox too;
    • openingList moved from the switcher into features/projects/recent-projects.ts.
  • Decision log entry D37 (amends D32). main already cites D36 for keeping the selected project on Projects and Settings (fix(console): keep the selected project on Projects and Settings, and tidy Logs' search and filters #2977).
  • After a review of the stack:
    • an empty list reads "Searching…" until every search has answered, not "Nothing matches";
    • Projects falls back to the first page when none is selected or recent;
    • a row also ranks on its second line, so a user found by their identifier no longer sorts last;
    • each opening mounts a fresh palette;
    • the account's rows say "Account" beneath them, and with no project selected a project's pages rank after projects;
    • useProjectSearch reads nothing until something is typed.

Validation

  • moon run console:typecheck console:lint console:test console:build: all pass, 907 tests.
  • New tests:
    • unit tests for closeness and ranked;
    • a ranked list mixing pages, a team, a project and a user;
    • two projects of one name told apart;
    • the Projects group opening on the selected and recent projects;
    • the empty message with and without a selected project.
  • Existing palette tests were updated from per-kind groups to the one list.
  • Checked by hand on moon run console:dev-real (local instance, seeded data):
    • "log" lists Login flows, Logs and the default-login flow, each with console-dev beneath;
    • "hop" finds Grace Hopper with her email and the project;
    • "admin" names the project it searched.
  • That instance has one project, so recent-projects ordering and duplicate project names were checked by the tests only.

Release notes / changeset

  • Changeset: .changeset/console-search-ranked-list.md, listing @zitadel/server (minor). The Console's search now shows the best matches of every kind in one list, the selected project's first, each saying beneath its name where it is. It replaces the extension of .changeset/search.md, which the release in build: version packages #2887 consumed.

Notes

  • Not in this PR: searching users, teams and configuration across all projects. ADR 087 lists leaving out project_id as later work. Each type's text match needs an index before a search may span projects (no database scans for search), and the team name match still reads every team of a project.
  • The row's second line makes typed rows two lines tall, so the list's max height went from 340px to 440px.

🤖 Generated with Claude Code

Once something is typed, the palette lists the best matches of every kind
in one list of at most eight rows instead of a group per kind: ranked by how
the name matches (whole, start, a word's start, inside), the selected
project's rows first among equals. Beneath each row is where it is: the
project (after a hit's own second line), a project's host or else its ID,
Settings for its pages, or "Choose a project" for a project's page while
none is selected. When nothing matches it names the project it searched, or
says one is needed. Before anything is typed its Projects open on the
selected and recent ones, as the switcher does.

- `closeness` and `ranked` in features/search/model.ts
- `CommandItemText`, the two-line row text, shared with the combobox
- `openingList` moved to features/projects/recent-projects.ts
- Decision D36; the unreleased search changeset extended

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 05:11
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cloud Ready Ready Preview Nov 11, 2026 5:32pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-11T05:15:23.495716Z 2a94edc PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦋 Changeset detected

Latest commit: c38f86f

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

This PR includes changesets to release 25 packages
Name Type
@zitadel/server Minor
@zitadel/cli Minor
@zitadel/testing Minor
@zitadel/server-linux-x64 Minor
@zitadel/server-linux-arm64 Minor
@zitadel/server-darwin-x64 Minor
@zitadel/server-darwin-arm64 Minor
@zitadel/server-win32-x64 Minor
@zitadel/api Minor
@zitadel/config Minor
@zitadel/components Minor
@zitadel/sdk-core Minor
@zitadel/sdk-next Minor
@zitadel/sdk-nuxt Minor
@zitadel/sdk-react Minor
@zitadel/sdk-vue Minor
@zitadel/sdk-angular Minor
@zitadel/sdk-solid Minor
@zitadel/sdk-svelte Minor
@zitadel/sdk-qwik Minor
@zitadel/sdk-sveltekit Minor
@zitadel/sdk-solid-start Minor
@zitadel/sdk-qwik-router Minor
@zitadel/sdk-tanstack-start Minor
@zitadel/cloud 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

Copilot AI 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.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

A moderate active issue remains in apps/console/src/app-shell/search.tsx where the results list can exceed the documented MAX_RESULTS limit after pushing the “See all users…” row, contradicting the stated eight-row cap.

1 open issue
What changed in this PR

Updates the Console command palette search to show a single, ranked mixed-results list after typing, with a consistent “where it is” description under each row, while reusing shared UI and project ordering logic to match existing switcher/combobox behavior.

Changes:

  • Replace per-kind grouped typed results with one ranked list capped to a small set of best matches.
  • Add per-row context (“where it is”) to disambiguate similarly named items and improve empty-state messaging.
  • Extract and reuse shared components/helpers (CommandItemText, openingList) and update tests, decision log, and changeset.
File Description
docs/​design/​decisions.md Adds a decision log entry documenting the updated search palette ranking and contextual “where it is” row descriptions.
apps/​console/​src/​features/​search/​model.ts Implements ranking utilities (e.g., closeness tiers and deterministic ordering) for mixed-kind search results.
apps/​console/​src/​features/​search/​model.spec.ts Adds unit tests covering ranking behavior, tie-breaks, and match-tier handling.
apps/​console/​src/​features/​projects/​recent-projects.ts Moves/exports shared project “opening list” logic to order selected and recent projects before the rest.
apps/​console/​src/​components/​ui/​command.tsx Introduces CommandItemText to render a consistent label + optional description layout for command items.
apps/​console/​src/​components/​ui/​combobox.tsx Reuses CommandItemText to align combobox option rendering with the command palette row layout.
apps/​console/​src/​app-shell/​search.tsx Refactors the palette to keep grouped navigation before typing and show a ranked single list after typing, including per-item context lines and updated empty/overflow behavior.
apps/​console/​src/​app-shell/​context-switcher.tsx Switches to the shared openingList helper so project ordering matches the palette and other entry points.
apps/​console/​src/​app-shell/​app-shell.tsx Passes userId through to search-related components to support per-user recent-project behavior.
apps/​console/​src/​app-shell/​app-shell.spec.tsx Updates existing tests and adds coverage for ranking, disambiguation text, project ordering, and empty-state messaging in the palette.
.changeset/​search.md Updates the unreleased changeset to describe the new ranked mixed-results palette behavior and contextual row descriptions.

Review effort: Balanced

Comment thread apps/console/src/app-shell/search.tsx Resolved
The row that opens Users took a ninth place past the cap; it now takes the
list's last place. The palette's field, debounce and searches lived on the
always-mounted dialog, so closing it let a reset timer and in-flight answers
update state after a test's last assertion, which CI's slower runner hit as
an act() warning. They now live in a body the dialog mounts only while open:
each opening starts empty, and closing drops pending work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve two conflicts with #2977: the combobox keeps main's chip rows and
ruled groups and draws a plain row with the shared `CommandItemText`; the
palette keeps its restructure and copies the project id through main's
`copyText`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew found

- An empty list reads "Searching…" until every search has answered the text
  in the field, not "Nothing matches".
- Before typing, Projects falls back to the first page when the person has
  more than one page and none selected or recent, instead of vanishing.
- A row also ranks on its second line, so a user found by the start of
  their identifier no longer sorts last.
- Each opening mounts a fresh palette, also when reopened while the dialog
  animates out.
- The account's rows say "Account" beneath them once typed; with no project
  selected, a project's pages rank after projects.
- `useProjectSearch` reads nothing until something is typed: both fields
  open on `useMyProjects`.
- The decision is D37: main already cites D36 for keeping the selected
  project on Projects and Settings.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
No conflicts. Picked up for the stack: main's invitations migration takes
the numbers #2972's search_entries migration used.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
main released (#2887), which consumed `.changeset/search.md`, the pending
changeset this branch had extended. Take the deletion and give this change
its own changeset, `console-search-ranked-list.md`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@fforootd
fforootd added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit e40ac5a Nov 11, 2026
25 of 26 checks passed
@fforootd
fforootd deleted the claude/global-search-ux-console-b7d37f branch November 11, 2026 19:14
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Nov 11, 2026
fforootd added a commit that referenced this pull request Nov 11, 2026
Resolves the decisions log conflict with #2968, which added D37: the
events screen's decision is D38 (D36 is already cited in the console's
code). The search specs #2968 added no longer expect a Logs row for "log".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fforootd added a commit that referenced this pull request Nov 11, 2026
Main took #2968 as the squash e40ac5a. The branch already held its
commits, so the conflicted console files and decisions.md keep this
side; the ADR index keeps this side's 087 row and adds main's 088.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fforootd added a commit that referenced this pull request Nov 11, 2026
main renamed Logs to Events (#3004, D38) and made search one ranked list
(#2968, D37). The project's Settings list keeps its place beside Events'
in the shell, its pages join the ranked list marked "Settings · <project>",
and its decision is renumbered D39 and logged in docs/design/decisions.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — c38f86ff Deployed Nov 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants