Palette: filter/jump/inject the current channel's issues via a # prefix #37

Closed
opened 2026-08-27 07:04:43 +01:00 by pedromcaraujo · 0 comments

Follow-on to the side panel (#31): surface the active channel's Forgejo issues in the Alt+K command palette, so you can filter/jump/inject an issue without opening the drawer.

Why it's not as hard as the per-channel nature suggests

paletteItems(q) already rebuilds on every keystroke and activate() already branches on item kind (channel vs action). Adding an issue kind that reads the current channel's panel is the same pattern — there's no global issue state, it's always "the active channel's issues". The only new machinery is a small per-channel issues cache (the drawer already fetches /panel/<ch>/issues; cache it keyed by channel with a short TTL, and let the palette lazily fetch on open if the drawer was never opened). Channels without a forgejo-issues panel contribute nothing.

Design: a # prefix mode

Keep issues out of the default palette (a repo can have dozens of open issues and it would bury the channel list). Reserve a leading # in the palette input as an issues filter for the current channel:

  • # → list the active channel's open issues
  • #auth → filter them by title
  • #31 → jump to number 31

This is free: nobody types # to find a channel today (you type the name; the # shown is decoration). Default palette behaviour is unchanged; issues appear only on demand.

Activation

  • Enter = inject — reuse injectIssue() to type look at issue #N: <title> into the terminal (the keyboard-only twin of clicking the number in the drawer).
  • Ctrl/⌘+Enter = open in Forgejo (secondary).
  • In # mode, a top "+ New issue…" entry focuses the drawer's quick-add (depends on step 4 / #).

Notes / limits

  • The list endpoint caps at LIST_LIMIT (50), so #-filtering searches the 50 most-recent open issues client-side. Fine for most repos; for a big tracker, add server-side search later (/panel/<ch>/issues?q=… → Forgejo issue search) and drop the cap. Log the cap for now.
  • The inject half has no dependency on quick-add and could ship alongside step 4; only the "New issue" entry needs it.

Refs #31.

Follow-on to the side panel (#31): surface the active channel's Forgejo issues in the Alt+K command palette, so you can filter/jump/inject an issue without opening the drawer. ## Why it's not as hard as the per-channel nature suggests `paletteItems(q)` already rebuilds on every keystroke and `activate()` already branches on item *kind* (channel vs action). Adding an `issue` kind that reads the **current** channel's panel is the same pattern — there's no global issue state, it's always "the active channel's issues". The only new machinery is a small per-channel issues cache (the drawer already fetches `/panel/<ch>/issues`; cache it keyed by channel with a short TTL, and let the palette lazily fetch on open if the drawer was never opened). Channels without a `forgejo-issues` panel contribute nothing. ## Design: a `#` prefix mode Keep issues out of the default palette (a repo can have dozens of open issues and it would bury the channel list). Reserve a **leading `#`** in the palette input as an issues filter for the current channel: - `#` → list the active channel's open issues - `#auth` → filter them by title - `#31` → jump to number 31 This is free: nobody types `#` to find a *channel* today (you type the name; the `#` shown is decoration). Default palette behaviour is unchanged; issues appear only on demand. ## Activation - **Enter = inject** — reuse `injectIssue()` to type `look at issue #N: <title>` into the terminal (the keyboard-only twin of clicking the number in the drawer). - **Ctrl/⌘+Enter = open in Forgejo** (secondary). - In `#` mode, a top **"+ New issue…"** entry focuses the drawer's quick-add (depends on step 4 / #<quickadd>). ## Notes / limits - The list endpoint caps at `LIST_LIMIT` (50), so `#`-filtering searches the 50 most-recent open issues client-side. Fine for most repos; for a big tracker, add server-side search later (`/panel/<ch>/issues?q=…` → Forgejo issue search) and drop the cap. Log the cap for now. - The inject half has no dependency on quick-add and could ship alongside step 4; only the "New issue" entry needs it. Refs #31.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pedromcaraujo/forge#37
No description provided.