feat(sessions): add searchable multi-project filters - #267
Merged
Conversation
hoangsonww
marked this pull request as ready for review
August 1, 2026 06:21
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Sessions page’s project-directory filtering and sorting UX by introducing a searchable multi-select directory picker, wiring it through to a repeatable cwd query param on the server, and updating the OpenAPI/docs/wiki mirrors accordingly.
Changes:
- Added repeatable
cwdfiltering forGET /api/sessions(multi-project OR filter) while keeping pagination server-side. - Replaced native directory + sort selectors in the Sessions UI with shared custom controls (
MultiSelect,Select) and added i18n/test/snapshot updates. - Updated API docs/OpenAPI outputs and wiki cache/versioning to reflect the new contract.
Reviewed changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| wiki/sw.js | Bumps wiki cache version to pick up updated assets. |
| wiki/index.html | Documents the new Sessions multi-project picker and bumps i18n-content cache key. |
| wiki/i18n-content.js | Adds translated wiki body-content strings describing the updated Sessions UI behavior. |
| server/routes/sessions.js | Implements repeatable cwd query parsing and SQL IN (...) filtering. |
| server/README.md | Documents repeatable cwd and sorting params on /api/sessions. |
| server/openapi.js | Adds cwd[], sort_by, sort_desc query params to the base OpenAPI spec. |
| server/openapi-extra/override-sessions-agents.js | Updates the richer override docs/examples for sessions list params. |
| server/tests/sessions-multi-cwd-filter.test.js | Adds integration coverage for repeated cwd behavior. |
| README.md | Updates top-level product copy to mention multi-project picker + custom sorting. |
| README-VN.md | VN README copy update for the same feature. |
| README-KO.md | KO README copy update for the same feature. |
| README-CN.md | CN README copy update for the same feature. |
| openapi.yaml | Syncs generated OpenAPI output with new query params/description. |
| index.html | Updates landing-site showcase copy for Sessions filtering/sorting. |
| docs/API.md | Documents q, repeatable cwd, and sort params for /api/sessions. |
| client/src/pages/Sessions.tsx | Switches to multi-select directory filtering, typed sort options, and shared Select UI. |
| client/src/pages/tests/snapshots/screens.snapshot.test.tsx.snap | Updates Sessions snapshot for new controls and aria labels. |
| client/src/lib/api.ts | Serializes cwd as a repeatable query key (cwd=a&cwd=b). |
| client/src/i18n/locales/en/sessions.json | Adds strings for directory picker and sorting labels. |
| client/src/i18n/locales/zh/sessions.json | Adds strings for directory picker and sorting labels. |
| client/src/i18n/locales/vi/sessions.json | Adds strings for directory picker and sorting labels. |
| client/src/i18n/locales/ko/sessions.json | Adds strings for directory picker and sorting labels. |
| client/src/components/MultiSelect.tsx | Introduces new searchable checkbox multi-select popover component. |
| client/src/components/tests/MultiSelect.test.tsx | Adds component tests for filtering/toggling/accessibility names. |
| client/README.md | Updates client documentation/diagram labels for the new Sessions behavior. |
| ARCHITECTURE.md | Updates routing/API contract documentation for Sessions filters/sorting. |
| .codex/rules/default.rules | Removes the prompt-allowed git inspection rule block (policy change). |
Files not reviewed (1)
- wiki/i18n-content.js: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+132
to
+136
| const cwds = Array.isArray(req.query.cwd) | ||
| ? req.query.cwd.filter((cwd) => typeof cwd === "string" && cwd) | ||
| : typeof req.query.cwd === "string" && req.query.cwd | ||
| ? [req.query.cwd] | ||
| : []; |
Comment on lines
+140
to
+146
| <div | ||
| role="dialog" | ||
| aria-label={label} | ||
| className={`absolute z-30 w-[min(32rem,calc(100vw-2rem))] max-w-none overflow-hidden rounded-lg border border-border bg-surface-1 shadow-xl shadow-black/40 ${ | ||
| openUp ? "bottom-full mb-1.5" : "top-full mt-1.5" | ||
| }`} | ||
| > |
Comment on lines
+66
to
+70
| const filteredOptions = useMemo(() => { | ||
| const normalizedQuery = query.trim().toLocaleLowerCase(); | ||
| if (!normalizedQuery) return options; | ||
| return options.filter((option) => option.label.toLocaleLowerCase().includes(normalizedQuery)); | ||
| }, [options, query]); |
Comment on lines
1
to
5
| # Default execution policy rules for this repository. | ||
|
|
||
| # Safe, routine read-only git inspection can run with prompt. | ||
| prefix_rule( | ||
| pattern = ["git", ["status", "diff", "log", "show"]], | ||
| decision = "prompt", | ||
| justification = "Git inspection is allowed with approval.", | ||
| match = [ | ||
| "git status", | ||
| "git diff", | ||
| "git log --oneline -20", | ||
| "git show HEAD~1", | ||
| ], | ||
| not_match = [ | ||
| "git checkout -b feature/new-branch", | ||
| ], | ||
| ) | ||
|
|
||
| # Destructive reset-style operations are blocked. | ||
| prefix_rule( | ||
| pattern = ["git", "reset", "--hard"], |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
cwdAPI filtering so multi-project selections remain server-paginated, plus API, OpenAPI, i18n, test, and documentation coverage.insertSessionstatement, allowing the normal pre-commit gate to complete.Why
The native controls limited project filtering to one directory and did not match the dashboard UI. Remote source chips were aligned against only the title line, which made them sit high when the session ID increased the row height. The integration test setup called an undefined statement, causing Node to cancel its child tests and reject valid commits.
Validation
npm run test:server— 757 passing, 0 failing, 0 cancellednpm run test:client— 278 passing