feat(scratchpad): lite VS Code — local-file editing, dirty indicator, shortcuts - #154
Merged
Merged
Conversation
Promote to production: SQL Formatter
Cmd+Shift+L (Select All Occurrences) is a built-in Monaco binding and is bundled/registered, and nothing in-app intercepts it — but the browser or an extension (password managers commonly grab Cmd+Shift+L) can swallow the keystroke before the page sees it. So: - Re-assert the Cmd/Ctrl+Shift+L binding AND add 'Select All Occurrences' to the editor's right-click menu, so multi-cursor stays reachable even when the hotkey is hijacked. - Wire VS Code-style Cmd/Ctrl+S (save) and Cmd/Ctrl+O (open) to the existing file handlers, so the scratchpad works like a lite VS Code (open/save local files, no install). - Clarify the helper text (select a word first; right-click fallback). New MonacoEditor onSave/onOpen props; pure editor-actions.lib for the keybinding chords with 3 unit tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ubfx4XocHcECaL8twp9zsr
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
goodwebtools | eb0047f | Aug 03 2026, 10:27 AM |
Make the Code Scratchpad behave like editing a real local file: - Opening or saving a file keeps its File System Access handle, so later edits save straight back to that file (Cmd+S, no re-prompt) instead of downloading a new copy each time. - After 'Save as…', the tab adopts the chosen file name (and language) — previously it stayed 'untitled.txt'. - Per-tab dirty indicator: a '*' shows unsaved edits, cleared on save. - Graceful fallback on browsers without the File System Access API (Firefox/Safari): read-only open + plain download save. Types the minimal FS Access API surface locally (no 'any'). Island glue, covered by build + manual smoke. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ubfx4XocHcECaL8twp9zsr
…type - Revert an accidental dangling SaveFileResult reference in the file service interface (vite build doesn't full type-check, so it slipped by). - Narrow editorKeybindings' MonacoKeys to the exact enum members used, so monaco's KeyMod/KeyCode enums (no string index signature) are assignable. tsc --noEmit is now clean for all touched files. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ubfx4XocHcECaL8twp9zsr
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.
Turns the Code Scratchpad into a proper lite VS Code you don't have to install.
Edit local files (like a real editor)
untitled.txt.*marks tabs with unsaved edits, cleared on save.VS Code shortcuts
Cmd/Ctrl+Ssave,Cmd/Ctrl+Oopen, wired to the file handlers.Details
editor-actions.lib.ts— pure keybinding-chord helper, 3 unit testsMonacoEditor.tsx—onSave/onOpenprops; registers the action + commands on mountCodeScratchpad.tsx— file-handle linking, dirty tracking, name adoptiontsc --noEmitclean for touched files🤖 Generated with Claude Code