Skip to content

Preserve TOC state in shared links and embed URLs#202

Draft
Copilot wants to merge 4 commits into
masterfrom
copilot/implement-toc-para-in-embed-url
Draft

Preserve TOC state in shared links and embed URLs#202
Copilot wants to merge 4 commits into
masterfrom
copilot/implement-toc-para-in-embed-url

Conversation

Copy link
Copy Markdown

Copilot AI commented May 13, 2026

The TOC view state was not carried through when sharing a pad or copying embed code, so recipients could open the same pad with a different layout. This updates both the live pad URL and the share/embed values so the selected TOC view travels with the link.

  • Sync TOC state into shareable URLs

    • Add toc=true|false to the current pad URL when the TOC toggle changes.
    • Rewrite the share link and embed iframe src to preserve the same TOC state.
  • Handle Etherpad share dialog regeneration

    • Re-apply the TOC parameter after Etherpad regenerates share/embed fields, including readonly mode changes.
  • Regression coverage

    • Add focused tests for:
      • URL parameter rewriting
      • embed src rewriting
      • share field synchronization
      • current-location URL synchronization
  • Example

    <iframe
      name="embed_readwrite"
      src="https://example.com/p/test-pad?showControls=true&showChat=true&toc=true"
      width="100%"
      height="600"
      frameborder="0"></iframe>

    Shared pad URLs now follow the same pattern:

    https://example.com/p/test-pad?showChat=false&toc=true
    

Copilot AI and others added 3 commits May 13, 2026 10:22
Agent-Logs-Url: https://github.com/ether/ep_table_of_contents/sessions/5f0f5716-b682-49ff-a18e-534e67b3de76

Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ether/ep_table_of_contents/sessions/5f0f5716-b682-49ff-a18e-534e67b3de76

Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ether/ep_table_of_contents/sessions/5f0f5716-b682-49ff-a18e-534e67b3de76

Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
Copilot AI changed the title [WIP] Add TOC parameter to embed URL for view style sharing Preserve TOC state in shared links and embed URLs May 13, 2026
Copilot AI requested a review from JohnMcLear May 13, 2026 10:30
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.

Find a good way to provide the TOC para as part of the embed url so when pad is shared so is the view style

2 participants