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
@@ -2,6 +2,7 @@ import { api } from './core/api.js';
|
||||
import { h, mount, qs } from './core/dom.js';
|
||||
import { onStatus, resetSubscriptions, startLive } from './core/live.js';
|
||||
import { activePath, highlight } from './core/nav.js';
|
||||
import { bindPalette, openPalette } from './core/palette.js';
|
||||
import { ACCESS_LABELS, button, spinner, toast } from './core/ui.js';
|
||||
|
||||
/** Shell, navigation and hash routing of the dashboard (M16-T11). */
|
||||
@@ -208,6 +209,8 @@ function visibleRoutes() {
|
||||
);
|
||||
}
|
||||
|
||||
const SHORTCUT = navigator.userAgent.includes('Mac') ? '⌘K' : 'Ctrl+K';
|
||||
|
||||
function sidebar() {
|
||||
const visible = visibleRoutes();
|
||||
|
||||
@@ -227,6 +230,18 @@ function sidebar() {
|
||||
h('img', { src: 'favicon.svg', alt: '' }),
|
||||
h('div', {}, h('strong', { text: 'FWS-Bot' }), h('span', { text: 'Tableau de bord' })),
|
||||
),
|
||||
h(
|
||||
'button',
|
||||
{
|
||||
class: 'nav-search',
|
||||
type: 'button',
|
||||
onClick: () => openPalette(visibleRoutes()),
|
||||
title: `Recherche globale (${SHORTCUT})`,
|
||||
},
|
||||
h('span', { class: 'nav-icon', text: '⌕' }),
|
||||
h('span', { text: 'Rechercher' }),
|
||||
h('kbd', { text: SHORTCUT }),
|
||||
),
|
||||
h(
|
||||
'nav',
|
||||
{ class: 'nav' },
|
||||
@@ -413,6 +428,7 @@ async function boot() {
|
||||
|
||||
startLive();
|
||||
showBuild();
|
||||
bindPalette(visibleRoutes);
|
||||
|
||||
window.addEventListener('hashchange', () => {
|
||||
const main = qs('.main');
|
||||
|
||||
Reference in new issue
Block a user