Conversation
…ocus in design mode In design mode the active document can sit behind a surface that owns DOM focus instead of a CodeMirror editor — e.g. the markdown viewer's iframe when it's in edit mode. EditorManager.getFocusedEditor() returns null in that case, so the CCB undo/redo buttons (and anything else routing through EDIT_UNDO / EDIT_REDO) silently no-op'd even though the underlying Phoenix document had perfectly good history. When design mode is active and no editor is focused, fall back to EditorManager.getCurrentFullEditor() so toolbar undo/redo drives the active document. External surfaces that sync their edits back to that document (like the md viewer) will re-render to reflect the rolled-back text. Outside design mode the pre-existing no-op behavior is preserved.
Restores the vertical file-name + dirty-dot label that was removed in 22b2191 (replaced with a show-in-tree button at the time). The label hangs below the save group, reads the file name bottom-up, and shows a small amber dot at the top when the active document is dirty. Two improvements over the original: - Source the file from MainViewManager.getCurrentlyViewedFile(ACTIVE_PANE) instead of DocumentManager.getCurrentDocument(). getCurrentDocument() is CodeMirror-only, so the old label went blank whenever the active pane was an image or other non-CM view. Dirty state still goes through DocumentManager.getOpenDocumentForPath(fullPath), which is null for non-editable views — they correctly stay un-dirty. - Anti-pixelation for linux electron: swap `writing-mode: vertical-rl; transform: rotate(180deg)` for `writing-mode: sideways-lr`, which lets Chromium take its fast vertical-text path instead of rasterizing through a rotated transform. Pair it with translateZ(0), backface-visibility, -webkit-font-smoothing: antialiased, and text-rendering: geometricPrecision so the glyphs stay crisp even if a system falls back to the slow text path. Click still dispatches NAVIGATE_SHOW_IN_FILE_TREE (mirrors the binoculars affordance the label replaced). Tests: adds a 2b. #ccbFileLabel describe to CentralControlBar-integ-test covering render/placement, the name-shown / cleared-on-FILE_CLOSE_ALL cycle, the .is-dirty toggle via setText + refreshText, the click → NAVIGATE_SHOW_IN_FILE_TREE dispatch, and the label updating when the active file switches.
In code mode the active file is already obvious from the tab bar and working-files list, so the vertical CCB label is redundant chrome that just steals vertical space. In design mode the editor collapses and those affordances aren't visible — that's the only place the label earns its spot. Tag the divider preceding the file group with .ccb-file-divider so the divider + group can be hidden as a pair, and wrap both in a `body:not(.ccb-editor-collapsed)` rule. No JS toggle needed; the body class is already flipped by CentralControlBar when design mode changes. Adds a "should only be visible in design mode" integ test that checks :visible on both the label and the leading divider through enter/exit design-mode transitions.
Turn the live-preview toolbar's play button into an edit-mode toggle: - Icon: fa-play → fa-pencil; title "Toggle Preview Mode (F8)" → "Toggle Edit Mode (F8)" via new LIVE_PREVIEW_MODE_TOGGLE_EDIT string. - Invert the .selected semantics — the button now lights amber when LiveDevelopment.getCurrentMode() === LIVE_EDIT_MODE (not when in preview). _initializeMode reconciles .selected against the real mode on every livePreviewMode pref change, so state and visuals stay synchronized. - Click handler routes through LiveDevelopment.setMode(LIVE_EDIT_MODE) instead of PreferencesManager.set, so we pick up the entitlement gate for free: setMode returns false for users without the live-edit entitlement, and we then invoke KernalModeTrust.ProDialogs.showProUpsellDialog(UPSELL_TYPE_LIVE_EDIT) — the same dialog the mode dropdown's "Edit Mode" item opens (main.js:459-466). Pro users in edit drop back to preview; pro users not in edit enter edit. - F8 keybinding routes through the same click handler, so it gets the same behavior and upsell for free. No existing tests are affected — the two suites that touch #previewModeLivePreviewButton only assert its visibility, never the icon, the .selected class, or the click path.
Onboarding section 6's mode-switch hint used to embed the playButton.svg with alt="Play". The live-preview toolbar now surfaces a single pencil edit toggle instead of the play-styled preview button, so update DEMO_MODE_SWITCH_HINT to inline <i class="fa-solid fa-pencil"> inside the existing .play-button-hint chip, and change "buttons" to "button" since there's only one toggle now. Only root/strings.js is edited — other locales auto-translate via CI.
|
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.



Reinstated in design mode as per beta test feedback:
So we show filename with dirty indicator in design mode. Nothing in code mode.