Skip to content

Remember editor pane visibility - #519

Draft
leevi2010-cursor wants to merge 1 commit into
schuyler:mainfrom
leevi2010-cursor:claude/remember-editor-pane-019ef844
Draft

Remember editor pane visibility#519
leevi2010-cursor wants to merge 1 commit into
schuyler:mainfrom
leevi2010-cursor:claude/remember-editor-pane-019ef844

Conversation

@leevi2010-cursor

Copy link
Copy Markdown

Summary

Remember the user's editor pane choice when they use View > Hide Editor Pane or Restore Editor Pane.

  • Hiding the editor enables the existing "start in preview mode" preference
  • Restoring the editor disables that preference again
  • Only updates the preference when the pane visibility actually changes
  • Leaves preview-pane toggles and the existing last-visible-pane protection unchanged

This makes the next document window honor the most recent explicit editor-pane choice without adding another preference.

Testing

  • MPPaneToggleTests: 32 tests pass
  • Adds a non-headless layout test for hide, remember, restore, and clear

@schuyler schuyler left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the PR, @leevi2010-cursor!

Issues

  • Overloads a user-facing preference: hiding or restoring the editor pane silently writes editorStartInPreviewMode — the explicit "Start in preview mode" Preferences checkbox — so a user's deliberate opt-in gets cleared (and the checkbox visibly flips) as a side effect of a View-menu action, where a dedicated key or window state restoration would keep the two concepts separate.
  • Untested no-op interaction: no test covers the case where the last-visible-pane guard blocks the toggle, which is the interaction most likely to silently corrupt the remembered preference.

Suggestions

  • A one-line comment at the call site explaining the "write only on actual change" gate and its relationship to the last-visible-pane guard would make the coupling legible.
  • The asymmetry between toggleEditorPane: (writes the preference) and togglePreviewPane: (doesn't) is unexplained, so a note on the intent would help.
  • A test asserting togglePreviewPane: never touches editorStartInPreviewMode would lock in that intentional asymmetry.

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