Repository navigation
feat(metadata): rename MeditationTags → UserChoices and add SubtleSystemNodes - #321
Merged
Merged
Conversation
…temNodes Closes #310 - Rename `meditation-tags` collection → `user-choices` (slug, labels, hooks file, project visibility, role permissions, R2 storage routing). - Add required `type` enum (`mood` | `goal`) on UserChoices; gate the mood-only fields (`timings`, per-timing meditation rels) behind `admin.condition` so goal-type rows skip them. - Add new `SubtleSystemNodes` collection: closed enum of 12 chakra/nadi slugs, each linked to a required `pages` doc. Reverse joins expose attached lectures + frames. - Lectures gain optional `userChoices` and `subtleSystemNodes` hasMany relationships for future server-side smart selection. - Frames replace the `category` enum with a `subtleSystemNode` relationship; the four non-chakra category values (`clearing`, `meditate`, `ready`, `namaste`) move into `tags`. `ida` / `pingala` / `kundalini` are removed from `tags` in favour of the relationship. - Inline migration backfill (per ticket spec): seeds the 12 nodes and bootstraps placeholder Pages, then maps existing Frames data — chakra categories → relationship, non-chakra → tags, tag-only ida/pingala → relationship — before dropping the `category` column. Fixes the two Drizzle polymorphic-FK rebuild bugs the change triggered (the new `type` column on user_choices and the `meditation_tags_id` → `user_choices_id` rename in `payload_locked_documents_rels`). - FrameEditor admin UI grouping/filtering switches from `frame.category` to a slug derived from the populated relationship; `framesByNarrator` endpoint now uses `depth: 1` so the relationship surfaces for client-side grouping. - Test factories add `createUserChoice` and `createSubtleSystemNode`; spec files renamed; new `subtle-system-nodes.int.spec.ts` covers slug uniqueness + reverse-join shape. - Updated seeds (meditations + tags + tests), docs, and the seeds expectedCounts metadata. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…Nodes PR
- Document that Frames.subtleSystemNode is intentionally optional ("Other"
bucket for non-chakra frames like bandhan/namaste).
- Thread `req` through updateIsParent so the count→update pair joins the
caller's Payload transaction; prevents two concurrent reparenting events
from racing on isParent.
- Clarify in UserChoices.parent description that the field is admin-only,
matching the existing access.update guard.
- Update 3 stale "Meditation Tags" strings in scripts/create-sample-page.ts
to use "User Choices" terminology.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
sydevs-bot
pushed a commit
that referenced
this pull request
Oct 25, 2026
After sydevs/SahajAtlasWeb#321 the failure dialog takes its heading from `common.map.location_not_available`, the same key that labels the geolocate control. Its description named only the label, so a manager rewording a control label would silently reword a dialog heading with nothing to warn them. Both roles are now stated, in the idiom `submit.report.title` already uses for a key serving three places. `location_failed` is described as that heading's introductory line, mirroring `submit.report.description`. The key keeps its name: #321 reads `common.map.location_failed` under exactly that spelling, and renaming it to a `_body` half would break the consumer the key exists for. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01No89uA3CHa1Km3NC1a3EBo
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #310
Summary
MeditationTags→UserChoices(slugmeditation-tags→user-choices). Adds requiredtypeenum (mood|goal) on UserChoices; mood-only fields hide viaadmin.conditionfor goal-type rows.SubtleSystemNodes— closed 12-slug enum (chakras + nadis), each linked to a requiredpagesdoc. Reverse joins surface attached lectures + frames.+userChoices,+subtleSystemNodeshasMany) and Frames (-categoryenum,+subtleSystemNodesingle relationship; 4 non-chakra category values move intotags, deprecatedida/pingala/kundalinitag values removed).typecolumn on user_choices,meditation_tags_id→user_choices_idrename inpayload_locked_documents_rels).Migration verification
Run against a snapshot of the local D1 (120 frames, 24 meditation_tags, 8 deprecated tag rows, 0 chakra/nadi pages) — all checks pass:
subtle_system_nodesrows seeded_status='published')type='mood'clearing/meditate/ready/namasteappended toframes_tags(10/2/2/2 = 16)ida/pingala/kundalini) removedframes.categorycolumn droppedmeditation_tags*tables removedTest Results
Pre-existing flaky test (not introduced by this PR)
tests/int/access-performance.int.spec.tshas timing-based perf assertions (e.g.expect(duration).toBeLessThan(100)) that fail intermittently when run alongside the full suite due to CPU contention. Running the file in isolation passes all 10 cases consistently. This file was not modified in this PR; the flakiness is onmain.Test plan
SubtleSystemNode, attachuserChoicesandsubtleSystemNodesto a Lecture, see reverse-join counts on both sides.UserChoicewithtype: 'goal'— verify timings + per-timing meditation rels are hidden. Switch tomoodand verify they reappear./api/user-choices?...returns the same shape the old/api/meditation-tagsdid./api/subtle-system-nodeslists 12 nodes./api/frames/:idincludessubtleSystemNode(id) and nocategory.🤖 Generated with Claude Code