Skip to content

Layout glitches when toggling navigation or editor panels #1278

@Ishita-190

Description

@Ishita-190

Describe the bug

Toggling the navigation or editor panels causes layout flickering and pane size jumps.

How to Reproduce

glitching.mp4

Steps to reproduce the issue. Attach all resources that can help us understand the issue:

(attached video)

  • Navigation open, enable Editor: Layout flickers while the editor is opening
  • Only Preview visible, enable Navigation: Pane sizes jump and the layout glitches
  • Only Preview visiblem enable Editor: Flickering occurs during the transition

Expected behavior

change.mp4

Proposed Changes

File : Content.tsx

  • Wrap Content with React.memo to prevent unnecessary re-renders.
  • Use useMemo for secondPaneSize and secondPaneMaxSize, returning 0 when both panels are disabled.
  • Memoize localStorageLeftPaneSize and localStorageRightPaneSize.
  • Extract pane resize handlers with useCallback.
  • Memoize navigationAndEditor JSX and pane styles.
  • Set inner SplitPane primary="first" for consistent behavior.

Happy to open a PR for this if the maintainers approve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions