feat(web): search the whole panel from one place
Finding anything meant knowing which tab it lived in — fine once you have learned the panel, hopeless before. ⌘K now covers cards, repositories, issues, wiki pages and members at once. Pages are matched in the browser, so the palette answers before it has asked the server and stays useful while the forge is down. Each remote source is queried independently and a source that fails is simply absent from the results, rather than taking the others with it. Issues come from one organization-wide request: per repository, the palette could not afford them on every keystroke. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
fcc82d82d6
commit
9acb523510
10 files changed
+926
-3
No files matched your search
@@ -327,3 +327,26 @@ export function listAssignees(guildId) {
|
||||
)
|
||||
.all(guildId);
|
||||
}
|
||||
|
||||
/** Cards whose title, body, labels or issue matches, for the command palette (M19). */
|
||||
export function searchCards(guildId, term, limit = 8) {
|
||||
const needle = `%${term}%`;
|
||||
return getDatabase()
|
||||
.prepare(
|
||||
`SELECT c.*,
|
||||
b.name AS board_name,
|
||||
b.scope AS board_scope,
|
||||
b.repository,
|
||||
col.name AS column_name,
|
||||
col.is_done AS column_is_done
|
||||
FROM project_cards c
|
||||
JOIN project_boards b ON b.id = c.board_id
|
||||
JOIN project_columns col ON col.id = c.column_id
|
||||
WHERE b.guild_id = ?
|
||||
AND (c.title LIKE ? OR c.body LIKE ? OR c.labels LIKE ? OR c.issue_ref LIKE ?)
|
||||
ORDER BY col.is_done, c.due_at IS NULL, c.due_at, c.id DESC
|
||||
LIMIT ?`,
|
||||
)
|
||||
.all(guildId, needle, needle, needle, needle, limit)
|
||||
.map(parseAssignedCard);
|
||||
}
|
||||
Reference in new issue
Block a user