2026.9.9-canary.909
Pre-release
Pre-release
·
3 commits
to canary
since this release
fix(editor): preserve expanded headings in readonly mode (#15549) ## Description Closes #13579. On readonly shared pages, selecting text under a heading persisted as collapsed caused reactive selection handling to restore the persisted collapsed value over the viewer-local expanded state. This closed the heading again and prevented selecting or copying its revealed content. This change: - separates persisted collapsed-state synchronization from selection cleanup; - makes the readonly-local collapsed state reactive for both BlockSuite effects and Lit rendering; - preserves selection and copying while a readonly heading is locally expanded; - still clears hidden text selection when the heading is collapsed again; - adds a Playwright regression covering collapse → readonly → expand → drag-select → copy → re-collapse. ## Checklist - [x] I have signed the [AFFiNE Contributor License Agreement](https://cla-assistant.io/toeverything/AFFiNE) — required before merge; the `license/cla` check must be green ([how it works](https://github.com/toeverything/AFFiNE/blob/canary/docs/BUILDING.md#sign-the-cla-first)) - [x] The PR targets the `canary` branch and its title follows [Conventional Commits](https://www.conventionalcommits.org/) - [x] Tests are added or updated where it makes sense - [x] `yarn lint` and `yarn typecheck` pass locally ## Testing - Focused Chromium regression: 1 passed - Adjacent readonly paragraph scenarios: 3 passed - Targeted `oxfmt --check`: passed - Targeted `oxlint --deny-warnings`: passed - `git diff --check`: passed `yarn typecheck` could not be confirmed in this checkout because required generated workspace declaration outputs are missing. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved collapsed heading behavior in read-only mode. * Preserved local heading expansion and text selection when copying content and collapsing the heading. * Ensured local expansion state resets correctly when switching out of and back into read-only mode. * **Tests** * Added coverage for read-only heading expansion, keyboard copying, clipboard access, mode switching, and text selection. <!-- end of auto-generated comment: release notes by coderabbit.ai -->