Blog

All posts
John Damask · 2026-04-12
devlogfeaturesgallery

The my-gallery page showed each paper's translation mode -- Native, Non-technical, or Kid-friendly -- as raw text in the card's meta line. You could see it, but you couldn't filter by it. The first plan was to add colored CSS badges like the public gallery has. During planning, the approach shifted.

Tags had just shipped. The gallery already had a tag filter bar, an autocomplete datalist, and per-card tag editing. Making mode a pre-populated tag meant users got mode filtering for free, with the same UI they already use for custom tags, and with no parallel code path to maintain. A display-only badge would have been strictly less useful.

The change

Three edits. The upload Lambda now sets tags_lc and tags_display on the new job item to the selected mode -- for example, ["non-technical"] / ["Non-technical"]. After the job item is written, a best-effort update increments the user's gallery tag catalog so the mode tag appears in the filter bar immediately. The catalog update is wrapped in a try/except: if it fails, the tag still shows on the card (it's on the job item), only the filter bar count is temporarily off until the nightly backfill catches it. The gallery HTML drops the raw mode text from the meta line, since it's now visible as a tag. The CloudFormation template adds the users-table environment variable to the upload Lambda.

Backfill

A migration script handles existing jobs. It scans for jobs with a mode field but no matching entry in tags_lc, appends the mode tag while preserving existing user tags, and rebuilds each affected user's catalog. The condition expression skips jobs that are already tagged, making the script idempotent. Test run hit 79 jobs across 4 users, all clean.

One design decision

Mode tags are regular tags. Users can remove them if they want. There's no special "system tag" concept that would survive removal or re-apply automatically. That kept the implementation simple and the behavior predictable -- no hidden rules for users to discover later. If someone deletes the mode tag from a paper, the paper keeps the mode (the mode field on the job is untouched), but it won't show up under that mode's filter chip. That's the user's call.