Compare commits

...

1 Commits

Author SHA1 Message Date
Jiayuan Zhang
fc70fe84ce fix(views): trim search input in assignee and filter pickers
Leading spaces in search queries caused `.includes()` to fail because
names don't contain leading whitespace. Apply `.trim()` before
`.toLowerCase()` in assignee-picker, actor filter, and project filter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 19:50:23 +08:00
2 changed files with 3 additions and 3 deletions

View File

@@ -173,7 +173,7 @@ function ActorSubContent({
const wsId = useWorkspaceId();
const { data: members = [] } = useQuery(memberListOptions(wsId));
const { data: agents = [] } = useQuery(agentListOptions(wsId));
const query = search.toLowerCase();
const query = search.trim().toLowerCase();
const filteredMembers = members.filter((m) =>
m.name.toLowerCase().includes(query),
);
@@ -306,7 +306,7 @@ function ProjectSubContent({
const [search, setSearch] = useState("");
const wsId = useWorkspaceId();
const { data: projects = [] } = useQuery(projectListOptions(wsId));
const query = search.toLowerCase();
const query = search.trim().toLowerCase();
const filtered = projects.filter((p) =>
p.title.toLowerCase().includes(query),
);

View File

@@ -67,7 +67,7 @@ export function AssigneePicker({
const getFreq = (type: string, id: string) => freqMap.get(`${type}:${id}`) ?? 0;
const query = filter.toLowerCase();
const query = filter.trim().toLowerCase();
const filteredMembers = members
.filter((m) => m.name.toLowerCase().includes(query))
.sort((a, b) => getFreq("member", b.user_id) - getFreq("member", a.user_id));