Skip to content

Repository files navigation

bb-plugin-auto-sections

CI License: MIT

Automatically organizes the bb sidebar: threads whose titles start with a task key — HOPS-5 · Pilot 4, TA-2 · Build the stash — are filed into a sidebar section named after the key's prefix (HOPS, TA), creating the section on first use.

The bb tasks plugin names delegated threads exactly this way (KEY-n · title), so with both plugins enabled every tasks project gets its own sidebar section with zero manual dragging. Manually titled threads that follow the same convention are filed too.

bb sidebar with threads grouped into Later and HOPS sections

Install

bb plugin install git:https://github.com/benegessarit/bb-plugin-auto-sections.git@main

Or from a local checkout while developing:

bb plugin install /path/to/bb-plugin-auto-sections

Requires bb ≥ 0.36. No configuration.

Behavior

  • A thread is filed in exactly two title shapes: the tasks-plugin shape KEY-1 · title (uppercase letter-first prefix of 1–10 characters, spaced middle dot), or a bare key as the entire title (TA-7, prefix of 2+ characters). Anything else — W-2: tax filing, COVID-19: research, HTTP-2 support, a bare F-16 — is left alone.
  • Sections are matched by exact name; missing ones are created.
  • Each thread is filed at most once. Drag a thread out of its section (or into a different one) and the plugin never moves it again.
  • Already-sectioned threads are never touched. Archived and hidden threads are ignored.
  • Runs on server start (catch-up sweep) and reacts live to new threads and renames, debounced a couple of seconds.

CLI

bb auto-sections sweep                 # file all unsectioned task-keyed threads now
bb auto-sections forget <thread-id>    # clear one filed marker so it can be re-filed
bb auto-sections forget --all          # clear all filed markers

forget exists for the once-only rule: after clearing a marker, the next sweep may file that thread again.

Development

npm install
npm test            # vitest unit tests (pure logic in core.ts)
npm run typecheck   # tsc --noEmit
bb plugin install . # run it against your local bb
bb plugin dev       # reload on save

server.ts is thin wiring around the plugin API; the filing logic lives in core.ts as pure functions so it tests without a bb server.

License

MIT

About

BB plugin that auto-files task-keyed threads (HOPS-1, TA-2, …) into matching sidebar sections

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages