Skip to content

用 CoordKey 约束 Markup 状态树根键 - #29

Merged
tiye merged 2 commits into
mainfrom
refine/markup-state-coord-key
Nov 14, 2026
Merged

tiye merged 2 commits into
mainfrom
refine/markup-state-coord-key

Conversation

@tiye

@tiye tiye commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

用户影响

使用标签、字符串和数字状态键的 Markup 存档仍可直接恢复。若旧存档在 UI 状态树根层用了布尔值等不支持的键,页面会通过 HUD 提示并中止启动,原存档会保留。

改动与验证

  • 存档解码和编辑后的状态更新共用 Respo 的 CoordKey 联合类型。编辑器扩展字段值仍按原格式保存。
  • Calcit 0.42.1 全定义检查 220/220、完整 strict、Node 24 前端构建和四组 JS 回归均通过。回归还覆盖了字符串与数字键的接受,以及布尔键的拒绝。

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of saved application state addressed by numeric or string keys, including nested state. These states can now be decoded and restored with their contents preserved.
    • State addressed by boolean keys is rejected during decoding.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The store state map and updater decoder now use respo.schema/CoordKey for keys. Tests cover accepted numeric and string keys, rejected boolean keys, and nested state preservation after an edit and serialization round trip.

Changes

Store state key types

Layer / File(s) Summary
Coordinate-keyed store state
calcit.cirru, scripts/typed-reel-render.test.mjs
Store.states and the updater decoder use respo.schema/CoordKey keys. Tests check numeric and string keys, reject boolean keys, and verify that nested editor content remains nested after an edit and serialization round trip.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Merge Risk: Minimal · up to fdd8e

This change tightens the key type of the state tree and adds regression tests for accepted and rejected keys. No concrete merge-blocking problem was found, and the risk of merging is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "用 CoordKey 约束 Markup 状态树根键" (Constrain Markup state tree root keys with CoordKey) matches the main change. The summary shows app.schema/Store.states changing from Map Dynamic Dynamic to…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "用 CoordKey 约束 Markup 状态树根键" (Constrain Markup state tree root keys with CoordKey) matches the main change. The summary shows app.schema/Store.states changing from Map Dynamic Dynamic to Map respo.schema/CoordKey Dynamic, and the objectives describe the same goal of sharing Respo's CoordKey type for archive decoding and state updates. The title is specific and consistent with the changeset. The test file changes support the same change but are secondary to it.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4db60326-fb13-4ca9-82aa-a1d1a1a29426
Commits

Reviewing files that changed from the base of the PR and between 491c8a9 and fdd8e2c.

Files selected for processing: 2

  • calcit.cirru
  • scripts/typed-reel-render.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@tiye
tiye merged commit 5fdd24f into main Nov 14, 2026
1 check passed
@tiye
tiye deleted the refine/markup-state-coord-key branch November 14, 2026 04:20
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