Repository navigation
Add resizable split, undoable edits, and view switcher - #3
Merged
Merged
Conversation
Tracks the fraction of width given to the editor pane so a custom split survives reloads.
Insert via execCommand("insertText") so programmatic edits stay on the
browser's native undo stack (Ctrl/Cmd+Z) and keep React in sync through
the input event. Adds insertAtCursor for plain inserts like Tab.
Replace the corner focus toggle with a draggable divider (persisted, keyboard-resizable) and a centered Editor/Split/Preview switcher in the status rail. Pin panes to explicit grid columns so a hidden pane can't collapse the other to zero width. Wire undoable editor shortcuts.
Also reflects an editor formatting pass (tabs) on the file.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Three editor UX/UI improvements (plus a formatting pass and a repo-URL fix).
Improvements
1. Resizable split, not just all-or-nothing focus. Replaced the awkward bottom-right focus toggle with:
Preview behavior handled carefully:
minmax(0, …fr)tracks prevent overflow, drag is rAF-throttled, and the memoized preview only reflows on resize (never re-parses).2. Undoable toolbar edits. Toolbar/shortcut insertions previously wiped the native undo stack because they set the value through React. They now insert via
execCommand("insertText"), so Ctrl/Cmd+Z undoes them and React stays in sync via theinputevent (Tab too).3. Fixed blank Preview-only view. Hiding the editor let the grid auto-place the preview into the 0px divider track. Panes are now pinned to explicit grid columns so a hidden sibling can't collapse the other.
Also included
raj-khan/markdown.software.Verification
Browser-tested at 1440px: pane widths Preview-only
0 / 1440, Editor-only1440 / 0, Split717 / 717; image insert → Ctrl+Z restores original; drag persists ratio to localStorage.npm run lintandnpm run buildpass.