Skip to content

Add a script to prevent flicker when auto-saving pane layouts. - #18

Draft
kantum wants to merge 5 commits into
giusdp:mainfrom
kantum:flicker
Draft

Add a script to prevent flicker when auto-saving pane layouts.#18
kantum wants to merge 5 commits into
giusdp:mainfrom
kantum:flicker

Conversation

@kantum

@kantum kantum commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

With liveview, reloading the page has some unwanted rendering:

Screen.Recording.2026-02-07.at.23.09.45.mov

This PR offer an solution, it works for my usecase but might not be working in more complex setup.

Copilot AI review requested due to automatic review settings February 7, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an inline restore script to apply auto-saved pane layouts from localStorage during initial HTML parse, reducing visible layout flicker before LiveView hooks initialize.

Changes:

  • Renders a new inline <script> in LivePane.group/1 when auto_save is enabled.
  • The script reads persisted layout state from localStorage and applies flexbox styles to panes before hooks run.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/live_pane.ex
Comment thread lib/live_pane.ex Outdated
Comment thread lib/live_pane.ex Outdated
kantum and others added 4 commits February 8, 2026 00:24
Implement copilot suggestion

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kantum
kantum marked this pull request as draft February 8, 2026 03:24
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.

2 participants