Skip to content

feat(sessions): add searchable multi-project filters - #267

Merged
hoangsonww merged 7 commits into
masterfrom
agent/improve-sessions-directory-controls
Aug 1, 2026
Merged

feat(sessions): add searchable multi-project filters#267
hoangsonww merged 7 commits into
masterfrom
agent/improve-sessions-directory-controls

Conversation

@hoangsonww

Copy link
Copy Markdown
Owner

Summary

  • Replaced the Sessions directory selector with a custom searchable checkbox picker that supports multiple projects and keeps long paths usable.
  • Replaced the native sort selector with the shared custom dropdown used by the Run page.
  • Added repeatable cwd API filtering so multi-project selections remain server-paginated, plus API, OpenAPI, i18n, test, and documentation coverage.
  • Centered remote-source/platform chips against the full session-row content so they align with status chips.
  • Corrected the multi-directory integration test to use the database's insertSession statement, 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 cancelled
  • npm run test:client — 278 passing
  • Standard pre-commit hook passed formatting plus both test suites

@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested labels Aug 1, 2026
@hoangsonww
hoangsonww marked this pull request as ready for review August 1, 2026 06:21
Copilot AI review requested due to automatic review settings August 1, 2026 06:21
@cursor

cursor Bot commented Aug 1, 2026

Copy link
Copy Markdown

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.

@hoangsonww hoangsonww changed the title Improve Sessions directory filters feat(sessions): add searchable multi-project filters Aug 1, 2026

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.

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 cwd filtering for GET /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 thread server/routes/sessions.js
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"],
@hoangsonww
hoangsonww merged commit 0c53815 into master Aug 1, 2026
20 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Projects

Development

Successfully merging this pull request may close these issues.

2 participants