Skip to content

fix(meditations): stop keyframes carrying their chakra node's whole page - #1233

Merged
Ardnived merged 1 commit into
mainfrom
claude/fix-meditation-frames-depth
Nov 20, 2026
Merged

Ardnived merged 1 commit into
mainfrom
claude/fix-meditation-frames-depth

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Summary

  • Visitors and app users: meditation reads get much smaller. Meditation 17's keyframes were about 59 KB, almost all of it pages nobody displays. Nothing on screen changes.
  • Editors: nothing changes. The FrameEditor still labels a chakra frame from its node's slug.
  • Developers: the frames afterRead hook in src/collections/Meditations/Meditations.ts now reads frames at depth: 1 with populate: { 'subtle-system-nodes': { slug: true } }. Before, it used the config's defaultDepth: 2, so every chakra keyframe carried subtleSystemNode.page in full (content, author, managers, webUrl).

Why here, and not in a client

frames is a JSON field that this hook fills with its own payload.find. That read takes no select, depth or populate from the request, so no client can narrow it:

  • WeMeditateWeb measured 58,803 B of frames on /meditations/17 and tried every depth, populate and select variant against production. None of them changed the result. test(meditations): cover loadMeditation WeMeditateWeb#297 had been trimming keyframes on its own side. That trim is now removed in favour of this fix.
  • WeMeditateApp sends frames][url, frames][subtleSystemNode and similar keys (meditation_payload_remote_data_source.dart, path_payload_remote_data_source.dart). They are ignored, so every installed release downloads the pages too. This fix shrinks the app's reads with no app release.

Why depth: 1 and not depth: 0

The installed app (meditation_frame.dart, _resolveFrameCategory) and the FrameEditor (getFrameSubtleSystemNodeSlug) read subtleSystemNode.slug from a populated object. At depth 0 that field would be a bare numeric id, and both would lose the chakra. With this change the node arrives as { id, slug }. Every field of the frame itself is unchanged.

Not changed: the inner read still passes no req. Frames and subtle-system nodes have no localized fields, so the request locale makes no difference. Passing req would also route the read through the API-client select gate.

Tests

  • New case in tests/int/meditationFrames.int.spec.ts, Keyframe enrichment. It reads a meditation with a chakra keyframe at the default depth and checks that subtleSystemNode is exactly { id, slug } and that the frame's own fields are still there. Verified that it fails with the two new lines removed (the diff shows page returning).
  • That spec passes in full (25 tests), and the lean gate (check.sh) passes: lint, format, typecheck, test typecheck, and 282 unit files.

🤖 Generated with Claude Code

The `frames` afterRead hook enriched each keyframe with a `frames` read
at the config's default depth 2, so every chakra frame brought
subtleSystemNode -> page along: the page's content, author and managers,
on every meditation read. A JSON field takes no `select`, `depth` or
`populate` from the caller, so no client could narrow it — WeMeditateWeb
shipped ~57 KB of it per meditation page, and the mobile app's
`frames][…]` select keys are silently ignored.

Read at depth 1 and populate the node as its slug alone. Not depth 0:
the installed app and the FrameEditor read `subtleSystemNode.slug` off a
populated object.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app

railway-app Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1233 environment in sahajcloud

Service Status Web Updated
SahajCloud 😴 Sleeping (View Logs) Web Nov 20, 2026 at 1:04 am UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot

sydevs-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

Written by the sydevs dispatcher. Sessions never edit this comment.

@Ardnived

Copy link
Copy Markdown
Contributor Author

@sydevs-bot approve

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. 🤖 Written by the sydevs autonomous loop — see what this is

@sydevs-bot

Copy link
Copy Markdown
Contributor

Adversarial review skipped: 2 file(s), 38 changed line(s), under review.skipWhen. Say @sydevs-bot review to force one.

🤖 sydevs dispatcher

@Ardnived
Ardnived added this pull request to the merge queue Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 20, 2026
Merged via the queue into main with commit ad4f405 Nov 20, 2026
19 checks passed
@Ardnived
Ardnived deleted the claude/fix-meditation-frames-depth branch November 20, 2026 01:09
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 20, 2026

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1233 — a7689722 Deployed Nov 20, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants