Skip to content

feat(demo): add heading edit buttons to viewer preview - #1381

Draft
d3m1d0v wants to merge 1 commit into
d3m1d0v/markdown-viewer-heading-anchorsfrom
codex/markdown-viewer-heading-editor
Draft

d3m1d0v wants to merge 1 commit into
d3m1d0v/markdown-viewer-heading-anchorsfrom
codex/markdown-viewer-heading-editor

Conversation

@d3m1d0v

@d3m1d0v d3m1d0v commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Add demo-only HeadingEditButtons to the existing Playground preview. Clicking a pencil moves the cursor to the heading's zero-based data-line, scrolls to it, and focuses the editor. The pencil stays after the last line of a wrapped heading and works independently from heading links.

Ignore clicks from an outdated preview. Close full preview before moving the cursor and focusing the editor. Disable Liquid processing in preview.

Summary by Sourcery

Enable reliable heading-to-source navigation in the Playground preview.

New Features:

  • Add demo-only edit buttons to rendered headings so users can jump from preview headings to the corresponding source line.

Bug Fixes:

  • Prevent stale preview interactions from editing changed source content and keep heading edit actions independent from heading links and folding controls.

Enhancements:

  • Close the full preview before moving and focusing the editor, preserve edit-button placement for wrapped headings, and disable Liquid processing in the demo preview.

Tests:

  • Add unit and visual coverage for heading edit rendering, stale previews, wrapped headings, folding headings, independent anchor actions, cursor movement, scrolling, and focus.

@d3m1d0v
d3m1d0v added this pull request to stack #1365 October 22, 2026 21:53
@gravity-ui

gravity-ui Bot commented Oct 22, 2026

Copy link
Copy Markdown

Storybook Deployed

@gravity-ui

gravity-ui Bot commented Oct 22, 2026

Copy link
Copy Markdown

🎭 Playwright Report

This branch has not been deployed

No deployments
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