Skip to content

Quotes: rename body, add author + standout, preserve original submission - #2314

Merged
maebeale merged 8 commits into
mainfrom
maebeale/quote-original-body-and-flag
Aug 22, 2026
Merged

Quotes: rename body, add author + standout, preserve original submission#2314
maebeale merged 8 commits into
mainfrom
maebeale/quote-original-body-and-flag

Conversation

@maebeale

@maebeale maebeale commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 5 Inspect 🔬 renames a load-bearing column (quotebody), adopts AuthorCreditable, and adds sector/category tagging across models/controllers/views/seeds

What

Column rename

  • quotebody everywhere (model, decorator, controllers, nested report/workshop-log forms, seeds, search, order clauses).

Preserved original submission

  • New original_body column that keeps the participant's original text after edits; backfills lazily on next save (no data migration).

Author on quotes (AuthorCreditable)

  • Adopts AuthorCreditable and adds an optional author (Person), matching the other author models.
  • Most quotes are participants who aren't people in the DB, so speaker_name stays as the legacy free-text fallback (via legacy_author_name_columns).
  • Adds nullable created_by / updated_by (User), set on create/update.
  • Form gets a person author picker; speaker_name reframed as the fallback.
  • Keyword search matches body, original submission, the linked author's name (credit-preference-aware), and the legacy speaker name — no separate filter box.
  • Quotes are not surfaced on the author-credit divergences page.

Sectors & categories

  • Quotes are now taggable with sectors and categories — checkbox toggles on the form like the workshop/community-news forms.
  • Persisted via the shared TagAssignable concern (save first, then assign), since the polymorphic CategorizableItem needs a persisted parent.
  • Tagged quotes surface on the tags/taggings admin grid; the standout badge shows there too.

Standout flag

  • New standout boolean: blue box in the form (like Visibility), admin-only filter on the index, yellow badge on index/show/tags grid.

Index & navigation

  • Source filter on the index — data-driven dropdown of the quotable types actually present (Workshop, Workshop log, Report, …), filtering on quotable_item_quotes.quotable_type.
  • Back-link to the index from the quote show page (admin-gated, since the index is admin-only).

Notes

  • Two additive migrations (rename + new columns; then created_by/updated_by).
  • Tags/taggings search (TaggingSearchService) orders quotes by :body post-rename; QuoteDecorator#title/#detail still resolve there.

🤖 Generated with Claude Code

maebeale and others added 2 commits August 22, 2026 07:08
Preserve the untouched submission separately from the published quote so
curating what's shown never loses what was received, and give staff a
"standout" flag (with an admin-only filter) to surface the best quotes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Align Quote with the other author models: rename the `quote` column to
`body`, adopt AuthorCreditable, and add an optional `author` (Person).
Most quotes come from participants who aren't people in the DB, so the
free-text `speaker_name` stays as the legacy fallback and remains
searchable alongside the linked author's name and the quote body.

Also renames the earlier `original_quote` column to `original_body` for
consistency with the new body name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale maebeale changed the title Quotes: preserve original submission + add standout flag Quotes: rename body, add author + standout, preserve original submission Aug 22, 2026
…d by

Complete the AuthorCreditable adoption for quotes:
- Add nullable created_by / updated_by (User) associations, set on the
  quotes controller create/update.
- Surface the admin credit-preference selector, note, and warning on the
  quote form (mirrors the other author forms), and permit the param.
- List quotes on the author-credit divergences page: add Quote to the
  query allowlist and make the query tolerate models with no created_by
  (quotes may have none), so the legacy speaker_name section can retire
  free-text credits into linked people.

Keyword search already matches the linked author name and speaker_name,
so no separate author filter box is added.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale marked this pull request as ready for review August 22, 2026 11:30
maebeale and others added 5 commits August 22, 2026 07:32
Revert the divergences integration for quotes: remove Quote from the
query allowlist (restoring the query to its prior state) and drop the
now-dangling admin credit-preference selector from the quote form, since
its whole purpose is the divergences reconciliation flow.

Quotes keep the author link, the searchable legacy speaker_name, and the
created_by/updated_by columns; only the divergences surfacing is removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add sector/category checkbox toggles to the quote form (mirroring the
workshop and community-news forms) and persist them via the shared
TagAssignable concern — save the quote first, then assign taggings, since
the polymorphic CategorizableItem requires a persisted parent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a data-driven "Source" dropdown to the quotes index that filters by the
polymorphic quotable_type (Workshop, Workshop log, Report, …), with options
built from the sources that actually exist. Also add an admin-gated "Quotes"
back-link on the quote show page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale merged commit c990f2d into main Aug 22, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/quote-original-body-and-flag branch August 22, 2026 12:27
maebeale added a commit that referenced this pull request Aug 22, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Aug 22, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Aug 22, 2026
* Add StaffTag: internal admin-only tagging for people

Staff tags are admin-curated, internal labels for talent pipelines,
rosters, and outreach (e.g. potential future trainers, cohort
candidates). Modeled on the TopicSubscription shape but kept separate
so these sensitive, never-public designations can't leak into any
comms/export flow.

- StaffTag + polymorphic StaffTagging join + StaffTaggable concern (Person)
- Admin-only CRUD (mirrors category_types) with archive/unarchive
- Assign on the person form; filter the people index by staff tag

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

* Add StaffTag specs, docs, and feature-catalog entry

Model/join/policy/decorator/request specs (incl. person form assignment,
people-index filter, archived-tag preservation, and admin gating), the
Features & tips seed entry, and AGENTS.md model/concern catalog updates.
Tailwind class order normalized on touched views.

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

* StaffTags UI polish: reorder person form, green Active pill, precompute index counts

- Person form: workshop settings now render below the staff tags section
- Staff tags index: Active status pill is green (was reading as a red error),
  tag names/checkboxes use neutral styling instead of the rose identity color
- Precompute people-tagged counts in one grouped query (no COUNT per row)

The /people index itself has no staff-tag N+1: tags aren't rendered per row,
only used by the filter (one dropdown query + one JOIN when applied).

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

* StaffTags: cocoon chip picker on person form + index cleanup

Person form: replace the checkbox grid with a sectors/age-ranges-style
chip picker — a '➕ Add staff tag' button reveals a dropdown of the
active tags not yet applied, each chip removable. Backed by
staff_taggings nested attributes; created_by is stamped from Current.user
so the audit survives the switch away from the hand-rolled sync.

Staff tags index: tag name links straight to the edit screen; dropped the
per-row Edit/Archive buttons (archive/unarchive now live on the edit form).

The 'People tagged' count already deep-links to the filtered people index
with the tag pre-selected in the filter dropdown (result_src carries the
query string; the select reads the same param).

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

* StaffTags: use admin (blue) styling instead of the rose domain tint

Person-form staff tags panel goes back to the admin-only bg-blue-100
treatment; staff tags index inner card is a clean white card on the blue
admin wrapper. Removes the now-unused :staff_tags rose entry from
DomainTheme.

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

* StaffTags: surface created_by/updated_by and track updated_by on taggings

- Show/edit pages render the shared audit_info (created/updated by + Ahoy link)
- StaffTag show lists each tagging with who applied it and when
- StaffTagging gains updated_by (stamped from Current.user alongside created_by)

Note: all models are already Ahoy-tracked via ApplicationRecord, so the
audit partial's activity link resolves for these too — no opt-in needed.

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

* Seed the canonical StaffTags in all environments

Add StaffTag::SEED (the pipeline/roster/outreach tags we've been building
around) and seed them idempotently in db/seeds.rb via find_or_create_by_name!
so it never overwrites an admin's edits.

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

* StaffTags: published/Publishable language instead of archived; trim comments

- StaffTag uses the Publishable concern (published boolean) like sectors and
  categories; drops archived_at, the archive/unarchive actions/routes, and the
  bespoke scopes. Managed via a published visibility flag on the edit form.
- Status reads Published/Unpublished; pickers offer published tags, an
  already-applied unpublished tag stays on its chip.
- Pare back the explanatory comments across the staff-tag code to the few
  load-bearing 'why' lines.

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

* Show StaffTags in admin-only sections on the Tags and Taggings pages

Both /tags and /taggings gain an admin-only Staff tags section (blue admin
styling) listing published tags as chips that deep-link to the filtered
people roster. Gated by StaffTagPolicy — the relation scope returns none for
anyone but super-admins, so the section is invisible to public visitors.

Kept it a link-out to the existing people filter rather than wiring a
Person-only case into TaggingSearchService.

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

* Add adaptive eyebrow back links to the people roster from staff-tag entry points

The people index now renders a back link that adapts to where the roster was
opened from — the staff tags index (← Staff tags), a tag's detail page
(← <tag name>), or the Tags/Taggings browse sections — via a return_to param
on each originating link. Also trims the staff tags index subtitle.

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

* Staff tag form: move the Visibility box to the right, matching the quotes form

Two-column md:grid-cols-4 layout — name/description on the left, the published
visibility panel on the right instead of stacked full-width below.

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

* Staff tag form: staff-tag-specific published hint

Add a staff_tag_published visibility definition (Offered in the tag pickers /
admin-only either way) instead of the generic 'Visible to signed-in users'
copy, which was misleading for these admin-only tags.

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

* Strip explanatory comments from the staff-tag code

Remove the restating comments (relation_scope note, grouped-query note, model
headers, the eyebrow/collection notes) per the default-to-no-comment style.

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

* Move StaffTag seed data out of the model into db/seeds.rb

Inline the starter-tag hash where it's seeded rather than as a model constant.

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

* Staff tag pages: left ← Staff tags back-arrow eyebrow

Move the back-to-index link to a left-aligned '← Staff tags' arrow on the
show/edit/new pages (was a right-aligned Home/Staff tags/… cluster), matching
the people-index back-nav. Keep the page's own action (Edit / View) on the right.

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

* Regenerate schema.rb after rebasing onto the quotes migrations (#2314)

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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