Repository navigation
Conversation
Add a search input at the top of the sidebar that filters projects and chat sessions by name in real time. Matching projects auto-expand to reveal matching sessions; non-matching sessions are hidden. - Add search input with icon and clear button to sidebar header - Filter pinned sessions, project entries, temporary sessions, and remote project groups by query (case-insensitive) - Auto-expand matching project groups during search - Show 'No results' placeholder when search yields no projects - Add i18n keys for all 9 supported locales - Add CSS styles using existing design tokens
muzimu217
left a comment
There was a problem hiding this comment.
The projection approach is the right one: forcing collapsed: false on a derived entry (rather than writing to the stored collapse state) means clearing the query restores exactly what the user had open, with no "search permanently expanded my sidebar" surprise. Same for filtering pinned, temporary and remote groups through one sessionMatchesSearch predicate — one rule, four call sites, which is what keeps them from drifting.
Two things I would add:
-
No test file. The whole change is a pure filter over four lists plus one predicate, which is the easiest thing in this codebase to pin — and the sidebar already has
*.test.mjsneighbours to put it in. A fixture with a pinned session, a project whose name matches but whose sessions do not, a session matched by title only, and a query that matches nothing (the "No results" branch) would cover every branch the diff introduces. -
toLowerCase()on a Turkish locale. The app shipstr, where"I".toLowerCase()is"ı"and"i".toLowerCase()is"i", so a user typing an uppercaseIwill not matchiin a title.toLocaleLowerCase()with the active locale — or a simple case-fold that keeps ASCII behaviour for non-Turkish locales — avoids a bug that only that locale will ever report.
Matching the project path as well as its name is a judgement call I would keep: it makes "find that repo by directory name" work when the display name is a shortened label.
|
The shape here is right — a derived entry that expands when it matches and restores your real state when the query is cleared, with one matching rule shared by all four lists, is what keeps this from drifting later. Two review points are still open in the code: case handling breaks for Turkish, and there is no test file yet. Also, no automatic check has ever run on this branch, so nothing here is verified yet. 这里的形状是对的——命中时派生条目展开、清空查询后恢复你原来的状态,四张列表共用一条匹配规则,这样以后不容易走样。 代码里还有两个 review 点没落:大小写处理在土耳其语下会出错;还没有测试文件。另外这个分支从未跑过任何自动检查,所以目前还没有经过验证。 |
Summary
Add a search input at the top of the sidebar that filters projects and chat sessions by name in real time.
Changes
Files
Testing