Skip to content

用递归 union 收紧 Docs Workflow 状态树 - #112

Merged
tiye merged 1 commit into
mainfrom
refine/docs-workflow-state-union-0421
Nov 12, 2026
Merged

tiye merged 1 commit into
mainfrom
refine/docs-workflow-state-union-0421

Conversation

@tiye

@tiye tiye commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

使用者需要注意

文档导航和快捷跳转弹窗继续使用现有交互。使用 Docs Workflow 的项目升级后,自定义状态树的键须符合 CoordKey,值须属于 StateValue。若自定义 updater,需接收具名导航操作和受检的弹窗状态 Map。

改动与风险

  • 用递归 StateValue union 收紧 Store、弹窗分发和更新边界。读取导航状态时按类型匹配具名记录或旧 Map。
  • 本地通过全部 265 个定义、完整 strict、原两项测试和生产构建。已用生成的 JS 验证导航和弹窗更新。下游依赖切换仍需单独复核。

Summary by CodeRabbit

  • Bug Fixes
    • Existing saved guide data continues to load when provided in the legacy format.
    • The default guide state is now used only when no data is provided. Other unsupported data is reported as an error instead of being treated as default state.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Navigation state maps now use coordinate keys and a recursive StateValue type. comp-container handles present and absent :data values differently, and the updater decodes :states and :navigate with the typed map.

Changes

Navigation state typing

Layer / File(s) Summary
State value contract
calcit.cirru
Adds the recursive StateValue union and uses it for the Store :states and Op :states map values.
Typed state handling
calcit.cirru
comp-container accepts State values or decodes legacy maps, raises an error for other present values, and uses the default guide state only when :data is absent. The updater decodes :states and :navigate using the typed map.

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

Change: Refactor

Possibly related PRs

Suggested reviewers: claude

Merge Risk: Minimal · up to 8fcf6

The change tightens the navigation state types without changing the documented interactions. No actionable merge-blocking risk was found. Downstream consumers with custom state trees will need to follow the stricter key and value types.

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 "用递归 union 收紧 Docs Workflow 状态树" (Tighten the Docs Workflow state tree with a recursive union) matches the main change in the changeset. The raw summary shows a new recursive StateValue unio…
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 "用递归 union 收紧 Docs Workflow 状态树" (Tighten the Docs Workflow state tree with a recursive union) matches the main change in the changeset. The raw summary shows a new recursive StateValue union, typed Store :states and Op :states maps, and a comp-container that reads :data as docs-workflow.schema/State. The PR objectives describe the same goal. The title is specific and concise, and it names the primary change.

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: 90bf0d52-21c4-449f-9492-c92828b53ad8
Commits

Reviewing files that changed from the base of the PR and between c94f969 and 8fcf6ea.

Files selected for processing: 1

  • calcit.cirru

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 3bb0ee1 into main Nov 12, 2026
1 check passed
@tiye
tiye deleted the refine/docs-workflow-state-union-0421 branch November 12, 2026 16:23
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