second-brain/src/second_brain
Travis Herbranson 2b40157a0d web: add-to-queue form on /queue too, with per-page HTMX dispatch
Travis's original ask put the form on the "queue page" but it landed
only on /dashboard. Putting it on /queue too without duplicating any
logic:

- _add_to_queue_form.html — extracted the form markup into a shared
  partial. Callers set `{% set swap_target = "#<id>-body" %}` before
  including it; that's the only knob that differs between the two
  pages. Same POST endpoint, same field set, same flash behaviour.

- _dashboard_body.html — now {% include %}s the shared partial with
  swap_target="#dashboard-body". Net change: a six-line include
  replacing the inline form.

- _queue_body.html (new) — `<div id="queue-body">` wrapping the shared
  form (swap_target="#queue-body") + the in-flight source list (same
  card markup as the Sources view, with the wrap-fix already applied).
  Empty state copy matches the queue context.

- queue.html (new) — extends base.html, page-titles "Queue", and
  includes _queue_body.html. /queue no longer reuses index.html.

- /queue route — renders queue.html via a new _build_queue_context
  helper. Same in-flight filter as before (PENDING/PULLED/TRANSCRIBED).

- POST /sources/add — reads HX-Current-URL (HTMX sends it on every
  request; falls back to Referer) and picks the response partial:
  /queue → _queue_body.html, anything else → _dashboard_body.html. One
  endpoint, one service call, two render branches — neither side
  reaches into the other's state.

Live-verified through the rebuilt container:
- GET /queue (LAN + brain.herbylab.dev) — form present.
- GET /dashboard — form still present (unchanged behaviour).
- GET / — form still absent (Sources view stays clean).
- POST from /queue → response carries id="queue-body" (and not
  dashboard-body); the freshly-added row appears in the swapped list.
- POST from /dashboard → response carries id="dashboard-body".
- Flash scenarios from /queue: queued / duplicate / playlist 13 videos
  / validation error — all four render correctly.
2026-05-25 14:21:02 -04:00
..
adapters pipeline split: tower transcribe worker + claim queue + faster-whisper 2026-05-25 10:11:37 -04:00
compiler gauntlet: fix lint — drop unused imports + reorder models.py + add dev deps 2026-05-24 22:52:08 -04:00
context gauntlet: fix lint — drop unused imports + reorder models.py + add dev deps 2026-05-24 22:52:08 -04:00
embeddings embeddings: register pool close() at interpreter exit 2026-05-24 23:33:13 -04:00
extractor gauntlet: fix lint — drop unused imports + reorder models.py + add dev deps 2026-05-24 22:52:08 -04:00
llm switch extractor to Claude CLI backend + pipeline fixes 2026-05-24 21:09:20 -04:00
scheduler transcripts: capture segment-level output into a new JSONB column 2026-05-25 13:40:49 -04:00
web web: add-to-queue form on /queue too, with per-page HTMX dispatch 2026-05-25 14:21:02 -04:00
__init__.py project init 2026-05-22 19:08:22 -04:00
claim.py pipeline split: tower transcribe worker + claim queue + faster-whisper 2026-05-25 10:11:37 -04:00
config.py pipeline split: tower transcribe worker + claim queue + faster-whisper 2026-05-25 10:11:37 -04:00
database.py postgres migration: schema, models, embeddings, alembic 2026-05-24 22:46:48 -04:00
main.py playlists: queue-time YouTube fan-out via yt-dlp extract_flat 2026-05-25 13:59:35 -04:00
models.py transcripts: capture segment-level output into a new JSONB column 2026-05-25 13:40:49 -04:00
settings_store.py settings: v2 migration + ORM + settings_store helper 2026-05-25 08:11:53 -04:00
sources_service.py playlists: queue-time YouTube fan-out via yt-dlp extract_flat 2026-05-25 13:59:35 -04:00
transcribe.py transcripts: capture segment-level output into a new JSONB column 2026-05-25 13:40:49 -04:00