Repository navigation
feat(richEditor): give the countdown a class and add a directory block - #1232
sydevs-bot wants to merge 19 commits into
Conversation
`SplashBlock` gains an optional `event` relationship, shown only on the `countdown` layout and filtered to online, not-finished, not-inactive classes. A new `class-directory` block lets an editor place the class directory on any page, with where it opens, whether the map draws, and online classes only. `events` and `regions` join the `wemeditate-web` project so the editor's two pickers and the website's API key can read a class at all. Read only: no role gains a write grant, and the two field-locked columns stay locked. The eight translation keys the website renders around both blocks are declared here, since the site may write no English literal of its own. `blocks.general` already has a column; `blocks.live_session` is a new leaf group, so it takes DDL, and English copy ships as a guarded data-only migration beside it. `pages` moves after `events` in `FIXTURES`: `relationTargets` cannot see a relationship inside a rich-text field's editor blocks, so the sort would save the page before any event exists. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXn4RBaJeRyDDKDsNW
…ct grant `SplashBlock.event` is narrowed by `filterOptions` alone, so the refusal is asserted on a save — through the Local API and `PATCH /api/pages/:id` — rather than by reading the config. The new spec records why that save must carry a user: Payload hands a field's `beforeChange` hook no `overrideAccess`, so the Lexical adapter forwards `undefined` and `validateFilterOptions` falls back to enforcing access. `role-based-access` reads a class and a region back as a `wemeditate-web-client` key, and pins that `activityLog` stays empty, the manager stays a bare id, and neither the key nor `page-editor` gains a write. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXn4RBaJeRyDDKDsNW
`events` and `regions` now sit in two projects, so the held-project preference started filing a region manager's listings under WeMeditate Web and branding their invitation for it. A project that only reads a collection is no home for looking after one: both joins now take their own role's project, and pages are left to the preference, which is what they are for. Three specs used `events` as their example of a collection outside the web project. They now use `app-cards`, and `virtual-roles` pins that a page editor reads classes but writes none. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXn4RBaJeRyDDKDsNW
Two measured breaks, both from `filterOptions` on a relationship inside a Lexical block. A `web-translator` could not save a page carrying a countdown at all: the Lexical adapter composes a filter of its own that answers `false` for a collection `admin.hidden` hides from the caller, and `events` is hidden from every role with no write grant on it. And the day a chosen class held its last session, every later save of the page answered 400 against a collapsed block — for an admin too — because the filter varies with the clock and `validateFilterOptions` re-runs on every save with no exemption for a value that did not change. Deleting the block was the only way out. So the field composes `relationship` with `filterOptions: undefined`: the picker still offers only online, running, active classes, and a save is no longer refused. Nothing is left unguarded — the consumer already degrades an unpublished, offline or dormant class to that language's online classes and reports it. The spec now pins both halves, including a page that stays saveable after its class finishes and one a non-admin manager saves. `legacyData` is the one column on these collections with no field lock, and the grant adds readers to it. #1231 weighs closing it; the comment beside the grant says so instead of claiming a lock that never existed. `JOIN_TAKES_HELD_PROJECT` states the single exception rather than the three normal cases, so the next join onto a collection in two projects is right by default. The `FIXTURES` reorder is reverted: the loader's own retry pass is what writes a row naming something not yet written. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXn4RBaJeRyDDKDsNW
|
🚅 Deployed to the SahajCloud-pr-1232 environment in sahajcloud
1 service not affected by this PR
|
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
`translations-globals.int.spec.ts` enumerates the schema's leaf groups and the labels its sub-groups may carry, so the 26th group this branch adds failed both assertions. The leaf-group list keeps its exact set: catching a sub-group dropped from the schema is what that assertion is for. The label assertion is now derived from the rule instead. SUBGROUP_PRESENTATION names `a11y` alone, so every other sub-group opens, and the two directions worth keeping are asserted on the walked labels — the renamed label reaches the real schema, and the slug never does. The unit lane already pins the label and collapse derivation against a hand-built schema, so the int spec keeps only what the real schema can tell it. A hand-maintained label set would send every later sub-group through this spec for a change that never touched its subject. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWwUC7GxHMyVr3n2d7
|
The session for review-pr did not finish after 3 attempts. I have stopped retrying. A mention ( 🤖 sydevs dispatcher |
|
Heads-up: #1246 is in the merge queue. Its migrations are timestamped |
…tdown-directory main's #1246 withdrew every `a11y` group from the three translations globals, so the four conflicts are all that collision with this branch's new `blocks.live_session` group. - `blocks.a11y` goes, `blocks.live_session` stays, in the schema's type, the seed file, the leaf-group spec and `src/payload-types.ts`. `pnpm generate:types` on the merged tree reproduces the hand resolution byte for byte. - The collapsible spec takes main's shape — every sub-group opens, since SUBGROUP_PRESENTATION is gone — but not its `toBe('General')`: `blocks` now carries a second sub-group, which is what the leaf-group set already pins. - `_meta.schema_version` is re-derived, not merged: 14 leaf groups and 104 declared keys, as `translations-seed-meta.spec.ts` computes them. - `src/migrations/index.ts` keeps both branches' migrations in timestamp order. 20261122_182623_merge_snapshot_heal_a11y_live_session heals the snapshot chain again. main's two a11y drops carry later timestamps than this branch's live-session migrations and their snapshots predate `blocks_live_session`, so `migrate:create` on the merged tree re-emitted both of 20261119_230234_wm_web_live_session_keys' ADD COLUMNs — the #566 boot abort. Its DDL is emptied and its snapshot kept, and a probe run now writes nothing. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYK2WPg76HitzFZZHH
|
Merged Two hunks were not a straight pick:
One new migration, ⚠ The body names three migrations and still lists 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
The merge commit left `20261122_182623_merge_snapshot_heal_a11y_live_session` imported and listed twice in `src/migrations/index.ts`, so `tsc` answered TS2300 on both import lines and the required check never reached its tests. A second entry under the same `name` would also have been offered to the boot migration twice. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWXnQ4RKeeZkmTw43Y
main's #329 re-ran `pnpm types:cms` against SahajCloud main (#1246), which dropped the ten a11y interfaces and the video tab. This branch's hand copy of the contract still carried them, so every one of those groups conflicted. Resolved to main's generated output plus only the shapes this branch's code needs from the unmerged sydevs/SahajCloud#1232: `blocks.live_session`, `blocks.general.days`, `SplashBlock.event` and `ClassDirectoryBlock`. The a11y groups stay dropped — #328 moved those strings into lib/i18n/a11y/, so nothing here reads them from the CMS. `wisdom_sidetext` is re-typed because its own `shortcut:` marker says a contract sync drops it until sydevs/SahajCloud#1218 lands. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeQVCd9NZbNZ37XVL
…tdown-directory main's #1218 added `blocks.general.wisdom_sidetext` and the `default` keyword that declares a key's English in the schema. Both sides only added, so all three conflicts keep both. - `blocks.general` carries this branch's `days` and main's `wisdom_sidetext`, the countdown labels still together. `blocks.live_session` stays, and the tab description is main's, which names the Ancient Wisdom text box. - `_meta.schema_version` is re-derived rather than merged: 13 tabs, 14 leaf groups, 105 declared keys, as `translations-seed-meta.spec.ts` counts them. - `src/payload-types.ts` is `pnpm generate:types` on the merged tree. The seven new keys declare no `default`, and that is the convention rather than an omission: #1218 refuses a key that sits in both the schema and the corpus file, and these ship their English in `seeds/wm-web-translations/data.en.json`. So `20261119_231000_wm_web_live_session_copy` is still what reaches a database that already holds the global. No snapshot heal this time. main has added no migration since the last merge, so `migrate:create --skip-empty` on the merged tree wrote nothing. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVZBi3r2prvzbsmPpM
|
Merged
Lean gate green, plus 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
`main`'s #331 re-synced `general.wisdom_sidetext` from the merged sydevs/SahajCloud#1218, so the hand-typed entry this branch carried for it is now generated upstream. Took main's generated form and dropped the `shortcut:` marker beside it: its stated trigger — that PR landing — has fired. `general.days` stays hand-typed. sydevs/SahajCloud#1232 is still open, so no sync produces it yet. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVAbAXn1pRFG9aD4vB
|
Closed We are going to revisit this after implementing the new class page for SahajAtlasWeb |
Pull request was closed
Summary
splashcountdownlayout a class to count down to, and adds aclass-directoryblock an editor can place on any page.wemeditate-webproject read oneventsandregions, and declares the eight translation keys the website renders around both blocks.Change outline
Contract — what an editor may place, and what the website may read
The two block shapes the consumer renders, and the project both collections join.
PROJECTS['wemeditate-web'].collections src/plugins/access/config/projects.ts pages, meditations, transcripts, songs, albums, videos, forms, authors, lectures, + events, regions, user-choices, subtle-system-nodes, song-tags, narrators, frames, images, filesBehaviour — why the picker narrows and the save does not refuse
Both halves were measured on this branch, each as a failing integration case before it was a passing one.
Behaviour — which project an invitation is branded for
A listing's project used to be the first project naming its collection, which only ever had one answer for a region or a class. Now both sit in two, and a project that merely reads a collection is no home for looking after one.
Files — the translation keys and the three migrations
src/globals/WeMeditateWebTranslations/ translationsSchema.json blocks.general + days # the countdown's new days cell + blocks.live_session # a new leaf group, so a new jsonb column + next_session, starts_in, join_now, live_now, no_upcoming, + schedule_line %{weekday} %{time} %{zone} + a11y_next_session %{weekday} %{time} %{relative} src/migrations/ +├── 20261119_230234_wm_web_live_session_keys # DDL: blocks_live_session, on the global and its versions +├── 20261119_231000_wm_web_live_session_copy # data only: English copy, where English lacks it +└── 20261120_222115_merge_snapshot_heal_live_session + # no DDL: a truthful snapshot after merging mainPreview
countdownsplash now naming event1025002, and aclass-directoryblock opening at region1002001with the map off and online classes only. Type/in the editor to see the new block's icon.countdownpicker must offer, and the other fixture events are what it must leave out.opensAttarget.Contract impact
src/payload-types.tsis acontractSyncsource for sydevs/WeMeditateWeb and sydevs/SahajAtlasWeb. Merging this re-runspnpm types:cmsin each and lands the diff as a bot commit.sydevs/WeMeditateWeb#309 is the consumer and is blocked by this one. While both are in flight it carries a hand copy of this branch's
src/payload-types.ts; the sync restores the generated one on merge.⚠ The eight translation keys do not reach the consumer by that sync.
pnpm sync:translationsreads the live SahajCloud, so the consumer'slib/translations.en.jsonis hand-written until this merges and its copy migration has run. Re-run it there afterwards.Migration
src/migrations/20261119_230234_wm_web_live_session_keys.ts(generated),src/migrations/20261119_231000_wm_web_live_session_copy.ts(hand-written, data only), andsrc/migrations/20261120_222115_merge_snapshot_heal_live_session.ts(generated, DDL emptied).migrate:createon the merged tree re-emitted all fourDROP COLUMNs, which abort the boot migration on a database that already ran them (feat(regions): country slug = ISO alpha-2 code #566). This is that run with its DDL emptied and its snapshot kept, assrc/migrations/AGENTS.mdprescribes. A secondmigrate:createwrote nothing, and itsdownis empty because itsupis.blocks_live_sessiontowm_web_translations_localesandversion_blocks_live_sessionto_wm_web_translations_v_locales. The copy migration writes English for the eight keys, only where English lacks them, on the main row and thelatest: trueversion row.upwrote — the previous schema declares none of these keys, so a value left in any locale or version row would refuse every later save of the global.Test results
.claude/skills/pr-prep/check.sh— lint, format,tscoversrc/and overtests/, and the whole unit lane.tests/int/splash-countdown-event.int.spec.ts(9),tests/int/role-based-access.int.spec.ts(new block, 3),tests/int/fixture-load.int.spec.ts,tests/int/wm-web-translations-seed.int.spec.ts— all green.Manual verification
countdownsplash's class picker offers only online, running classes, and that/in the editor lists Class Directory with its icon.eventsandregionsappear in the sidebar and that neither offers a Save.pnpm sync:translationsin sydevs/WeMeditateWeb.Notes for reviewer
PATCH /api/pages/:id, which the ticket's checklist asks for by name. A finished class still saves there, and a value that is no class id at all is refused — which is what disarmingfilterOptionsleaves armed.validateFilterOptionsre-runs on every save with no exemption for a value that did not change; and aweb-translatorcould not save such a page from the start, because the Lexical adapter composes a filter answeringfalsefor a collectionadmin.hiddenhides from the caller. So the picker narrows and the save does not refuse. The criterion the ticket cares about — "there is nothing broken to pick" — is a picker requirement, and it still holds.createHiddenis gated on a write grant. A page editor and a web translator still see an empty picker, and the attended setup is admin work either way.Events.registrationNotificationEmailbe absent from what awemeditate-web-clientkey reads. feat(events): tidy the event form, send signups to the manager only #1198 removed that column before this branch was cut, so the spec pins what is left:activityLogcomes back empty, and themanagerrelationship stays a bare id becausemanagerssits in no project.blocks.live_sessionintoblocks.general+blocks.a11ywould avoid the DDL migration and the 26th leaf group entirely, and is a real simplification — but the group name and every key are the interface both children of the goal are written against, pinned in both tickets, so changing it unilaterally is not mine to do. Say if you would rather have it; it is two small commits on each branch. A shared module for the four copies ofaddKey/dropKey/latestOnlywas declined for the opposite reason: a migration has to stay reproducible against the schema of its own time, and a shared module would change what an old migration does.maxDepth: 0onopensAtwas declined because the consumer reads the region'sslugthrough it.FIXTURESis unchanged. An earlier commit on this branch reordered it; the loader's own retry pass is what writes a row naming something not yet written, andsubtle-system-nodespullspagesahead ofeventsthrough the topological sort regardless, so the move was a no-op whose comment pointed the next reader at the wrong mechanism.Detail
What the project grant actually widens, walked field by field rather than assumed. Readers gained: the
wemeditate-web-clientkey (server-side),web-translator, andpage-editor(derived from a page listing).Events.activityLogis locked byeventContactsFieldAccessand comes back[];managerandsubmitterare relationships to collections in no project, so a populate falls back to a bare id and awhereon them is refused byhasReadAccessToQueryPath; the threecontact*columns are the public listing's contact whileallowContactis on, and are emptied on save when it is off, so there is nowhereoracle. No role gains a write, and the admin nav does not widen for a page editor or a translator, becausecreateHiddenis write-gated.The exception is
legacyData(both collections) andEvents.systemMeta, which carry no field lock — the verbatim imported Atlas row, contact details included. That exposure is pre-existing and wider than this grant:sahaj-atlas-clientis the widget's browser-published key, so the column is already reachable by anyone who copies it out of a host page. #1231 weighs closing it, and the comment beside the grant points there rather than claiming a lock that never existed.Closes #1228
🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjXn4RBaJeRyDDKDsNW