Skip to content

Add a configurable "mark" flag to taggings and subscriptions - #2478

Merged
maebeale merged 6 commits into
mainfrom
maebeale/add-flagged-boolean
Sep 1, 2026
Merged

Add a configurable "mark" flag to taggings and subscriptions#2478
maebeale merged 6 commits into
mainfrom
maebeale/add-flagged-boolean

Conversation

@maebeale

@maebeale maebeale commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 additive columns + inline Turbo actions across two index flows; reuses existing JS

Lets staff tag people and then check them off the list — marking a topic subscription or a staff tagging right on the index, with a per-row notes box. The mark means whatever each topic/tag decides ("Confirmed", "Completed", "Tracked", …).

How it works

  • Each staff tag and topic carries an optional mark_label — the word for its mark (editable on Manage staff tags / Manage topics). Defaults to "Marked".
  • Each staff tagging and subscription carries a marked boolean.
  • Meaning lives in the per-tag/topic label; the stored column stays generic.

On the index (the main workflow)

  • Inline mark slider per row toggles marked in place via Turbo (toggle_marked → turbo_stream replacing just the cell) — the same no-JS pattern as certificate-issued.
  • Notes column per row: a box that autosaves on blur through the existing autosave Stimulus controller (no new JS) to a save_note action, which upserts the row's latest comment — so it shows up in that row's comment log.
  • Mark column is sortable; its header shows the filtered tag/topic's own label when narrowed to one.
  • All / Yes / No mark filter, inside a filter card with the shared filter-icon header.
  • Staff taggings index gains a Staff tags nav link.

Setting the mark elsewhere

  • A slider (existing peer-checked switch style) on the new/edit staff-tagging forms; a checkbox on the subscription edit form.

Notes for the reviewer

  • Inline note semantics: the box edits the row's latest comment, or creates one if none — a quick jot lands in the same comment log the edit page shows. Flag if you'd rather it always create a fresh comment.
  • Comments are eager-loaded on both indexes to avoid an N+1 from the notes column.
  • One existing subscriptions spec was narrowed: it broadly asserted nothing in the results frame targets the frame, but the sort link legitimately does. It now checks the status toggle specifically still breaks out to _top.
  • Migration is additive (marked default false + index; mark_label nullable) — no backfill.

🤖 Generated with Claude Code

@maebeale
maebeale force-pushed the maebeale/add-flagged-boolean branch from ea898b4 to 788b128 Compare September 1, 2026 16:38
@maebeale
maebeale marked this pull request as ready for review September 1, 2026 17:04
maebeale and others added 4 commits September 1, 2026 13:45
Each staff tag and topic names its own checkbox (mark_label — "Confirmed",
"Completed", etc.); each tagging/subscription carries the boolean. Meaning lives
in the per-tag/topic label so it can be anything, while the storage stays generic.

Adds a sortable mark column and an All/Yes/No filter to both indexes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…link

- New and edit staff-tagging forms carry a mark slider captioned with the
  selected tag's mark label, revealed once a tag is chosen (mark_toggle Stimulus
  controller reads the option's data-mark-label). Create now persists it.
- The Mark column header on both indexes shows the filtered tag/topic's mark
  label when the list is narrowed to a single one.
- Staff taggings index gains a "Staff tags" nav link, left of Topic subscriptions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n a filter card

- Drop the one-off Stimulus controller; the mark toggle now reuses the existing
  peer-checked slider style (as certificate-issued does). Caption is server-
  rendered: the tag's mark label on edit, the generic default on new.
- Staff taggings filters move into a gray filter card with the shared filter-icon
  header; subscriptions filter card gains the same header for parity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Inline mark slider per row toggles `marked` via Turbo (toggle_marked action +
  turbo_stream replacing just the cell) — same no-JS pattern as certificate-issued.
- Per-row notes box autosaves on blur through the existing `autosave` controller
  to a save_note action that upserts the row's latest comment (shows in its log).
- Both index tables gain a Notes column; comments eager-loaded to avoid N+1.
- Drop the now-unused marked_indicator helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/add-flagged-boolean branch from dd3fd8d to 93b6839 Compare September 1, 2026 17:46
maebeale and others added 2 commits September 1, 2026 13:56
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…Comments

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale merged commit e1b9dd5 into main Sep 1, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/add-flagged-boolean branch September 1, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant