dsh-remote-vs 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +40 -10
- package/README.md +31 -9
- package/lib/client.js +2616 -542
- package/lib/index.js +186 -40
- package/lib/types/client/CodeEditor.d.ts +17 -0
- package/lib/types/client/EditorPane.d.ts +16 -5
- package/lib/types/client/FloatingPlaceholder.d.ts +16 -5
- package/lib/types/client/RemoteEditorView.d.ts +13 -10
- package/lib/types/client/RemoteRoot.d.ts +5 -5
- package/lib/types/client/TerminalSnippets.d.ts +36 -0
- package/lib/types/client/TerminalView.d.ts +1 -1
- package/lib/types/client/XTerm.d.ts +33 -0
- package/lib/types/client/editor-capability.d.ts +27 -0
- package/lib/types/client/i18n.d.ts +1 -1
- package/lib/types/client/store.d.ts +59 -4
- package/lib/types/client/terminal-input.d.ts +23 -0
- package/lib/types/client/terminal-snippets.d.ts +86 -0
- package/lib/types/client/vsc/breadcrumb.d.ts +30 -0
- package/lib/types/client/vsc/editor-caret.d.ts +32 -0
- package/lib/types/client/vsc/editor-langs.d.ts +9 -0
- package/lib/types/client/vsc/editor-settings.d.ts +55 -0
- package/lib/types/client/vsc/image-preview.d.ts +36 -0
- package/lib/types/client/vsc/kit.d.ts +2 -0
- package/lib/types/client/vsc/terminal-clipboard.d.ts +15 -0
- package/lib/types/client/vsc/terminal-line.d.ts +25 -0
- package/lib/types/client/vsc/terminal-links.d.ts +62 -0
- package/lib/types/client/vsc/terminal-theme.d.ts +22 -0
- package/lib/types/client/vsc/terminal-writer.d.ts +52 -0
- package/lib/types/pool.d.ts +25 -0
- package/lib/types/terminal.d.ts +25 -1
- package/package.json +1 -1
- package/src/client/CodeEditor.tsx +54 -2
- package/src/client/EditorPane.tsx +485 -107
- package/src/client/FloatingPlaceholder.tsx +34 -5
- package/src/client/RemoteEditorView.tsx +14 -11
- package/src/client/RemoteRoot.tsx +20 -125
- package/src/client/TerminalSnippets.tsx +357 -0
- package/src/client/TerminalView.tsx +50 -1
- package/src/client/XTerm.tsx +228 -58
- package/src/client/auto-open-remote.ts +11 -9
- package/src/client/editor-capability.ts +42 -0
- package/src/client/i18n.ts +148 -6
- package/src/client/index.tsx +22 -6
- package/src/client/store.tsx +165 -13
- package/src/client/terminal-input.ts +44 -0
- package/src/client/terminal-snippets.ts +216 -0
- package/src/client/vsc/breadcrumb.tsx +251 -0
- package/src/client/vsc/editor-caret.ts +30 -0
- package/src/client/vsc/editor-langs.ts +20 -0
- package/src/client/vsc/editor-settings.ts +146 -0
- package/src/client/vsc/editor-theme.ts +4 -5
- package/src/client/vsc/image-preview.tsx +110 -0
- package/src/client/vsc/kit.tsx +20 -1
- package/src/client/vsc/terminal-clipboard.ts +19 -0
- package/src/client/vsc/terminal-line.ts +101 -0
- package/src/client/vsc/terminal-links.ts +166 -0
- package/src/client/vsc/terminal-theme.ts +71 -0
- package/src/client/vsc/terminal-writer.ts +112 -0
- package/src/client/vsc/vsc.css +687 -48
- package/src/pool.ts +99 -27
- package/src/terminal.ts +160 -6
package/lib/client.js
CHANGED
|
@@ -11,7 +11,7 @@ window.__ModuleLoader__.load({
|
|
|
11
11
|
let react_dom = require("react-dom");
|
|
12
12
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
13
|
//#region \0dsh-css:src/client/vsc/vsc.css.mjs
|
|
14
|
-
const css$3 = "/**\n * VS Code-style design system for the remote explorer. Every surface below\n * is scoped under `.rvs-root` so the sheet can never leak into the host GUI,\n * and every host token carries a literal fallback: the plugin also renders in\n * the native right-Sidebar fallback and on hosts whose alias tokens differ.\n *\n * Palette and metrics are aligned with the reference implementation\n * (dsh-solution-explorer): 13px/20px panel type, 5px/10px tree rows with a\n * 10px radius, a 30px activity button with the badge tucked into the icon's\n * bottom-right corner, GitHub-Dark token colors, and the\n * `--e2b714 / #4ec9b0 / #f14c4c` modified/added/deleted triple.\n */\n\n.rvs-root {\n --rvs-fg: var(--dsw-alias-label-primary, #e6e6e6);\n --rvs-fg2: var(--dsw-alias-label-secondary, #b9b9b9);\n --rvs-fg3: var(--dsw-alias-label-tertiary, #8b8b8b);\n --rvs-hover: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, .14));\n --rvs-active: var(--dsw-alias-interactive-bg-active, rgba(77, 107, 254, .22));\n --rvs-border: var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n --rvs-border2: var(--dsw-alias-border-l2, rgba(127, 127, 127, .38));\n --rvs-input: var(--dsw-alias-bg-input, rgba(127, 127, 127, .12));\n --rvs-overlay: var(--dsw-alias-bg-overlay, #24262e);\n --rvs-layer3: var(--dsw-alias-bg-layer-3, rgba(127, 127, 127, .16));\n --rvs-brand: var(--dsw-alias-brand-primary, #4d6bfe);\n --rvs-accent: var(--dsw-alias-button-info-fill, #4d6bfe);\n --rvs-danger: var(--dsw-alias-state-error-primary, #e05555);\n --rvs-ok: #2ea043;\n --rvs-git-m: #e2b714;\n --rvs-git-a: #4ec9b0;\n --rvs-git-d: #f14c4c;\n --rvs-git-r: #4ec9b0;\n --rvs-git-c: #58a6ff;\n --rvs-git-u: #f14c4c;\n --rvs-git-x: #6e6e6e;\n --rvs-add-bg: rgba(78, 201, 176, .15);\n --rvs-del-bg: rgba(241, 76, 76, .15);\n /* Opaque equivalents, for elements that must not show what scrolls under\n them (the pinned diff line numbers). */\n --rvs-add-solid: #e4f6f1;\n --rvs-del-solid: #fdeaea;\n --rvs-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;\n /* Opaque code surfaces (Light+ default; the dark block below flips them). */\n --rvs-code-bg: #ffffff;\n --rvs-code-fg: #1f1f1f;\n --rvs-code-gutter-fg: #237893;\n\n display: flex;\n flex-direction: row;\n height: 100%;\n min-height: 0;\n overflow: hidden;\n color: var(--rvs-fg);\n font-size: 13px;\n line-height: 20px;\n}\n\n/**\n * Code surfaces are OPAQUE, in the editor's own palette rather than the DSH\n * skin: syntax colors need a definite background to stay readable, and the\n * app shell marks its resolved scheme on <body> (same signal theme.ts reads).\n */\nbody[data-ds-dark-theme] .rvs-root {\n --rvs-code-bg: #1e1e1e;\n --rvs-code-fg: #d4d4d4;\n --rvs-code-gutter-fg: #858585;\n --rvs-add-solid: #16332e;\n --rvs-del-solid: #3b2325;\n}\n\n.rvs-edge {\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n}\n\n.rvs-root *,\n.rvs-portal * {\n box-sizing: border-box;\n}\n\n/* ------------------------------------------------------------ activity rail */\n\n.rvs-rail {\n flex: none;\n width: 38px;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n padding: 8px 0;\n border-right: 1px solid var(--rvs-border);\n background: var(--dsw-specific-sidebar-fill, transparent);\n}\n\n.rvs-rail-btn {\n position: relative;\n flex: none;\n width: 30px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: var(--rvs-fg3);\n cursor: pointer;\n}\n\n.rvs-rail-btn:hover {\n color: var(--rvs-fg);\n background: var(--rvs-hover);\n}\n\n.rvs-rail-btn.active {\n color: var(--rvs-fg);\n background: var(--rvs-hover);\n box-shadow: inset 2px 0 0 var(--rvs-brand);\n}\n\n.rvs-rail-btn.danger:hover {\n color: var(--rvs-danger);\n}\n\n.rvs-rail-badge {\n position: absolute;\n bottom: 1px;\n right: 1px;\n min-width: 14px;\n height: 14px;\n padding: 0 3px;\n border-radius: 7px;\n background: var(--rvs-accent);\n color: #fff;\n font-size: 9px;\n font-weight: 700;\n line-height: 14px;\n text-align: center;\n pointer-events: none;\n}\n\n.rvs-rail-sep {\n flex: none;\n width: 20px;\n height: 1px;\n margin: 4px 0;\n background: var(--rvs-border);\n}\n\n/* -------------------------------------------------------- panel + editor */\n\n.rvs-column {\n flex: 1;\n min-width: 0;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.rvs-pane {\n display: flex;\n flex-direction: column;\n min-height: 0;\n min-width: 0;\n overflow: hidden;\n}\n\n/**\n * One lazily-mounted panel slot: a visited panel stays mounted and is merely\n * hidden, so returning to the explorer (or the terminal) neither refetches nor\n * flashes a reload.\n */\n.rvs-viewslot {\n flex: 1;\n min-height: 0;\n min-width: 0;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n}\n\n/**\n * Padding for the legacy views (workspaces / terminal) that draw no chrome.\n *\n * It MUST be a flex column: the workspaces view scroller is its child and gets\n * its bounded height only from a flex parent (`flex:1; min-height:0`). As a\n * plain block it grew with its content instead, so the panel clipped at the\n * viewslot's `overflow:hidden` and the binding list could not scroll at all —\n * a seventh workspace (and the wizard under it) was simply unreachable.\n */\n.rvs-viewpad {\n display: flex;\n flex-direction: column;\n min-height: 0;\n padding: 10px 12px 14px;\n box-sizing: border-box;\n}\n\n.rvs-pane.grow {\n flex: 1;\n}\n\n.rvs-header {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n height: 34px;\n padding: 0 8px 0 10px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-header .rvs-title {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: .04em;\n text-transform: uppercase;\n color: var(--rvs-fg3);\n}\n\n.rvs-hbtn {\n flex: none;\n width: 22px;\n height: 22px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n border-radius: 5px;\n background: transparent;\n color: var(--rvs-fg3);\n cursor: pointer;\n}\n\n.rvs-hbtn:hover {\n color: var(--rvs-fg);\n background: var(--rvs-hover);\n}\n\n.rvs-hbtn.danger:hover {\n color: #fff;\n background: var(--rvs-danger);\n}\n\n.rvs-hbtn:disabled {\n opacity: .4;\n cursor: default;\n}\n\n.rvs-scroll {\n flex: 1;\n min-height: 0;\n overflow: auto;\n scrollbar-width: thin;\n}\n\n.rvs-globalbar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 8px;\n border-bottom: 1px solid var(--rvs-border);\n font-size: 11px;\n}\n\n/*\n * Connection chip: the Host's SSH link health for the workspace on screen.\n * Lives in the top bar and, compact, in the editor info bar. Only the errored\n * state is interactive (retry); the others are a status read-out.\n */\n.rvs-conn {\n flex: none;\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 1px 6px 1px 5px;\n border: 1px solid transparent;\n border-radius: 9px;\n background: transparent;\n color: var(--rvs-fg2);\n font: inherit;\n font-size: 11px;\n line-height: 16px;\n cursor: default;\n}\n\n.rvs-conn.compact {\n padding: 0 2px;\n border: none;\n background: none;\n}\n\n.rvs-conn.clickable {\n cursor: pointer;\n}\n\n.rvs-conn.clickable:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-conn-dot {\n flex: none;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--rvs-fg3);\n}\n\n.rvs-conn-ok .rvs-conn-dot {\n background: var(--rvs-ok, #2ea043);\n}\n\n.rvs-conn-error {\n color: var(--rvs-danger);\n}\n\n.rvs-conn-error .rvs-conn-dot {\n background: var(--rvs-danger);\n}\n\n.rvs-conn-label {\n max-width: 9em;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.rvs-scroll::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n}\n\n.rvs-scroll::-webkit-scrollbar-thumb {\n background: var(--dsw-alias-scrollbar-bg-l2, rgba(127, 127, 127, .4));\n border-radius: 4px;\n}\n\n.rvs-scroll::-webkit-scrollbar-thumb:hover {\n background: var(--dsw-alias-scrollbar-hover-l2, rgba(127, 127, 127, .6));\n}\n\n.rvs-scroll::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.rvs-vsplit-handle {\n flex: none;\n position: relative;\n height: 7px;\n cursor: row-resize;\n touch-action: none;\n}\n\n.rvs-vsplit-handle::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n top: 3px;\n height: 1px;\n background: var(--rvs-border);\n}\n\n.rvs-vsplit-handle:hover::after,\n.rvs-vsplit-handle[data-dragging='true']::after {\n top: 2px;\n height: 3px;\n border-radius: 2px;\n background: var(--rvs-brand);\n}\n\n/* ------------------------------------------------------------------ tree */\n\n.rvs-tree {\n padding: 4px 6px 12px;\n min-width: 0;\n}\n\n.rvs-node {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n width: 100%;\n padding: 4px 8px;\n border: none;\n background: transparent;\n border-radius: 8px;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 13px;\n line-height: 18px;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-node:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-node.selected {\n background: var(--rvs-active);\n}\n\n.rvs-node.cut {\n opacity: .5;\n}\n\n.rvs-node.drop-target {\n background: var(--rvs-active);\n outline: 1px solid var(--rvs-brand);\n outline-offset: -1px;\n}\n\n/* Where a file drag will land: a slip must not silently drop a tree into the\n wrong directory. */\n.rvs-drop-hint {\n margin: 2px 8px 4px;\n padding: 3px 8px;\n border: 1px dashed var(--rvs-brand);\n border-radius: 3px;\n font-size: 11px;\n color: var(--rvs-brand);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n direction: rtl;\n unicode-bidi: plaintext;\n}\n/* Upload progress: one line under the header. A multi-minute transfer with no\n feedback is indistinguishable from a hung explorer, so the row names the\n count and the file on the wire. */\n.rvs-upload-bar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 3px 10px 4px;\n font-size: 11px;\n color: var(--dsw-alias-text-secondary, rgba(127, 127, 127, .95));\n}\n\n.rvs-upload-text {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n direction: rtl;\n unicode-bidi: plaintext;\n}\n\n.rvs-node-icon {\n flex: none;\n width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--rvs-fg3);\n}\n\n.rvs-node-name {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-node-actions {\n flex: none;\n display: none;\n align-items: center;\n gap: 2px;\n}\n\n.rvs-node:hover .rvs-node-actions {\n display: flex;\n}\n\n.rvs-git-letter {\n flex: none;\n width: 14px;\n margin-left: 2px;\n font-size: 11px;\n font-weight: 700;\n text-align: center;\n}\n\n.rvs-git-M, .rvs-letter-M { color: var(--rvs-git-m); }\n.rvs-git-A, .rvs-letter-A { color: var(--rvs-git-a); }\n.rvs-git-D, .rvs-letter-D { color: var(--rvs-git-d); }\n.rvs-git-R, .rvs-letter-R { color: var(--rvs-git-r); }\n.rvs-git-C, .rvs-letter-C { color: var(--rvs-git-c); }\n.rvs-git-U, .rvs-letter-U { color: var(--rvs-git-u); }\n.rvs-git-q, .rvs-letter-q, .rvs-git-\\\\? { color: var(--rvs-git-a); }\n.rvs-git-x, .rvs-letter-x { color: var(--rvs-git-x); }\n.rvs-git-T, .rvs-letter-T { color: var(--rvs-git-m); }\n\n.rvs-rename-input {\n flex: 1;\n min-width: 0;\n padding: 0 4px;\n border: 1px solid var(--rvs-brand);\n border-radius: 4px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n font-size: 13px;\n line-height: 18px;\n outline: none;\n}\n\n.rvs-empty {\n padding: 18px 14px;\n color: var(--rvs-fg3);\n font-size: 12px;\n text-align: center;\n line-height: 1.7;\n}\n\n.rvs-banner {\n margin: 6px 8px;\n padding: 6px 9px;\n border-radius: 6px;\n font-size: 12px;\n line-height: 1.5;\n word-break: break-word;\n white-space: pre-wrap;\n}\n\n.rvs-banner.info {\n background: var(--rvs-hover);\n color: var(--rvs-fg2);\n}\n\n.rvs-banner.error {\n background: rgba(200, 60, 60, .16);\n color: var(--rvs-danger);\n}\n\n.rvs-banner.warn {\n background: rgba(226, 183, 20, .14);\n color: var(--rvs-git-m);\n}\n\n/* ------------------------------------------------- save conflict (refused) */\n\n/* The banner is a decision, not a message: it stacks its text over the actions\n so a narrow sidebar cannot squeeze the buttons into one unreadable row. */\n.rvs-conflict {\n display: flex;\n flex-direction: column;\n gap: 6px;\n white-space: normal;\n}\n\n.rvs-conflict-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.rvs-conflict-diff {\n margin: 6px 8px;\n max-height: 40vh;\n overflow: auto;\n border: 1px solid var(--rvs-border);\n border-radius: 6px;\n background: var(--rvs-hover);\n color: var(--rvs-fg2);\n font-family: var(--rvs-mono);\n font-size: 11.5px;\n line-height: 1.45;\n}\n\n.rvs-conflict-diff-head {\n position: sticky;\n top: 0;\n padding: 4px 8px;\n background: var(--rvs-panel, var(--rvs-hover));\n border-bottom: 1px solid var(--rvs-border);\n font-family: inherit;\n}\n\n.rvs-conflict-hunk-head {\n padding: 2px 8px;\n color: var(--rvs-fg3);\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-conflict-row {\n padding: 0 8px;\n white-space: pre;\n}\n\n.rvs-conflict-row.add {\n background: rgba(78, 201, 176, .14);\n color: var(--rvs-git-a);\n}\n\n.rvs-conflict-row.del {\n background: rgba(241, 76, 76, .12);\n color: var(--rvs-git-d);\n}\n\n.rvs-conflict-more {\n padding: 4px 8px;\n color: var(--rvs-fg3);\n}\n\n/* --------------------------------------------------------- source control */\n\n.rvs-scm-section {\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-scm-head {\n display: flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n padding: 0 6px 0 4px;\n cursor: pointer;\n user-select: none;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: .04em;\n text-transform: uppercase;\n color: var(--rvs-fg2);\n}\n\n.rvs-scm-head:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-scm-head .rvs-count {\n margin-left: 6px;\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0;\n color: var(--rvs-fg3);\n}\n\n.rvs-scm-head-actions {\n margin-left: auto;\n display: flex;\n align-items: center;\n gap: 2px;\n}\n\n.rvs-scm-section.collapsed > *:not(.rvs-scm-head) {\n display: none !important;\n}\n\n.rvs-chevron {\n flex: none;\n transition: transform .12s ease;\n}\n\n.rvs-chevron.open {\n transform: rotate(90deg);\n}\n\n.rvs-scm-item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 3px 8px 3px 22px;\n border: none;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12.5px;\n line-height: 19px;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-scm-item:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-scm-item.selected {\n background: var(--rvs-active);\n}\n\n.rvs-scm-path {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-scm-dir {\n flex: none;\n color: var(--rvs-fg3);\n}\n\n.rvs-scm-actions {\n flex: none;\n display: none;\n align-items: center;\n gap: 1px;\n}\n\n.rvs-scm-item:hover .rvs-scm-actions {\n display: flex;\n}\n\n.rvs-commit-box {\n flex: none;\n padding: 8px 10px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-commit-input {\n width: 100%;\n min-height: 58px;\n max-height: 180px;\n padding: 6px 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12.5px;\n line-height: 18px;\n resize: vertical;\n outline: none;\n}\n\n.rvs-commit-input:focus {\n border-color: var(--rvs-brand);\n}\n\n.rvs-commit-row {\n display: flex;\n gap: 6px;\n margin-top: 6px;\n}\n\n.rvs-commit-btn {\n flex: 1;\n padding: 5px 8px;\n border: none;\n border-radius: 6px;\n background: var(--rvs-accent);\n color: #fff;\n font: inherit;\n font-size: 12.5px;\n font-weight: 600;\n cursor: pointer;\n}\n\n.rvs-commit-btn:disabled {\n opacity: .45;\n cursor: default;\n}\n\n.rvs-repo-item {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 5px 10px 5px 12px;\n cursor: pointer;\n font-size: 12.5px;\n}\n\n.rvs-repo-item:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-repo-item.active {\n background: var(--rvs-active);\n}\n\n.rvs-repo-name {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-repo-branch {\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-pill {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 1px 8px;\n border-radius: 999px;\n background: var(--rvs-hover);\n font-size: 11px;\n font-weight: 600;\n color: var(--rvs-fg);\n}\n\n/* \"cached · refreshing\" badge: quieter than a pill that carries information the\n user asked for (a branch), because it is a qualifier on the list beside it. */\n.rvs-pill-cached {\n flex: none;\n font-weight: 500;\n color: var(--rvs-fg3);\n border: 1px solid var(--rvs-border2);\n background: transparent;\n}\n\n.rvs-subpanel {\n margin: 6px 8px;\n padding: 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n font-size: 12px;\n}\n\n.rvs-subpanel-head {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 6px;\n color: var(--rvs-fg2);\n font-weight: 600;\n}\n\n.rvs-chip {\n flex: none;\n padding: 2px 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 6px;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 11.5px;\n cursor: pointer;\n}\n\n.rvs-chip:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-chip.primary {\n background: var(--rvs-accent);\n border-color: transparent;\n color: #fff;\n}\n\n.rvs-chip.danger:hover {\n background: var(--rvs-danger);\n border-color: transparent;\n color: #fff;\n}\n\n.rvs-input {\n flex: 1;\n min-width: 0;\n padding: 4px 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 6px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12px;\n outline: none;\n}\n\n.rvs-input:focus {\n border-color: var(--rvs-brand);\n}\n\n.rvs-select {\n flex: 1;\n min-width: 0;\n padding: 3px 6px;\n border: 1px solid var(--rvs-border2);\n border-radius: 6px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12px;\n outline: none;\n color-scheme: light dark;\n}\n\n.rvs-select option {\n background: Canvas;\n color: CanvasText;\n}\n\n/* ------------------------------------------------- conversation-view mount */\n\n/**\n * Bound the center surface to the height the host gave the slot.\n *\n * `flex: 1 1 0` is the load-bearing declaration, and BOTH halves of it matter.\n * The host's own slot rules are:\n *\n * .wSkVaW_viewArea { flex: 1; min-height: 0; overflow: hidden }\n * [data-phase=active] .viewArea { flex: 1 0 auto; min-height: auto }\n * .wSkVaW_root { height: 100%; position: relative }\n *\n * While a conversation is active the slot's flex-basis is `auto`, so the slot's\n * height is driven by its child's INTRINSIC size. A full-height editor then\n * pushed it to 5510px for a 300-line file, the outer scroller took over, and\n * the tab strip and file info bar scrolled off the top with the code.\n *\n * `flex-basis: 0` breaks that cycle: the item stops contributing its content\n * height, so the slot stays the size the host intended and `.cm-scroller`\n * becomes the only scroller. Measured in the fixture (.spike/layout-fixture.html,\n * which mirrors the slot rules above) — only the bottom row fits:\n *\n * flex: 1 1 0 + min-height: 0 -> 736px OK\n * flex: 1 1 auto (i.e. `flex: 1`) -> 5510px broken\n * height: 0 + min-height: 100% -> 5510px broken\n * max-height: 100% -> 5510px broken\n * height: 100vh -> 5510px broken\n *\n * `height: 100%` is deliberately NOT set here any more. It resolves to `auto`\n * against a slot whose height is not definite — it reads like the fix but\n * measures as a no-op, which is how this regressed once already.\n *\n * NOT `position: absolute` either — that was another failed attempt: `.viewArea`\n * is not itself positioned, so `inset: 0` escaped to the host's `.wSkVaW_root`\n * (which is `position: relative`) and the plugin's global bar floated on top of\n * the host's 对话 / 轨迹 / 远程编辑器 tab row.\n *\n * The sidebar's `.rvs-viewslot` is deliberately not covered: it has a bounding\n * parent and this bug is specific to the conversation slot's `min-height: auto`\n * phase.\n */\n.rvs-center {\n flex: 1 1 0;\n display: flex;\n flex-direction: column;\n min-height: 0;\n min-width: 0;\n overflow: hidden;\n}\n\n/* ---------------------------------------------------------------- editor */\n\n.rvs-etabs {\n flex: none;\n display: flex;\n align-items: stretch;\n gap: 2px;\n height: 32px;\n padding: 0 4px;\n overflow-x: auto;\n overflow-y: hidden;\n border-bottom: 1px solid var(--rvs-border);\n scrollbar-width: none;\n}\n\n.rvs-etabs::-webkit-scrollbar {\n height: 0;\n}\n\n.rvs-etab {\n flex: none;\n display: flex;\n align-items: center;\n gap: 5px;\n max-width: 190px;\n margin: 4px 0;\n padding: 0 4px 0 8px;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: var(--rvs-fg3);\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n\n.rvs-etab:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-etab.active {\n background: var(--rvs-layer3);\n color: var(--rvs-fg);\n}\n\n.rvs-etab-name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-etab-dot {\n flex: none;\n font-size: 9px;\n color: var(--rvs-git-m);\n}\n\n.rvs-etab-close {\n flex: none;\n width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n border-radius: 4px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n opacity: .65;\n}\n\n.rvs-etab-close:hover {\n background: var(--rvs-hover);\n opacity: 1;\n}\n\n.rvs-einfo {\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 2px 8px 2px 10px;\n border-bottom: 1px solid var(--rvs-border);\n font-size: 11px;\n line-height: 18px;\n color: var(--rvs-fg3);\n}\n\n.rvs-einfo-path {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n /* Truncate from the LEFT (keep the tail) without reordering the text:\n `plaintext` gives the content its own LTR base direction, which is what\n stops a leading \"/\" from rendering as a trailing one. */\n direction: rtl;\n unicode-bidi: plaintext;\n text-align: left;\n}\n\n.rvs-einfo-spacer {\n margin-left: auto;\n}\n\n.rvs-status.dirty { color: var(--rvs-git-m); }\n.rvs-status.saved { color: var(--rvs-git-a); }\n.rvs-status.saving { color: var(--rvs-fg2); }\n\n.rvs-body {\n flex: 1;\n min-height: 0;\n min-width: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* Anchors portalled overlays (the find widget) outside every scroller. */\n position: relative;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n}\n\n.rvs-editor-host {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n background: var(--rvs-code-bg);\n}\n\n/* Keep a panel mounted but out of layout (and out of the a11y tree). Used by\n the editor host in preview mode: unmounting it destroyed the buffer and the\n undo stack, hiding it preserves both. */\n.rvs-hidden {\n display: none !important;\n}\n\n/* Find-match marks. Painted by our own StateField (`findMatchHighlight`), and\n deliberately the SAME colours as the `.cm-searchMatch` rules below so the\n two paths cannot drift apart. */\n.rvs-find-match {\n background-color: rgba(226, 183, 20, .30);\n outline: 1px solid rgba(226, 183, 20, .55);\n border-radius: 2px;\n}\n\n.rvs-find-match.current {\n background-color: rgba(226, 183, 20, .48);\n}\n\n/* ------------------------------------------------------- preview surfaces */\n\n.rvs-preview-img {\n flex: 1;\n min-height: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: auto;\n background-color: var(--rvs-code-bg);\n background-image:\n linear-gradient(45deg, rgba(127, 127, 127, .08) 25%, transparent 25%),\n linear-gradient(-45deg, rgba(127, 127, 127, .08) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, rgba(127, 127, 127, .08) 75%),\n linear-gradient(-45deg, transparent 75%, rgba(127, 127, 127, .08) 75%);\n background-size: 20px 20px, 20px 20px, 20px 20px, 20px 20px;\n background-position: 0 0, 0 10px, 10px -10px, -10px 0;\n}\n\n.rvs-preview-img img {\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n image-rendering: auto;\n}\n\n.rvs-markdown {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 12px 14px 24px;\n font-size: 13px;\n line-height: 1.7;\n color: var(--rvs-code-fg);\n background: var(--rvs-code-bg);\n user-select: text;\n}\n\n.rvs-markdown h1, .rvs-markdown h2, .rvs-markdown h3, .rvs-markdown h4 {\n margin: 14px 0 6px;\n line-height: 1.35;\n}\n\n.rvs-markdown h1 { font-size: 19px; border-bottom: 1px solid var(--rvs-border); padding-bottom: 5px; }\n.rvs-markdown h2 { font-size: 16px; border-bottom: 1px solid var(--rvs-border); padding-bottom: 4px; }\n.rvs-markdown h3 { font-size: 14px; }\n.rvs-markdown p { margin: 6px 0; }\n.rvs-markdown ul, .rvs-markdown ol { margin: 6px 0; padding-left: 22px; }\n.rvs-markdown li { margin: 2px 0; }\n.rvs-markdown code {\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--rvs-hover);\n font-family: var(--rvs-mono);\n font-size: 12px;\n}\n.rvs-markdown pre {\n margin: 8px 0;\n padding: 9px 11px;\n border-radius: 8px;\n background: var(--rvs-input);\n overflow-x: auto;\n}\n.rvs-markdown pre code { padding: 0; background: transparent; }\n.rvs-markdown blockquote {\n margin: 8px 0;\n padding: 2px 12px;\n border-left: 3px solid var(--rvs-border2);\n color: var(--rvs-fg2);\n}\n.rvs-markdown a { color: var(--dsw-alias-label-link, #58a6ff); text-decoration: none; }\n.rvs-markdown a:hover { text-decoration: underline; }\n.rvs-markdown table { border-collapse: collapse; margin: 8px 0; font-size: 12px; }\n.rvs-markdown th, .rvs-markdown td { border: 1px solid var(--rvs-border2); padding: 4px 8px; }\n.rvs-markdown hr { border: none; border-top: 1px solid var(--rvs-border); margin: 12px 0; }\n\n.rvs-html-frame {\n flex: 1;\n min-height: 0;\n width: 100%;\n border: none;\n background: #fff;\n}\n\n/* ------------------------------------------------------------------ diff */\n\n.rvs-diff {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.rvs-diff-toolbar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 3px 8px;\n border-bottom: 1px solid var(--rvs-border);\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n/**\n * Prev/next change, in the toolbar's free space.\n *\n * Two chevrons around a tabular counter: the pair then reads as \"jump to change\n * n of N\" instead of two anonymous arrows, and the counter doubles as the \"where\n * am I\" cue while scrolling by hand.\n */\n.rvs-hunknav {\n display: inline-flex;\n align-items: center;\n gap: 1px;\n margin-right: 2px;\n}\n\n.rvs-hunknav-pos {\n min-width: 30px;\n text-align: center;\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n color: var(--rvs-fg3);\n user-select: none;\n}\n\n.rvs-seg {\n display: inline-flex;\n border: 1px solid var(--rvs-border2);\n border-radius: 6px;\n overflow: hidden;\n}\n\n.rvs-seg button {\n padding: 2px 9px;\n border: none;\n background: transparent;\n color: var(--rvs-fg2);\n font: inherit;\n font-size: 11px;\n cursor: pointer;\n}\n\n.rvs-seg button.active {\n background: var(--rvs-active);\n color: var(--rvs-fg);\n}\n\n.rvs-seg button:hover:not(.active) {\n background: var(--rvs-hover);\n}\n\n.rvs-diff-grid {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n overflow-x: hidden;\n font-family: var(--rvs-mono);\n font-size: 12px;\n line-height: 18px;\n scrollbar-width: thin;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n}\n\n/**\n * Top horizontal scrollbar.\n *\n * The two panes scroll horizontally on their own — so a long line can never\n * widen the layout — and this proxy bar drives both of them from the TOP of\n * the view, instead of forcing a scroll to the bottom of the file to reach a\n * horizontal bar. Its inner spacer is sized to the widest line, and the\n * component only renders it when a line really is wider than the grid.\n *\n * Sized and coloured to be SEEN: as a 13 px band with `scrollbar-width: thin`\n * and a faint thumb, it read as \"there is no horizontal scrollbar at all\".\n */\n.rvs-hbar {\n flex: none;\n height: 15px;\n overflow-x: auto;\n overflow-y: hidden;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-hover);\n}\n\n.rvs-hbar-inner {\n height: 1px;\n}\n\n.rvs-hbar::-webkit-scrollbar {\n height: 11px;\n}\n\n.rvs-hbar::-webkit-scrollbar-thumb {\n background: var(--dsw-alias-scrollbar-bg-l2, rgba(150, 160, 180, .75));\n border-radius: 6px;\n border: 2px solid transparent;\n background-clip: padding-box;\n}\n\n.rvs-hbar::-webkit-scrollbar-thumb:hover {\n background: var(--dsw-alias-scrollbar-hover-l2, rgba(170, 180, 200, .95));\n background-clip: padding-box;\n}\n\n.rvs-hbar::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.rvs-diff-cols {\n display: flex;\n align-items: stretch;\n min-width: 0;\n}\n\n/**\n * One diff pane. `flex: 1 1 0` keeps the panes EXACTLY equal however long a\n * line is (the previous row markup let a long line widen its own pane, which\n * is what broke the symmetry). Each pane keeps its own horizontal scroll, and\n * its scrollbar is now VISIBLE: the top proxy remains the convenient control,\n * but the pane's own bar is what a user reaches for first, and it sits right\n * under the content when the file is shorter than the view.\n */\n.rvs-diff-col {\n flex: 1 1 0;\n min-width: 0;\n overflow-x: auto;\n overflow-y: hidden;\n}\n\n.rvs-diff-col::-webkit-scrollbar {\n height: 9px;\n width: 0;\n}\n\n.rvs-diff-col::-webkit-scrollbar-thumb {\n background: var(--dsw-alias-scrollbar-bg-l2, rgba(150, 160, 180, .6));\n border-radius: 5px;\n}\n\n.rvs-diff-col::-webkit-scrollbar-thumb:hover {\n background: var(--dsw-alias-scrollbar-hover-l2, rgba(170, 180, 200, .85));\n}\n\n.rvs-diff-col::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.rvs-dline {\n display: flex;\n align-items: flex-start;\n height: 18px;\n line-height: 18px;\n white-space: pre;\n}\n\n.rvs-dline-num {\n /* Pinned while the line scrolls sideways, so a long line never takes the\n line numbers away with it. */\n position: sticky;\n left: 0;\n z-index: 1;\n flex: none;\n width: 3.4em;\n padding-right: 6px;\n text-align: right;\n color: var(--rvs-fg3);\n opacity: .85;\n user-select: none;\n background: var(--rvs-code-bg);\n}\n\n.rvs-row-del .rvs-dline-num {\n background: var(--rvs-del-solid);\n}\n\n.rvs-row-add .rvs-dline-num {\n background: var(--rvs-add-solid);\n}\n\n.rvs-dline-text {\n flex: 1;\n padding-right: 10px;\n user-select: text;\n}\n\n.rvs-gutter-col {\n flex: none;\n width: 30px;\n border-left: 1px solid var(--rvs-border);\n border-right: 1px solid var(--rvs-border);\n user-select: none;\n}\n\n.rvs-gutter-line {\n height: 18px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.rvs-diff-grid::-webkit-scrollbar {\n width: 9px;\n height: 0;\n}\n\n.rvs-diff-grid::-webkit-scrollbar-thumb {\n background: var(--dsw-alias-scrollbar-bg-l2, rgba(127, 127, 127, .4));\n border-radius: 4px;\n}\n\n.rvs-num {\n flex: none;\n display: inline-block;\n width: 3.2em;\n padding-right: 6px;\n text-align: right;\n color: var(--rvs-fg3);\n opacity: .6;\n user-select: none;\n}\n\n.rvs-row-del {\n background: var(--rvs-del-bg);\n}\n\n.rvs-row-del .rvs-dline-text,\n.rvs-row-del .rvs-dline-num,\n.rvs-row-del .rvs-num {\n color: #f14c4c;\n}\n\n.rvs-row-add {\n background: var(--rvs-add-bg);\n}\n\n.rvs-row-add .rvs-dline-text,\n.rvs-row-add .rvs-dline-num,\n.rvs-row-add .rvs-num {\n color: #4ec9b0;\n}\n\n.rvs-row-empty {\n color: var(--rvs-fg3);\n opacity: .35;\n}\n\n.rvs-gutter {\n flex: none;\n width: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-left: 1px solid var(--rvs-border);\n border-right: 1px solid var(--rvs-border);\n user-select: none;\n}\n\n.rvs-gutter-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n opacity: .7;\n}\n\n.rvs-hunk-btns {\n display: flex;\n gap: 2px;\n}\n\n.rvs-hunk-btn {\n width: 13px;\n height: 15px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n border-radius: 3px;\n background: transparent;\n color: var(--rvs-fg3);\n font-size: 11px;\n line-height: 1;\n cursor: pointer;\n}\n\n.rvs-hunk-btn:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-hunk-btn.stage:hover {\n color: var(--rvs-git-a);\n}\n\n.rvs-hunk-btn.revert:hover {\n color: var(--rvs-git-d);\n}\n\n/**\n * Token colors: VS Code Dark+ / Light+, matching the CodeMirror theme in\n * `vsc/editor-theme.ts`. Keeping ONE palette for both surfaces means a file\n * does not change colors when the diff is switched to its editable side.\n */\n.rvs-t-comment { color: #6a9955; }\n.rvs-t-string { color: #ce9178; }\n.rvs-t-keyword { color: #569cd6; }\n.rvs-t-number { color: #b5cea8; }\n.rvs-t-func { color: #dcdcaa; }\n.rvs-t-type { color: #4ec9b0; }\n.rvs-t-attr { color: #9cdcfe; }\n.rvs-t-variable { color: #9cdcfe; }\n.rvs-t-operator { color: #d4d4d4; }\n.rvs-t-punct { color: #d4d4d4; }\n.rvs-t-tag { color: #569cd6; }\n.rvs-t-meta { color: #c586c0; }\n.rvs-t-insert { color: #4ec9b0; }\n.rvs-t-delete { color: #f14c4c; }\n\nbody:not([data-ds-dark-theme]) .rvs-t-comment { color: #008000; }\nbody:not([data-ds-dark-theme]) .rvs-t-string { color: #a31515; }\nbody:not([data-ds-dark-theme]) .rvs-t-keyword { color: #0000ff; }\nbody:not([data-ds-dark-theme]) .rvs-t-number { color: #098658; }\nbody:not([data-ds-dark-theme]) .rvs-t-func { color: #795e26; }\nbody:not([data-ds-dark-theme]) .rvs-t-type { color: #267f99; }\nbody:not([data-ds-dark-theme]) .rvs-t-attr,\nbody:not([data-ds-dark-theme]) .rvs-t-variable { color: #001080; }\nbody:not([data-ds-dark-theme]) .rvs-t-operator,\nbody:not([data-ds-dark-theme]) .rvs-t-punct { color: #1f1f1f; }\nbody:not([data-ds-dark-theme]) .rvs-t-meta { color: #af00db; }\n\n/**\n * CodeMirror token colors, applied through FIXED class names emitted by the\n * highlight style (`vsc/editor-palette.ts`). Fixed names mean the colors come\n * from this stylesheet — the same one that paints the rest of the UI — so a\n * code file can never go monochrome because a generated class name changed or\n * an injected style failed. Same Dark+ / Light+ palette as the diff panes\n * above, so a file keeps its colors when switching between the two views.\n */\n.rvs-ck-comment { color: #6a9955; }\n.rvs-ck-keyword { color: #569cd6; }\n.rvs-ck-control { color: #c586c0; }\n.rvs-ck-string { color: #ce9178; }\n.rvs-ck-regexp { color: #d16969; }\n.rvs-ck-number { color: #b5cea8; }\n.rvs-ck-constant { color: #569cd6; }\n.rvs-ck-func { color: #dcdcaa; }\n.rvs-ck-type { color: #4ec9b0; }\n.rvs-ck-variable { color: #9cdcfe; }\n.rvs-ck-attr { color: #9cdcfe; }\n.rvs-ck-meta { color: #c586c0; }\n.rvs-ck-punct { color: #d4d4d4; }\n.rvs-ck-op { color: #d4d4d4; }\n.rvs-ck-heading { color: #569cd6; font-weight: 700; }\n.rvs-ck-em { font-style: italic; }\n.rvs-ck-link { color: #9cdcfe; text-decoration: underline; }\n.rvs-ck-strike { text-decoration: line-through; }\n.rvs-ck-invalid { color: #f44747; }\n\nbody:not([data-ds-dark-theme]) .rvs-ck-comment { color: #008000; }\nbody:not([data-ds-dark-theme]) .rvs-ck-keyword { color: #0000ff; }\nbody:not([data-ds-dark-theme]) .rvs-ck-control { color: #af00db; }\nbody:not([data-ds-dark-theme]) .rvs-ck-string { color: #a31515; }\nbody:not([data-ds-dark-theme]) .rvs-ck-regexp { color: #811f3f; }\nbody:not([data-ds-dark-theme]) .rvs-ck-number { color: #098658; }\nbody:not([data-ds-dark-theme]) .rvs-ck-constant { color: #0070c1; }\nbody:not([data-ds-dark-theme]) .rvs-ck-func { color: #795e26; }\nbody:not([data-ds-dark-theme]) .rvs-ck-type { color: #267f99; }\nbody:not([data-ds-dark-theme]) .rvs-ck-variable { color: #001080; }\nbody:not([data-ds-dark-theme]) .rvs-ck-attr { color: #e50000; }\nbody:not([data-ds-dark-theme]) .rvs-ck-meta { color: #0000ff; }\nbody:not([data-ds-dark-theme]) .rvs-ck-punct,\nbody:not([data-ds-dark-theme]) .rvs-ck-op { color: #1f1f1f; }\nbody:not([data-ds-dark-theme]) .rvs-ck-heading { color: #0000ff; }\nbody:not([data-ds-dark-theme]) .rvs-ck-link { color: #001080; }\nbody:not([data-ds-dark-theme]) .rvs-ck-invalid { color: #cd3131; }\n\n/**\n * Opaque editor surface, also as plain CSS: the CodeMirror theme paints it too\n * (following the scheme through a Compartment), but a transparent editor is\n * the one failure a user notices immediately, so the container states it as\n * well.\n */\n.rvs-edge .cm-editor,\n.rvs-edge .cm-scroller,\n.rvs-edge .cm-gutters {\n background-color: var(--rvs-code-bg);\n}\n\n.rvs-edge .cm-editor {\n color: var(--rvs-code-fg);\n}\n\n.rvs-edge .cm-gutters {\n color: var(--rvs-code-gutter-fg, var(--rvs-fg3));\n border-right: 1px solid var(--rvs-border);\n}\n\n.rvs-edge .cm-activeLine {\n background-color: rgba(127, 127, 127, .08);\n}\n\n.rvs-edge .cm-activeLineGutter {\n background-color: rgba(127, 127, 127, .12);\n}\n\n/**\n * The code editor's own scrollbars.\n *\n * These had NO rule at all: CodeMirror's scroller is `.cm-scroller`, which is\n * none of `.rvs-scroll` / `.rvs-diff-grid` / `.rvs-hbar`, so the editor fell\n * back to the browser default — too thin to hit with a mouse.\n *\n * Both notations are needed and must stay in step: Chromium honours\n * `scrollbar-width` over `::-webkit-scrollbar` when both apply, so setting\n * only the webkit half would silently have no effect. Keep the numbers equal.\n */\n.rvs-edge .cm-scroller {\n scrollbar-width: auto;\n}\n\n.rvs-edge .cm-scroller::-webkit-scrollbar {\n width: 14px;\n height: 14px;\n}\n\n.rvs-edge .cm-scroller::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.rvs-edge .cm-scroller::-webkit-scrollbar-thumb {\n /* Opaque, not a translucent token: a thin wash over code is exactly the\n low-contrast target that is hard to grab. */\n background: rgba(121, 121, 121, .8);\n border: 3px solid transparent;\n border-radius: 7px;\n background-clip: padding-box;\n min-height: 36px;\n}\n\n.rvs-edge .cm-scroller::-webkit-scrollbar-thumb:hover {\n background: rgba(150, 150, 150, .95);\n border: 3px solid transparent;\n background-clip: padding-box;\n}\n\n.rvs-edge .cm-scroller::-webkit-scrollbar-corner {\n background: transparent;\n}\n\n/* ------------------------------------------------------------ find widget */\n\n/**\n * \"You landed here\": the transient highlight on the line a jump landed on\n * (search hit, @-reference).\n *\n * Deliberately NOT a warm/amber wash: over the dark editor that muddies into a\n * brown-black band that reads as a shadow and swallows annotation colors. This\n * is the accent blue instead — a tinted band with a bright edge on the left and\n * hairlines top/bottom, so it reads as a marked region while every token keeps\n * its own colour and contrast.\n */\n.rvs-reveal-line {\n background-color: rgba(88, 166, 255, .22);\n box-shadow:\n inset 3px 0 0 0 #58a6ff,\n inset 0 1px 0 0 rgba(88, 166, 255, .38),\n inset 0 -1px 0 0 rgba(88, 166, 255, .38);\n}\n\nbody:not([data-ds-dark-theme]) .rvs-reveal-line {\n background-color: rgba(77, 107, 254, .14);\n box-shadow:\n inset 3px 0 0 0 #4d6bfe,\n inset 0 1px 0 0 rgba(77, 107, 254, .35),\n inset 0 -1px 0 0 rgba(77, 107, 254, .35);\n}\n\n/* --------------------------------------------------------- session changes */\n\n/**\n * 「本会话改了什么」:代码行背景 + 左侧改动栏(Cursor 风格)。\n *\n * 三种形态必须**一眼分得开**,光靠绿/红两个色相不够(色弱用户看新增行和删除行\n * 会糊成同一片),所以每种的左侧色条宽度/花样的语义也不同:\n * - 新增:实心绿条;\n * - 修改:实心蓝条(不是绿:修改块里既有留下的行也有新写的行,用\"中性的已变更\"\n * 色不会误导读者以为整块都是新内容);\n * - 删除:**斜纹**红底 + 更粗的红条 —— 这一行其实已经不存在了,只在中止位置上\n * 留个锚点,斜纹是这一层\"虚\"的信息里最不容易被当成真内容的花样。\n *\n * 选择器带上 `.cm-line`:`.cm-activeLine` 由 CodeMirror 的主题注入(运行时\n * `<style>`,通常排在本文档之后),只写 `.rvs-change-*` 两者同权重时会输给它,\n * 光标所在的那一行改动就会消失。\n */\n.rvs-edge .cm-line.rvs-change-add {\n background-color: rgba(46, 160, 67, .17);\n box-shadow:\n inset 3px 0 0 0 #2ea043,\n inset 0 -1px 0 0 rgba(46, 160, 67, .28);\n}\n\n.rvs-edge .cm-line.rvs-change-mod {\n background-color: rgba(56, 139, 253, .15);\n box-shadow:\n inset 3px 0 0 0 #388bfd,\n inset 0 -1px 0 0 rgba(56, 139, 253, .28);\n}\n\n.rvs-edge .cm-line.rvs-change-del {\n background-color: rgba(248, 81, 73, .09);\n background-image: repeating-linear-gradient(135deg, rgba(248, 81, 73, .17) 0 6px, transparent 6px 12px);\n box-shadow: inset 4px 0 0 0 #f85149;\n}\n\n/* 改动栏本身:符号 + 一列与行背景同色的窄条,读起来才是一条\"改动边\"。 */\n.rvs-edge .cm-gutterElement.rvs-change-gutter-add {\n box-shadow: inset 2px 0 0 0 #2ea043;\n}\n\n.rvs-edge .cm-gutterElement.rvs-change-gutter-mod {\n box-shadow: inset 2px 0 0 0 #388bfd;\n}\n\n.rvs-edge .cm-gutterElement.rvs-change-gutter-del {\n box-shadow: inset 2px 0 0 0 #f85149;\n}\n\n.rvs-edge .rvs-change-mark {\n display: inline-block;\n width: 12px;\n font-family: var(--rvs-mono);\n font-size: 12px;\n line-height: 1;\n text-align: center;\n user-select: none;\n}\n\n.rvs-edge .rvs-change-mark-add { color: #2ea043; }\n.rvs-edge .rvs-change-mark-mod { color: #388bfd; }\n.rvs-edge .rvs-change-mark-del { color: #f85149; }\n\n/**\n * 行内(字符级)差异:上面那三种底色回答\"哪几行变了\",这两条回答\"那一行的哪几个\n * 字变了\"。只改一个词的编辑,整行同色时完全看不出改了什么。\n *\n * `rvs-change-word-add` 刻意**只给背景、不给 `color`**:代码有自己的语法着色,\n * 覆盖前景色会把关键字/字符串/注释染成同一种颜色,比不标还难读。透明度压在行\n * 底色之上一点点,叠起来仍读得出\"整块改动\"的边界,又能看出块内哪几个字是新的。\n */\n.rvs-edge .rvs-change-word-add {\n background-color: rgba(46, 160, 67, .22);\n border-radius: 2px;\n}\n\n/**\n * 被删掉、在新文件里已经不存在的内容:零宽 widget,红底 + 删除线。\n *\n * 删除线画在 chip 自己身上(chip 是独立元素,不会波及周围代码);`white-space:\n * pre` 保留被删文本自己的缩进 —— 截断/去空白都会让 chip 谎报\"删了什么\"。\n * 字号略小 + 降一点不透明度,是让它读起来像\"残留物\"而不是一行真代码。\n */\n.rvs-edge .rvs-change-word-del {\n padding: 0 3px;\n margin: 0 1px;\n border-radius: 3px;\n background-color: rgba(248, 81, 73, .18);\n font-size: .92em;\n text-decoration: line-through;\n opacity: .85;\n white-space: pre;\n}\n\n/**\n * 撑宽度的隐形符号:只用它占位,绝不显示(见 `change-marks.ts` 的 SpacerMarker,\n * CodeMirror 会给这个 spacer 元素加 `visibility: hidden`,这里不重复声明)。\n */\n.rvs-edge .rvs-change-spacer {\n opacity: 0;\n}\n\n/* 浅色主题:同样的色相,压暗 + 提高不透明度,在近白底上才看得清。 */\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-line.rvs-change-add {\n background-color: rgba(31, 136, 61, .13);\n box-shadow:\n inset 3px 0 0 0 #1f883d,\n inset 0 -1px 0 0 rgba(31, 136, 61, .22);\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-line.rvs-change-mod {\n background-color: rgba(9, 105, 218, .12);\n box-shadow:\n inset 3px 0 0 0 #0969da,\n inset 0 -1px 0 0 rgba(9, 105, 218, .22);\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-line.rvs-change-del {\n background-color: rgba(207, 34, 46, .07);\n background-image: repeating-linear-gradient(135deg, rgba(207, 34, 46, .14) 0 6px, transparent 6px 12px);\n box-shadow: inset 4px 0 0 0 #cf222e;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-gutterElement.rvs-change-gutter-add {\n box-shadow: inset 2px 0 0 0 #1f883d;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-gutterElement.rvs-change-gutter-mod {\n box-shadow: inset 2px 0 0 0 #0969da;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-gutterElement.rvs-change-gutter-del {\n box-shadow: inset 2px 0 0 0 #cf222e;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-mark-add { color: #1f883d; }\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-mark-mod { color: #0969da; }\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-mark-del { color: #cf222e; }\n\n/* 浅色主题的行内差异:同样的色相压暗,在近白底上才看得清(暗色那套会糊成一片)。 */\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-word-add {\n background-color: rgba(26, 127, 55, .18);\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-word-del {\n background-color: rgba(207, 34, 46, .14);\n}\n\n/**\n * 整块删除:一枚带行数的胶囊,不是一行划掉的文字。\n *\n * 多行删除的原文是一个段落,划线堆在锚点行首只会糊成一片(数据层因此把 `count > 1`\n * 的 chip 压成一枚,见 `change-marks.ts` 的 `RemovedChipWidget`)。这里只做外形:\n * 去掉继承来的删除线(胶囊不是\"被划掉的字符串\"),字号与计数对齐,别把行高撑开。\n */\n.rvs-edge .rvs-change-block-del {\n padding: 0 4px;\n margin: 0 1px;\n border-radius: 3px;\n background-color: rgba(248, 81, 73, .18);\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n text-decoration: none;\n opacity: 1;\n white-space: nowrap;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-block-del {\n background-color: rgba(207, 34, 46, .14);\n}\n\n/**\n * 改动跳转按钮:浮在编辑器右上角。\n *\n * 放在编辑器上而不是面板里 —— 文件打开后光标就在这里,而面板可能被收起、被滚走。\n * 容器 `.rvs-body` 已经是 `position: relative`(它本来用于挂 find 浮层),所以这里\n * 只做绝对定位,不引入新的定位上下文。`pointer-events` 只开在按钮上:这块区域压在\n * 编辑器文字上方,整块可点会把右上角那几行变成死区。\n */\n.rvs-change-nav {\n position: absolute;\n top: 8px;\n right: 14px;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 3px 4px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n background: Canvas;\n box-shadow: 0 2px 8px rgba(0, 0, 0, .28);\n pointer-events: none;\n}\n\n/* The counter is what makes this read as \"3 of 7 changes\" rather than two\n anonymous arrows — and it keeps the buttons from looking like decoration. */\n.rvs-change-nav-count {\n padding: 0 6px 0 4px;\n color: var(--rvs-fg2);\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n line-height: 22px;\n white-space: nowrap;\n}\n\n.rvs-change-nav-btn {\n width: 26px;\n height: 22px;\n padding: 0;\n border: 1px solid transparent;\n border-radius: 5px;\n background: transparent;\n color: var(--rvs-fg);\n font-size: 13px;\n font-weight: 600;\n line-height: 20px;\n text-align: center;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.rvs-change-nav-btn:hover {\n border-color: var(--rvs-border2);\n background: var(--rvs-hover);\n color: var(--rvs-brand);\n}\n\n.rvs-change-nav-btn:active { background: var(--rvs-active); }\n\n/**\n * 悬浮在改动行上出现的「撤销这处改动」按钮。\n *\n * 它**不在编辑器的 DOM 里**:`undo-affordance.ts` 把它当 `position: fixed` 的元素挂到\n * `document.body`(和「添加到对话」那个浮层同一套做法),所以这里的选择器不带\n * `.rvs-edge` —— 带上了就一条都不生效。固定定位 + 高 z-index 是刻意的:宿主容器有\n * `overflow: hidden`,挂在里面会被 CodeMirror 的滚动层裁掉。\n *\n * 颜色按\"危险动作\"给:默认红边红字、悬停实心红。底色不透明(不用半透明的 overlay\n * token),否则后面的代码文字会透出来。\n */\n.rvs-undo-affordance {\n position: fixed;\n z-index: 2100;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n max-width: 220px;\n padding: 3px 9px;\n border: 1px solid #f85149;\n border-radius: 6px;\n background-color: #1e2229;\n color: #ffb4ae;\n /* 按钮挂在 body 上,没有 .rvs-edge 的字体上下文:跟随宿主页面字体。 */\n font-family: inherit;\n font-size: 12px;\n line-height: 1.5;\n white-space: nowrap;\n cursor: pointer;\n box-shadow: 0 6px 18px rgba(0, 0, 0, .45);\n /* 纵向以悬停行的中线对齐(横向坐标由 JS 按行尾算好)。 */\n transform: translateY(-50%);\n}\n\n.rvs-undo-affordance:hover {\n background-color: #f85149;\n border-color: #f85149;\n color: #fff;\n}\n\n.rvs-undo-affordance:active {\n transform: translateY(-50%) scale(.97);\n}\n\n.rvs-undo-affordance:focus-visible {\n outline: 2px solid #58a6ff;\n outline-offset: 1px;\n}\n\n/* 删除锚点:这一行其实已经不在了,虚线边框把它和\"真实存在的行\"分开。 */\n.rvs-undo-affordance[data-kind=\"del\"] {\n border-style: dashed;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-undo-affordance {\n border-color: #cf222e;\n background-color: #ffffff;\n color: #a40e26;\n box-shadow: 0 6px 18px rgba(31, 35, 40, .18);\n}\n\nbody:not([data-ds-dark-theme]) .rvs-undo-affordance:hover {\n background-color: #cf222e;\n border-color: #cf222e;\n color: #fff;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-undo-affordance:focus-visible {\n outline-color: #4d6bfe;\n}\n\n/**\n * CodeMirror's own search decorations, also stated here: the editor's theme is\n * injected by the library, and these must stay readable even when only this\n * stylesheet is in play.\n */\n.rvs-edge .cm-searchMatch {\n background-color: rgba(226, 183, 20, .30);\n outline: 1px solid rgba(226, 183, 20, .55);\n}\n\n.rvs-edge .cm-searchMatch-selected {\n background-color: rgba(226, 183, 20, .48);\n}\n\n.rvs-edge .cm-selectionBackground,\n.rvs-edge .cm-content ::selection {\n background-color: rgba(58, 110, 165, .55) !important;\n}\n\n/** Build stamp in the editor info bar: identifies the loaded client bundle. */\n.rvs-build {\n flex: none;\n padding: 0 5px;\n border: 1px solid var(--rvs-border);\n border-radius: 4px;\n color: var(--rvs-fg3);\n font-size: 10px;\n font-family: var(--rvs-mono);\n opacity: .85;\n user-select: text;\n}\n\n.rvs-find {\n position: absolute;\n top: 6px;\n right: 18px;\n z-index: 30;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 3px 4px 3px 7px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n background-color: Canvas;\n background-image: linear-gradient(var(--dsw-alias-bg-overlay, transparent), var(--dsw-alias-bg-overlay, transparent));\n color: var(--rvs-fg);\n box-shadow: 0 4px 14px rgba(0, 0, 0, .28);\n font-size: 12px;\n}\n\n.rvs-find-input {\n width: 170px;\n padding: 2px 6px;\n border: 1px solid var(--rvs-border2);\n border-radius: 5px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12px;\n outline: none;\n}\n\n.rvs-find-input:focus {\n border-color: var(--rvs-brand);\n}\n\n.rvs-find-count {\n flex: none;\n min-width: 54px;\n text-align: center;\n color: var(--rvs-fg3);\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-find-count.none {\n color: var(--rvs-git-d);\n}\n\n.rvs-code {\n flex: 1;\n min-height: 0;\n overflow: auto;\n margin: 0;\n padding: 6px 0 16px;\n font-family: var(--rvs-mono);\n font-size: 12.5px;\n line-height: 18px;\n white-space: pre;\n scrollbar-width: thin;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n}\n\n.rvs-code-line {\n display: flex;\n align-items: flex-start;\n min-width: max-content;\n}\n\n.rvs-code-line:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-code-text {\n flex: 1;\n padding-right: 10px;\n white-space: pre-wrap;\n word-break: break-word;\n user-select: text;\n}\n\n/* ---------------------------------------------------------- history list */\n\n.rvs-commit-item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 4px 8px 4px 4px;\n border: none;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12.5px;\n line-height: 18px;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-commit-item:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-commit-item.selected {\n background: var(--rvs-active);\n}\n\n.rvs-graph-svg {\n flex: none;\n display: block;\n}\n\n.rvs-commit-hash {\n flex: none;\n font-family: var(--rvs-mono);\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-commit-msg {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-commit-date {\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-ref-badge {\n flex: none;\n padding: 0 5px;\n border-radius: 8px;\n border: 1px solid var(--rvs-border2);\n font-size: 10px;\n line-height: 15px;\n color: var(--rvs-fg2);\n}\n\n.rvs-ref-badge.head {\n border-color: var(--rvs-brand);\n background: rgba(77, 107, 254, .2);\n color: var(--rvs-fg);\n}\n\n.rvs-ref-badge.tag {\n border-color: rgba(226, 183, 20, .55);\n background: rgba(226, 183, 20, .16);\n color: var(--rvs-git-m);\n}\n\n.rvs-detail {\n margin: 0 6px 8px;\n padding: 8px 10px;\n border: 1px solid var(--rvs-border2);\n border-left: 3px solid var(--rvs-accent);\n border-radius: 8px;\n background: var(--rvs-layer3);\n font-size: 12px;\n}\n\n.rvs-detail-meta {\n color: var(--rvs-fg3);\n font-size: 11px;\n margin-bottom: 6px;\n white-space: pre-wrap;\n}\n\n.rvs-file-row {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 4px;\n border-radius: 5px;\n cursor: pointer;\n}\n\n.rvs-file-row:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-file-path {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n /* Same tail-first truncation as the info bar; `plaintext` keeps the path's\n own LTR order (see .rvs-einfo-path). */\n direction: rtl;\n unicode-bidi: plaintext;\n text-align: left;\n}\n\n.rvs-file-status {\n flex: none;\n width: 16px;\n text-align: center;\n font-weight: 700;\n font-size: 11px;\n}\n\n/* ------------------------------------------------------- commit pane */\n\n/**\n * The history panel's bottom half: the graph keeps the top, the selected\n * commit takes this pane below the drag handle (same gesture and styling as\n * the editor split, so `.rvs-vsplit-handle` is reused rather than copied).\n */\n.rvs-history-body {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.rvs-hpane {\n flex: none;\n min-height: 140px;\n max-height: 82%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border-top: 1px solid var(--rvs-border);\n /* Same glass as the graph above (the sidebar's own backdrop shows through):\n an opaque `.rvs-code-bg` here read as a separate dark slab glued under the\n list. Patch rows already carry their own translucent add/del washes, so the\n diff stays legible without a filled background. */\n background: transparent;\n}\n\n/* Full-height mode: the graph is hidden by the panel, so the pane takes the\n remaining column instead of its persisted pixel height. */\n.rvs-hpane.expanded {\n flex: 1;\n max-height: none;\n}\n\n/* A toolbar toggle that is currently ON (wrap, for example). */\n.rvs-hbtn.active {\n color: var(--rvs-brand);\n}\n\n.rvs-hpane-body {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n/* Tab strip: same underline idiom as the editor's diff/worktree switch, but\n scoped so the pane's three views cannot be confused with editor tabs. */\n.rvs-htabs {\n flex: none;\n display: flex;\n align-items: center;\n gap: 2px;\n height: 30px;\n padding: 0 6px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n/* The tabs themselves live in their own role=tablist element: the strip also\n carries the hash, expand and close buttons, and those must NOT inherit the\n tablist's arrow-key handling (ArrowRight on \"close\" used to switch tabs). */\n.rvs-hpane-tablist {\n flex: none;\n display: flex;\n align-items: center;\n gap: 2px;\n}\n\n.rvs-htab {\n appearance: none;\n border: none;\n border-bottom: 2px solid transparent;\n background: transparent;\n color: var(--rvs-fg3);\n font: inherit;\n font-size: 12px;\n padding: 5px 8px 4px;\n cursor: pointer;\n}\n\n.rvs-htab:hover {\n color: var(--rvs-fg);\n}\n\n.rvs-htab.active {\n color: var(--rvs-fg);\n border-bottom-color: var(--rvs-brand);\n}\n\n.rvs-htabs-spacer {\n flex: 1;\n min-width: 0;\n}\n\n.rvs-hhash-mini {\n flex: none;\n margin-right: 2px;\n font-family: var(--rvs-mono);\n font-size: 10.5px;\n color: var(--rvs-fg3);\n}\n\n/**\n * Every tab body stays mounted (the patch's scroll position and parse survive\n * a look at 提交详情) and is hidden with the `hidden` attribute. The class\n * declares `flex`, which outranks the UA `[hidden]` rule, so hiding needs an\n * explicit rule of its own.\n */\n.rvs-hbody {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 10px 12px 14px;\n}\n\n.rvs-hbody[hidden] {\n display: none;\n}\n\n/* -- 提交详情 -- */\n\n.rvs-hsubject {\n font-size: 13px;\n font-weight: 600;\n line-height: 1.45;\n margin-bottom: 8px;\n white-space: pre-wrap;\n word-break: break-word;\n user-select: text;\n}\n\n.rvs-hmeta {\n display: flex;\n align-items: center;\n gap: 6px;\n min-height: 21px;\n font-size: 11.5px;\n color: var(--rvs-fg3);\n}\n\n.rvs-hmeta-icon {\n flex: none;\n display: flex;\n width: 13px;\n align-items: center;\n color: var(--rvs-fg3);\n}\n\n.rvs-hmeta-value {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-hmeta-label {\n flex: none;\n}\n\n.rvs-hhash {\n font-family: var(--rvs-mono);\n font-size: 11px;\n line-height: 16px;\n padding: 0 5px;\n border: 1px solid var(--rvs-border);\n border-radius: 4px;\n background: var(--rvs-input);\n color: var(--rvs-fg2);\n user-select: all;\n}\n\n.rvs-hparent {\n font-family: var(--rvs-mono);\n font-size: 11px;\n line-height: 16px;\n padding: 0 4px;\n border: 1px solid var(--rvs-border2);\n border-radius: 4px;\n color: var(--rvs-fg2);\n}\n\n.rvs-hdash {\n color: var(--rvs-fg3);\n}\n\n.rvs-hrefs {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n margin-top: 6px;\n}\n\n.rvs-hmsg {\n margin-top: 10px;\n padding-top: 8px;\n border-top: 1px dashed var(--rvs-border);\n font-size: 12px;\n line-height: 1.55;\n color: var(--rvs-fg2);\n white-space: pre-wrap;\n word-break: break-word;\n user-select: text;\n}\n\n.rvs-hfooter {\n display: flex;\n gap: 6px;\n margin-top: 14px;\n}\n\n/* -- 内容 -- */\n\n.rvs-hhint {\n margin-bottom: 6px;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n/* One line: how many files, and the path filter that makes a 60-file commit\n narrowable without scrolling. */\n.rvs-hcontent-head {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 6px;\n}\n\n.rvs-hcount {\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-hfilter {\n flex: 1;\n min-width: 0;\n}\n\n.rvs-hfiles {\n display: flex;\n flex-direction: column;\n gap: 1px;\n}\n\n/* Directory row of the 内容 tree: chevron + folder glyph + path + count. */\n.rvs-hfolder {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 4px;\n border-radius: 4px;\n color: var(--rvs-fg2);\n font-size: 12px;\n cursor: pointer;\n user-select: none;\n}\n\n.rvs-hfolder:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-hfolder-name {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: var(--rvs-mono);\n font-size: 11.5px;\n}\n\n.rvs-hfolder-count {\n flex: none;\n font-size: 10.5px;\n color: var(--rvs-fg3);\n}\n\n/* Files under a folder keep the editor tree's indent idiom. */\n.rvs-file-row.indent {\n padding-left: 18px;\n}\n\n.rvs-file-row.active {\n background: var(--rvs-active);\n}\n\n/* The row's quick \"open in editor\" affordance: invisible until the row is\n hovered/focused, so the path keeps the whole width at rest. */\n.rvs-file-open {\n opacity: 0;\n}\n\n.rvs-file-row:hover .rvs-file-open,\n.rvs-file-row:focus-within .rvs-file-open,\n.rvs-file-row:focus .rvs-file-open {\n opacity: 1;\n}\n\n/* Keyboard focus must be visible on the pane's role=button rows (a bare\n browser default is nearly invisible on this dark chrome). */\n.rvs-file-row:focus-visible,\n.rvs-hfolder:focus-visible,\n.rvs-commit-item:focus-visible,\n.rvs-patch-chevron:focus-visible,\n.rvs-vsplit-handle:focus-visible {\n outline: 2px solid var(--rvs-brand);\n outline-offset: -2px;\n}\n\n/* -- 差异 -- */\n\n/**\n * The diff tab is a column: a PINNED tool row, then the one scroller. The\n * reference pane made the whole tab a scroll area, so the file you were in and\n * the controls both disappeared on a long patch.\n */\n.rvs-hdiff {\n display: flex;\n flex-direction: column;\n padding: 0;\n overflow: hidden;\n}\n\n.rvs-hdiff[hidden] {\n display: none;\n}\n\n.rvs-ptoolbar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 3px;\n height: 30px;\n padding: 0 6px;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-layer3);\n}\n\n.rvs-pfile-index {\n flex: none;\n min-width: 32px;\n font-family: var(--rvs-mono);\n font-size: 10.5px;\n color: var(--rvs-fg3);\n}\n\n.rvs-pfile-name {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 11.5px;\n color: var(--rvs-fg2);\n}\n\n.rvs-pscroll {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 10px 12px 14px;\n}\n\n.rvs-patch-file {\n margin-bottom: 10px;\n border: 1px solid var(--rvs-border);\n border-radius: 6px;\n}\n\n.rvs-patch-file.folded .rvs-patch-head {\n border-bottom: none;\n border-radius: 6px;\n}\n\n.rvs-patch-file.active {\n border-color: var(--rvs-brand);\n}\n\n/* Sticky per-file header: scrolling a 3000-line hunk keeps saying which file\n it belongs to. `position: sticky` needs the nearest scrollport, which is\n `.rvs-pscroll` — no `overflow` on the section itself. */\n.rvs-patch-head {\n position: sticky;\n top: 0;\n z-index: 1;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 3px 6px;\n border-bottom: 1px solid var(--rvs-border);\n border-radius: 6px 6px 0 0;\n background: var(--rvs-layer3);\n cursor: pointer;\n}\n\n.rvs-patch-head:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-patch-chevron {\n flex: none;\n display: flex;\n align-items: center;\n color: var(--rvs-fg3);\n cursor: pointer;\n transform: rotate(0deg);\n}\n\n.rvs-patch-chevron.open {\n transform: rotate(90deg);\n}\n\n.rvs-patch-path {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n}\n\n.rvs-patch-letter {\n flex: none;\n font-size: 11px;\n font-weight: 700;\n}\n\n.rvs-patch-counts {\n flex: none;\n display: flex;\n gap: 5px;\n font-family: var(--rvs-mono);\n font-size: 10.5px;\n}\n\n.rvs-patch-add-count {\n color: var(--rvs-git-a);\n}\n\n.rvs-patch-del-count {\n color: var(--rvs-git-d);\n}\n\n.rvs-patch-rows {\n padding: 2px 0 6px;\n font-family: var(--rvs-mono);\n font-size: 11.5px;\n line-height: 17px;\n}\n\n.rvs-patch-row {\n display: flex;\n align-items: stretch;\n min-width: max-content;\n white-space: pre;\n}\n\n/* Wrap mode: the row gives up its horizontal runway and the text wraps under\n the gutter instead (the whole point on a narrow sidebar). */\n.rvs-patch-rows.wrap .rvs-patch-row {\n min-width: 0;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.rvs-patch-rows.wrap .rvs-patch-text {\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n/* A block whose raw patch text could not be paired with the parsed model\n (defensive: block count and model count disagreed) is dimmed instead of\n silently looking complete. */\n.rvs-patch-rows.partial {\n opacity: .62;\n}\n\n/* Truncation marker in the pinned toolbar: the cut point can be thousands of\n rows away, so the bottom note is not where a reader learns about it. */\n.rvs-ptruncated {\n flex: none;\n font-size: 12px;\n color: var(--rvs-git-m);\n}\n\n.rvs-patch-row.add {\n background: var(--rvs-add-bg);\n}\n\n.rvs-patch-row.del {\n background: var(--rvs-del-bg);\n}\n\n.rvs-patch-num {\n flex: none;\n width: 42px;\n padding-right: 6px;\n text-align: right;\n color: var(--rvs-fg3);\n user-select: none;\n}\n\n.rvs-patch-sign {\n flex: none;\n width: 14px;\n text-align: center;\n color: var(--rvs-fg3);\n user-select: none;\n}\n\n.rvs-patch-text {\n flex: 1;\n padding-right: 12px;\n user-select: text;\n}\n\n/* One \"the hunk jumped ahead\" marker, so a patch never pretends its line\n numbers are contiguous. */\n.rvs-patch-skip {\n margin: 2px 0;\n border-top: 1px dashed var(--rvs-border);\n border-bottom: 1px dashed var(--rvs-border);\n color: var(--rvs-fg3);\n font-size: 11px;\n text-align: center;\n user-select: none;\n}\n\n.rvs-patch-note {\n padding: 6px 8px;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n/* ---------------------------------------------------- floating editor window */\n\n/**\n * The floating editor lives in the host's frame-wide overlay layer\n * (`position: absolute; inset: 0; z-index: 20`, click-through, children opt\n * back into pointer events). It is placed with viewport coordinates, so it\n * floats above every column without joining any of their stacking contexts.\n *\n * `.rvs-root` carries the whole design-system token set and is row-flex by\n * default; this frame overrides the direction to a column and takes its size\n * from the inline rect the component keeps.\n */\n.rvs-float-window {\n position: fixed;\n flex-direction: column;\n /* The rect maths (clamp/persist) is in border-box terms; without this the\n painted border would sit one pixel outside the computed rectangle. */\n box-sizing: border-box;\n min-width: 360px;\n min-height: 220px;\n overflow: hidden;\n border: 1px solid var(--rvs-border2);\n border-radius: 10px;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n box-shadow: 0 18px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .28);\n z-index: 30;\n /* The overlay layer itself is click-through; the window opts back in even if\n the host wraps each overlay entry in its own element. */\n pointer-events: auto;\n}\n\n/* Minimized: the frame IS the ball (see `.rvs-float-mini`); the body stays\n mounted but hidden, and it must not impose a minimum height. */\n.rvs-float-window[data-rvs-float=\"collapsed\"] {\n min-height: 0;\n}\n\n/**\n * Minimized window = floating ball.\n *\n * A full-width 34px bar was too long: it read as a broken window and covered a\n * whole strip. The ball is a small circle at the window's own corner, draggable\n * anywhere, restored by a click (or Enter/Space). It keeps the dirty dot, so\n * \"the editor is out and has unsaved edits\" is still one glance away.\n */\n.rvs-float-window.rvs-float-mini {\n min-width: 0;\n min-height: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n cursor: move;\n touch-action: none;\n}\n\n.rvs-float-ball {\n flex: 1;\n /* Stretch to the circle: the frame is a COLUMN flex box with centred items,\n so without this the hit area (and the absolutely positioned dot) would be\n sized by the 16px glyph instead of the 44px ball. */\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n border-radius: 50%;\n color: var(--rvs-brand);\n font-size: 16px;\n line-height: 1;\n cursor: move;\n outline: none;\n}\n\n.rvs-float-ball:hover,\n.rvs-float-ball:focus-visible {\n background: var(--rvs-hover);\n}\n\n.rvs-float-ball-glyph {\n pointer-events: none;\n}\n\n/* Unsaved edits stay visible while minimized. */\n.rvs-float-ball-dot {\n position: absolute;\n top: 8px;\n right: 8px;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--rvs-git-m);\n box-shadow: 0 0 0 2px var(--rvs-code-bg);\n pointer-events: none;\n}\n\n/* While a drag/resize gesture runs the pointer must not select editor text. */\n.rvs-float-window.dragging {\n user-select: none;\n}\n\n.rvs-float-titlebar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 7px;\n height: 34px;\n padding: 0 6px 0 10px;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-layer3);\n cursor: move;\n user-select: none;\n touch-action: none;\n}\n\n.rvs-float-glyph {\n color: var(--rvs-brand);\n font-size: 11px;\n}\n\n.rvs-float-title {\n flex: none;\n font-size: 12px;\n font-weight: 600;\n color: var(--rvs-fg2);\n}\n\n.rvs-float-file {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 11.5px;\n color: var(--rvs-fg3);\n direction: rtl;\n unicode-bidi: plaintext;\n text-align: left;\n}\n\n.rvs-float-spacer {\n flex: 1;\n}\n\n.rvs-float-btn {\n flex: none;\n width: 22px;\n height: 22px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n border-radius: 5px;\n background: transparent;\n color: var(--rvs-fg3);\n font: inherit;\n font-size: 12px;\n line-height: 1;\n cursor: pointer;\n}\n\n.rvs-float-btn:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-float-close:hover {\n background: rgba(241, 76, 76, .18);\n color: var(--rvs-danger);\n}\n\n.rvs-float-body {\n flex: 1 1 0;\n min-height: 0;\n min-width: 0;\n display: flex;\n overflow: hidden;\n background: var(--rvs-code-bg);\n}\n\n/* Keep the height chain pinned: the editor pane grows inside this box. */\n.rvs-float-body > .rvs-pane {\n flex: 1 1 0;\n min-height: 0;\n min-width: 0;\n}\n\n/* Eight grips, placed INSIDE the border box: the window clips overflow (rounded\n corners), so grips hanging outside would lose half their hit area. Corners\n are larger so they can actually be hit. */\n.rvs-float-resize {\n position: absolute;\n z-index: 3;\n}\n\n.rvs-float-resize-n { top: 0; left: 10px; right: 10px; height: 6px; cursor: ns-resize; }\n.rvs-float-resize-s { bottom: 0; left: 10px; right: 10px; height: 6px; cursor: ns-resize; }\n.rvs-float-resize-e { top: 10px; bottom: 10px; right: 0; width: 6px; cursor: ew-resize; }\n.rvs-float-resize-w { top: 10px; bottom: 10px; left: 0; width: 6px; cursor: ew-resize; }\n.rvs-float-resize-ne { top: 0; right: 0; width: 12px; height: 12px; cursor: nesw-resize; }\n.rvs-float-resize-nw { top: 0; left: 0; width: 12px; height: 12px; cursor: nwse-resize; }\n.rvs-float-resize-se { bottom: 0; right: 0; width: 12px; height: 12px; cursor: nwse-resize; }\n.rvs-float-resize-sw { bottom: 0; left: 0; width: 12px; height: 12px; cursor: nesw-resize; }\n\n/* Shown by whichever surface the single editor left behind (centre tab or the\n sidebar's editor panel). */\n.rvs-float-placeholder {\n flex: 1;\n min-height: 0;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 10px;\n padding: 24px;\n text-align: center;\n color: var(--rvs-fg3);\n font-size: 12.5px;\n}\n\n.rvs-float-placeholder-title {\n color: var(--rvs-fg2);\n font-size: 13px;\n font-weight: 600;\n}\n\n.rvs-float-placeholder-text {\n max-width: 360px;\n line-height: 1.6;\n}\n\n/* --------------------------------------------------------- context menu */\n\n.rvs-portal {\n font-family: inherit;\n}\n\n/**\n * Floating surfaces (menu / modal / toast) paint an OPAQUE base first and then\n * lay the skin's overlay token on top. The token is frequently translucent, so\n * using it alone let the panel's own text bleed through the menu and overlap\n * the entries; `Canvas` follows the resolved light/dark scheme, so the base is\n * correct in either theme.\n */\n.rvs-menu,\n.rvs-modal-box,\n.rvs-toast {\n background-color: Canvas;\n background-image: linear-gradient(var(--dsw-alias-bg-overlay, transparent), var(--dsw-alias-bg-overlay, transparent));\n color: var(--rvs-fg);\n}\n\n.rvs-menu {\n position: fixed;\n z-index: 1000;\n min-width: 172px;\n max-height: calc(100vh - 16px);\n overflow-y: auto;\n padding: 4px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n box-shadow: 0 6px 20px rgba(0, 0, 0, .35);\n font-size: 12.5px;\n line-height: 18px;\n}\n\n.rvs-menu-sep {\n height: 1px;\n margin: 4px 6px;\n background: var(--rvs-border);\n}\n\n.rvs-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 5px 10px;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-menu-item:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-menu-item.danger {\n color: var(--vsc-danger, #f14c4c);\n}\n\n.rvs-menu-item.danger:hover {\n background: rgba(241, 76, 76, .16);\n}\n\n.rvs-menu-item:disabled {\n opacity: .45;\n cursor: default;\n}\n\n.rvs-menu-item:disabled:hover {\n background: transparent;\n}\n\n.rvs-menu-hint {\n margin-left: auto;\n font-size: 11px;\n opacity: .6;\n}\n\n/* ------------------------------------------------------- modal + toast */\n\n.rvs-modal-mask {\n position: fixed;\n inset: 0;\n z-index: 100000;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, .45);\n backdrop-filter: blur(2px);\n animation: rvsFade .12s ease;\n}\n\n.rvs-modal-box {\n width: min(420px, calc(100vw - 40px));\n padding: 16px 18px;\n border: 1px solid var(--rvs-border2);\n border-radius: 10px;\n color: var(--rvs-fg);\n box-shadow: 0 12px 40px rgba(0, 0, 0, .38);\n font-size: 13px;\n animation: rvsPop .14s ease;\n}\n\n.rvs-modal-title {\n margin-bottom: 8px;\n font-size: 14px;\n font-weight: 600;\n}\n\n.rvs-modal-text {\n margin-bottom: 12px;\n color: var(--rvs-fg2);\n font-size: 12.5px;\n line-height: 1.6;\n word-break: break-word;\n white-space: pre-wrap;\n}\n\n.rvs-modal-row {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 14px;\n}\n\n.rvs-modal-btn {\n padding: 5px 14px;\n border: 1px solid var(--rvs-border2);\n border-radius: 7px;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12.5px;\n cursor: pointer;\n}\n\n.rvs-modal-btn:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-modal-btn.primary {\n border-color: transparent;\n background: var(--rvs-accent);\n color: #fff;\n}\n\n.rvs-modal-btn.danger {\n border-color: transparent;\n background: var(--rvs-danger);\n color: #fff;\n}\n\n.rvs-toasts {\n position: fixed;\n right: 16px;\n bottom: 18px;\n z-index: 100001;\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: flex-end;\n pointer-events: none;\n}\n\n.rvs-toast {\n max-width: 340px;\n padding: 7px 12px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n color: var(--rvs-fg);\n box-shadow: 0 6px 20px rgba(0, 0, 0, .35);\n font-size: 12.5px;\n line-height: 1.5;\n word-break: break-word;\n white-space: pre-wrap;\n animation: rvsPop .14s ease;\n}\n\n.rvs-toast.error {\n border-color: rgba(241, 76, 76, .6);\n background-image: linear-gradient(rgba(58, 31, 34, .92), rgba(58, 31, 34, .92));\n}\n\n/* ------------------------------------------------------------- terminal */\n\n.rvs-term-tabs {\n flex: none;\n display: flex;\n align-items: stretch;\n gap: 2px;\n height: 32px;\n padding: 0 4px;\n overflow-x: auto;\n overflow-y: hidden;\n border-bottom: 1px solid var(--rvs-border);\n scrollbar-width: none;\n}\n\n.rvs-term-tabs::-webkit-scrollbar {\n height: 0;\n}\n\n.rvs-term-tab {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n max-width: 180px;\n margin: 4px 0;\n padding: 0 6px 0 9px;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: var(--rvs-fg3);\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n\n/* Wrapper that pairs a tab with its close button. The two are siblings so the\n ✕ can be a real focusable <button> (a nested one is invalid HTML and left\n keyboard users no way to close a tab). */\n.rvs-term-tabwrap {\n position: relative;\n flex: none;\n display: flex;\n align-items: center;\n}\n\n.rvs-term-tabwrap .rvs-term-tab {\n padding-right: 22px;\n}\n\n.rvs-term-tabwrap .rvs-etab-close {\n position: absolute;\n right: 3px;\n opacity: 0;\n}\n\n.rvs-term-tabwrap:hover .rvs-etab-close,\n.rvs-term-tabwrap:focus-within .rvs-etab-close {\n opacity: .8;\n}\n\n.rvs-term-tab:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-term-tab.active {\n background: var(--rvs-layer3);\n color: var(--rvs-fg);\n}\n\n.rvs-term-tab.dead {\n color: var(--rvs-git-d);\n}\n\n.rvs-term-name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-term-body {\n flex: 1;\n min-height: 0;\n position: relative;\n overflow: hidden;\n}\n\n.rvs-term-slot {\n position: absolute;\n inset: 0;\n}\n\n.rvs-term-dead {\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n}\n\n/* `.rvs-toast.error` is styled with the overlay form further up, so the popup\n opacity convention (an opaque Canvas base plus a token layer) still governs\n it. A flat `background: #3a1f22` shorthand sat here and overrode that chain —\n same opaque result, but outside the convention. */\n\n@keyframes rvsFade {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes rvsPop {\n from { opacity: 0; transform: scale(.97) translateY(3px); }\n to { opacity: 1; transform: none; }\n}\n\n.rvs-search-row {\n display: flex;\n gap: 6px;\n padding: 6px 8px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n/* --------------------------------------------------------- search options */\n\n.rvs-toggles {\n flex: none;\n display: inline-flex;\n border: 1px solid var(--rvs-border2);\n border-radius: 6px;\n overflow: hidden;\n}\n\n.rvs-toggle {\n min-width: 26px;\n height: 22px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 5px;\n border: none;\n border-right: 1px solid var(--rvs-border);\n background: transparent;\n color: var(--rvs-fg3);\n font: inherit;\n cursor: pointer;\n}\n\n.rvs-toggle:last-child {\n border-right: none;\n}\n\n.rvs-toggle:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-toggle.active {\n background: var(--rvs-active);\n color: var(--rvs-fg);\n box-shadow: inset 0 0 0 1px var(--rvs-brand);\n}\n\n.rvs-glyph {\n font-family: var(--rvs-mono);\n font-weight: 600;\n line-height: 1;\n letter-spacing: -0.02em;\n}\n\n.rvs-glyph-underline {\n text-decoration: underline;\n}\n\n.rvs-scope-label {\n flex: none;\n align-self: center;\n font-size: 11px;\n color: var(--rvs-fg3);\n white-space: nowrap;\n}\n\n/* --------------------------------------------------------- search results */\n\n.rvs-hit {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 3px 10px;\n border: none;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12.5px;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-hit:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-hit-file {\n font-weight: 600;\n}\n\n.rvs-hit-line {\n padding-left: 30px;\n align-items: flex-start;\n font-family: var(--rvs-mono);\n font-size: 12px;\n color: var(--rvs-fg2);\n}\n\n.rvs-hit-count {\n flex: none;\n min-width: 18px;\n padding: 0 5px;\n border-radius: 9px;\n background: var(--rvs-hover);\n font-size: 10.5px;\n line-height: 15px;\n text-align: center;\n color: var(--rvs-fg3);\n}\n\n.rvs-hit-lineno {\n flex: none;\n width: 3.2em;\n text-align: right;\n color: var(--rvs-fg3);\n opacity: .8;\n font-size: 11px;\n}\n\n.rvs-hit-text {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n direction: ltr;\n}\n\n.rvs-mark {\n padding: 0 1px;\n border-radius: 2px;\n background: rgba(226, 183, 20, .3);\n color: inherit;\n}\n\n.rvs-hit-dir {\n flex: none;\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n.rvs-hit-name {\n flex: none;\n font-weight: 600;\n}\n\n.rvs-kbd {\n padding: 0 4px;\n border: 1px solid var(--rvs-border2);\n border-radius: 4px;\n font-size: 10px;\n color: var(--rvs-fg3);\n}\n\n/* --- SCM: repository directory row (git runs in THIS directory) ------------- */\n\n.rvs-repo-bar {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px 8px 4px 10px;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-bg2, var(--dsw-alias-bg-layer-1, #1b1b1b));\n font-size: 11px;\n flex: none;\n}\n\n.rvs-repo-bar-label {\n color: var(--rvs-fg3);\n white-space: nowrap;\n}\n\n.rvs-repo-bar-path {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n direction: rtl;\n unicode-bidi: plaintext;\n text-align: left;\n padding: 2px 6px;\n border: 1px solid var(--rvs-border2);\n border-radius: 4px;\n background: var(--rvs-bg3, rgba(255, 255, 255, .04));\n color: var(--rvs-fg);\n font-family: var(--rvs-mono, ui-monospace, Consolas, monospace);\n font-size: 11px;\n cursor: pointer;\n}\n\n.rvs-repo-bar-path:hover {\n border-color: var(--rvs-brand);\n color: var(--rvs-brand-fg, var(--rvs-fg));\n}\n\n.rvs-repo-bar-fix {\n margin-top: 10px;\n display: flex;\n justify-content: center;\n}\n\n/* --- SCM: repository directory picker -------------------------------------- */\n\n.rvs-repopick {\n width: min(560px, calc(100vw - 40px));\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.rvs-repopick .rvs-modal-title {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n.rvs-repopick-bar {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 2px;\n min-height: 22px;\n font-family: var(--rvs-mono, ui-monospace, Consolas, monospace);\n font-size: 12px;\n}\n\n.rvs-crumb-wrap {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n color: var(--rvs-fg3);\n}\n\n.rvs-crumb {\n border: none;\n background: none;\n padding: 1px 3px;\n border-radius: 3px;\n color: var(--rvs-brand-fg, var(--rvs-fg));\n font: inherit;\n cursor: pointer;\n}\n\n.rvs-crumb:hover {\n background: var(--rvs-row-hover, rgba(255, 255, 255, .07));\n}\n\n.rvs-repopick-probe {\n padding: 5px 8px;\n border-radius: 4px;\n font-size: 11.5px;\n border: 1px solid var(--rvs-border2);\n background: var(--rvs-bg3, rgba(255, 255, 255, .04));\n color: var(--rvs-fg2);\n}\n\n.rvs-repopick-probe.root {\n border-color: var(--rvs-ok, #2ea043);\n color: var(--rvs-ok, #2ea043);\n}\n\n.rvs-repopick-probe.inside {\n border-color: var(--rvs-brand);\n color: var(--rvs-brand-fg, var(--rvs-fg));\n}\n\n.rvs-repopick-found {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 4px;\n padding-bottom: 2px;\n}\n\n.rvs-repopick-found-label {\n color: var(--rvs-fg3);\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-repopick-list {\n flex: 1 1 auto;\n min-height: 150px;\n max-height: 42vh;\n overflow: auto;\n border: 1px solid var(--rvs-border);\n border-radius: 5px;\n background: var(--rvs-bg-layer, rgba(0, 0, 0, .18));\n padding: 2px;\n}\n\n.rvs-repopick-row {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 3px 6px;\n border: none;\n border-radius: 3px;\n background: none;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12px;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-repopick-row:hover {\n background: var(--rvs-row-hover, rgba(255, 255, 255, .07));\n}\n\n.rvs-repopick-row span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-repopick-dim {\n color: var(--rvs-fg3);\n font-size: 11.5px;\n padding: 6px;\n}\n\n.rvs-repopick-type {\n display: flex;\n gap: 6px;\n align-items: center;\n}\n\n.rvs-repopick-type .rvs-input {\n flex: 1 1 auto;\n}\n\n.rvs-repopick-error {\n color: var(--rvs-error, #f85149);\n font-size: 11.5px;\n}\n\n/* --------------------------------------------------- streaming exec panel */\n\n/**\n * Live log for the network verbs (fetch / pull / push / sync).\n *\n * Fixed to the viewport's bottom-right instead of joining the panel's own\n * column: the pane can be collapsed or scrolled away while the push runs, and a\n * dialog that vanishes with its parent would hide the cancel button exactly\n * when it matters.\n */\n.rvs-execpanel {\n /* PORTALED to <body>, i.e. OUTSIDE `.rvs-root` where these tokens are\n declared — without this block every var() below resolves to nothing and the\n panel renders transparent and borderless over the page content. Keep this\n subset in sync with `.rvs-root`; the dark code surfaces get their own\n `body[data-ds-dark-theme]` override right after this rule. */\n --rvs-fg: var(--dsw-alias-label-primary, #e6e6e6);\n --rvs-fg2: var(--dsw-alias-label-secondary, #b9b9b9);\n --rvs-fg3: var(--dsw-alias-label-tertiary, #8b8b8b);\n --rvs-hover: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, .14));\n --rvs-border: var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n --rvs-border2: var(--dsw-alias-border-l2, rgba(127, 127, 127, .38));\n --rvs-overlay: var(--dsw-alias-bg-overlay, #24262e);\n --rvs-brand: var(--dsw-alias-brand-primary, #4d6bfe);\n --rvs-danger: var(--dsw-alias-state-error-primary, #e05555);\n --rvs-git-m: #e2b714;\n --rvs-git-a: #4ec9b0;\n --rvs-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;\n --rvs-code-bg: #1e1e1e;\n --rvs-code-fg: #d4d4d4;\n position: fixed;\n right: 16px;\n bottom: 16px;\n z-index: 45;\n width: min(620px, calc(100vw - 32px));\n max-height: min(60vh, 520px);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--rvs-border2);\n border-radius: 10px;\n background: var(--rvs-overlay);\n color: var(--rvs-fg);\n box-shadow: 0 18px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .28);\n}\n\nbody[data-ds-dark-theme] .rvs-execpanel {\n --rvs-code-bg: #1e1e1e;\n --rvs-code-fg: #d4d4d4;\n}\n\n\n.rvs-execpanel-head {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 5px 6px 5px 10px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-execpanel-title {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n font-weight: 600;\n}\n\n.rvs-execpanel-status {\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n font-variant-numeric: tabular-nums;\n}\n\n.rvs-execpanel-status.done { color: var(--rvs-git-a); }\n.rvs-execpanel-status.error { color: var(--rvs-danger); }\n.rvs-execpanel-status.cancelled { color: var(--rvs-git-m); }\n\n.rvs-execpanel-spacer {\n flex: 1;\n min-width: 0;\n}\n\n.rvs-execpanel-body {\n flex: 1;\n min-height: 60px;\n margin: 0;\n padding: 8px 10px;\n overflow: auto;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n font-family: var(--rvs-mono);\n font-size: 11.5px;\n line-height: 1.45;\n white-space: pre-wrap;\n word-break: break-word;\n user-select: text;\n}\n\n.rvs-execpanel-foot {\n flex: none;\n padding: 4px 10px 6px;\n border-top: 1px solid var(--rvs-border);\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n/* --------------------------------------------------------- download dock */\n/* PORTALed to <body>, i.e. OUTSIDE `.rvs-root` where the tokens are declared:\n declare the subset this panel uses (same rule as `.rvs-execpanel`). */\n.rvs-downloads {\n --rvs-fg: var(--dsw-alias-label-primary, #e6e6e6);\n --rvs-fg2: var(--dsw-alias-label-secondary, #b9b9b9);\n --rvs-fg3: var(--dsw-alias-label-tertiary, #8b8b8b);\n --rvs-border: var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n --rvs-border2: var(--dsw-alias-border-l2, rgba(127, 127, 127, .38));\n --rvs-overlay: var(--dsw-alias-bg-overlay, #24262e);\n --rvs-brand: var(--dsw-alias-brand-primary, #4d6bfe);\n --rvs-danger: var(--dsw-alias-state-error-primary, #e05555);\n --rvs-git-m: #e2b714;\n --rvs-git-a: #4ec9b0;\n position: fixed;\n /* Bottom-RIGHT, not over the sidebar's own footer (first screenshot: the\n dock sat on the usage/account block). `bottom: 64px` keeps it above the\n transient toast stack (right 16 / bottom 18 / z 100001) and above the\n network exec panel (right 16 / bottom 16 / z 45), so neither covers it. */\n right: 16px;\n bottom: 64px;\n z-index: 100000;\n animation: rvsFade .12s ease;\n width: min(380px, calc(100vw - 32px));\n max-height: min(45vh, 420px);\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 10px;\n background: var(--rvs-overlay);\n color: var(--rvs-fg);\n box-shadow: 0 18px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .28);\n}\n\n.rvs-download {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 6px 8px;\n border: 1px solid var(--rvs-border);\n border-radius: 8px;\n background: rgba(127, 127, 127, .06);\n}\n\n.rvs-download-head {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n.rvs-download-icon {\n flex: none;\n display: flex;\n align-items: center;\n color: var(--rvs-fg2);\n}\n\n.rvs-download-name {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n font-weight: 600;\n}\n\n.rvs-download-status {\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-download-status.done { color: var(--rvs-git-a); }\n.rvs-download-status.failed { color: var(--rvs-danger); }\n.rvs-download-status.cancelled { color: var(--rvs-git-m); }\n\n.rvs-download-bar {\n height: 4px;\n overflow: hidden;\n border-radius: 2px;\n background: rgba(127, 127, 127, .22);\n}\n\n.rvs-download-fill {\n height: 100%;\n width: 0;\n border-radius: 2px;\n background: var(--rvs-brand);\n transition: width .12s linear;\n}\n\n.rvs-download-fill.indeterminate {\n width: 35%;\n animation: rvs-download-slide 1.2s ease-in-out infinite;\n}\n\n@keyframes rvs-download-slide {\n from { transform: translateX(-120%); }\n to { transform: translateX(320%); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .rvs-download-fill.indeterminate { animation-duration: 2.4s; }\n .rvs-download-fill { transition: none; }\n}\n\n.rvs-download-meta {\n overflow: hidden;\n color: var(--rvs-fg3);\n font-size: 11px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-download-meta.failed { color: var(--rvs-danger); white-space: normal; word-break: break-word; }\n.rvs-download-meta.done { color: var(--rvs-fg2); }\n.rvs-download-meta.cancelled { color: var(--rvs-git-m); }\n\n/* ----------------------------------------------------------- doctor panel */\n\n/*\n * Remote-environment report, opened from the host list (which lives in the DSH\n * Settings dialog, i.e. OUTSIDE `.rvs-root`). Fixed overlay like the input\n * dialog so the host list behind it does not move, and its own token subset for\n * the same reason as `.rvs-execpanel`: `var(--rvs-*)` resolves to nothing out\n * there without it. Three state colors, and `unknown` deliberately looks\n * neutral (not red, not green): it is ignorance, not a verdict.\n */\n.rvs-doctor {\n --rvs-fg: var(--dsw-alias-label-primary, #e6e6e6);\n --rvs-fg2: var(--dsw-alias-label-secondary, #b9b9b9);\n --rvs-fg3: var(--dsw-alias-label-tertiary, #8b8b8b);\n --rvs-border: var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n --rvs-overlay: var(--dsw-alias-bg-overlay, #24262e);\n --rvs-git-m: #e2b714;\n --rvs-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, .45);\n color: var(--rvs-fg);\n font-size: 13px;\n}\n\n.rvs-doctor-card {\n display: flex;\n flex-direction: column;\n width: min(860px, 92vw);\n max-height: min(80vh, 720px);\n border: 1px solid var(--rvs-border);\n border-radius: 8px;\n background: var(--rvs-overlay);\n box-shadow: 0 8px 32px rgba(0, 0, 0, .35);\n}\n\n.rvs-doctor-head {\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 12px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-doctor-title {\n font-weight: 600;\n}\n\n.rvs-doctor-body {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 4px 12px 10px;\n}\n\n.rvs-doctor-loading {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 0;\n color: var(--rvs-fg2);\n}\n\n.rvs-doctor-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 12px;\n}\n\n.rvs-doctor-table th {\n position: sticky;\n top: 0;\n padding: 6px 8px;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-overlay);\n color: var(--rvs-fg2);\n font-weight: 600;\n text-align: left;\n}\n\n.rvs-doctor-table td {\n padding: 5px 8px;\n border-top: 1px solid var(--rvs-border);\n vertical-align: top;\n}\n\n.rvs-doctor-item {\n white-space: nowrap;\n color: var(--rvs-fg2);\n}\n\n.rvs-doctor-badge {\n display: inline-block;\n padding: 0 6px;\n border: 1px solid currentColor;\n border-radius: 8px;\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-doctor-badge.ok { color: var(--rvs-ok, #2ea043); }\n.rvs-doctor-badge.missing { color: var(--rvs-git-m, #e2b714); }\n.rvs-doctor-badge.unknown { color: var(--rvs-fg3); }\n\n.rvs-doctor-detail {\n color: var(--rvs-fg3);\n font-family: var(--rvs-mono);\n font-size: 11px;\n word-break: break-word;\n user-select: text;\n}\n\n.rvs-doctor-hint {\n flex: none;\n padding: 8px 12px;\n border-top: 1px solid var(--rvs-border);\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n\n\n\n/* ------------------------------------------------------------ port forwards */\n\n/**\n * The port panel: one form above two lists, all inside the sidebar column.\n *\n * The column can be dragged very narrow, so nothing here may assume a width: an\n * address/URL is ONE unbreakable token (`overflow-wrap: anywhere`), the action\n * row wraps instead of overflowing, and the form stacks vertically — a\n * three-input row is unusable at the panel's default width.\n */\n.rvs-ports-body {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 8px 8px 14px;\n}\n\n/**\n * The restore-failure banner: one sentence plus the \"forget these rules\"\n * action, side by side when there is room and stacked when the column is very\n * narrow (the action must never squeeze the explanation into a sliver).\n */\n.rvs-ports-restore {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.rvs-ports-form {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n}\n\n.rvs-ports-field {\n display: flex;\n flex-direction: column;\n gap: 3px;\n min-width: 0;\n}\n\n.rvs-ports-label {\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n/* `.rvs-input` carries `flex: 1`; in a COLUMN flex parent that would stretch\n the field's HEIGHT, so the input fills the width and keeps its own height. */\n.rvs-ports-input {\n flex: none;\n width: 100%;\n box-sizing: border-box;\n}\n\n.rvs-ports-form-actions {\n display: flex;\n justify-content: flex-end;\n}\n\n.rvs-ports-section {\n margin-top: 12px;\n border-top: 1px solid var(--rvs-border);\n}\n\n.rvs-ports-sec-head {\n display: flex;\n align-items: center;\n gap: 6px;\n height: 26px;\n padding: 0 4px;\n color: var(--rvs-fg2);\n font-size: 11px;\n font-weight: 700;\n letter-spacing: .04em;\n text-transform: uppercase;\n user-select: none;\n}\n\n.rvs-ports-count {\n padding: 0 6px;\n border-radius: 999px;\n background: var(--rvs-hover);\n color: var(--rvs-fg3);\n font-size: 10.5px;\n letter-spacing: 0;\n}\n\n.rvs-ports-row {\n display: flex;\n flex-direction: column;\n gap: 3px;\n min-width: 0;\n padding: 6px 6px 7px;\n border-radius: 6px;\n}\n\n.rvs-ports-row:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-ports-line {\n display: flex;\n align-items: baseline;\n gap: 6px;\n min-width: 0;\n}\n\n.rvs-ports-addr {\n flex: 1;\n min-width: 0;\n overflow-wrap: anywhere;\n color: var(--rvs-fg);\n font-family: var(--rvs-mono);\n font-size: 11.5px;\n line-height: 1.45;\n}\n\n.rvs-ports-proc {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n/* State is never colour-only: the dot carries the state word as its label. */\n.rvs-ports-dot {\n flex: none;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--rvs-fg3);\n}\n\n.rvs-ports-dot.listening {\n background: var(--rvs-ok, #2ea043);\n}\n\n.rvs-ports-dot.error {\n background: var(--rvs-danger);\n}\n\n.rvs-ports-conn {\n color: var(--rvs-fg3);\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-ports-err {\n color: var(--rvs-danger);\n font-size: 11px;\n line-height: 1.45;\n overflow-wrap: anywhere;\n}\n\n.rvs-ports-actions {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 2px;\n min-width: 0;\n}\n\n/* The \"open\" affordance is a real link styled as a header button. */\n.rvs-ports-open {\n text-decoration: none;\n}\n\n.rvs-ports-hint {\n margin-top: 4px;\n color: var(--rvs-fg3);\n font-size: 11px;\n line-height: 1.45;\n overflow-wrap: anywhere;\n}\n\n/* --------------------------------------------------------- host monitor */\n\n/**\n * The monitor panel is cross-host (not bound to the workspace): one card for a\n * single subject, a compact clickable list for \"all hosts\". Values are\n * tabular-nums so a 5 s refresh does not make the text dance.\n */\n.rvs-monitor-body {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 8px 8px 14px;\n /* Container for the narrow-sidebar layout rules at the end of this section. */\n container-type: inline-size;\n}\n\n/* The rail title and the scope picker both wanted flex:1; the title yields so\n the picker keeps enough width for its own label at 230px. */\n.rvs-monitor-header .rvs-title {\n flex: none;\n}\n\n/* The panel's own settings (refresh interval). Shown under the header only\n while the gear is active; it is chrome, not a modal, so the live values stay\n visible above it. */\n.rvs-monitor-settings {\n flex: none;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-layer3);\n}\n\n.rvs-monitor-settings-head {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.rvs-monitor-settings-label {\n color: var(--rvs-fg2);\n font-size: 11px;\n font-weight: 600;\n}\n\n.rvs-monitor-settings-hint {\n color: var(--rvs-fg3);\n font-size: 10.5px;\n}\n\n.rvs-monitor-settings .rvs-seg {\n align-self: flex-start;\n}\n\n.rvs-monitor-card {\n margin: 2px 0 8px;\n padding: 10px;\n border: 1px solid var(--rvs-border2);\n border-radius: 9px;\n background: var(--rvs-layer3);\n}\n\n.rvs-monitor-card.error {\n border-color: rgba(224, 85, 85, .45);\n}\n\n.rvs-monitor-head {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n.rvs-monitor-dot {\n flex: none;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--rvs-fg3);\n}\n\n.rvs-monitor-dot.ok {\n background: var(--rvs-ok, #2ea043);\n}\n\n.rvs-monitor-dot.error {\n background: var(--rvs-danger);\n}\n\n.rvs-monitor-title {\n flex: none;\n max-width: 55%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 13px;\n font-weight: 650;\n color: var(--rvs-fg);\n}\n\n.rvs-monitor-conn {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: right;\n color: var(--rvs-fg3);\n font-size: 10.5px;\n}\n\n.rvs-monitor-sub {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: 6px;\n margin-top: 3px;\n font-size: 11px;\n}\n\n.rvs-monitor-state {\n flex: none;\n font-weight: 600;\n}\n\n.rvs-monitor-state.ok {\n color: var(--rvs-ok, #2ea043);\n}\n\n.rvs-monitor-state.error {\n color: var(--rvs-danger);\n}\n\n.rvs-monitor-state.unknown {\n color: var(--rvs-fg3);\n}\n\n.rvs-monitor-age {\n color: var(--rvs-fg3);\n font-variant-numeric: tabular-nums;\n}\n\n.rvs-monitor-reason {\n flex-basis: 100%;\n min-width: 0;\n overflow-wrap: anywhere;\n color: var(--rvs-fg2);\n line-height: 1.45;\n}\n\n.rvs-monitor-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));\n gap: 8px;\n margin-top: 10px;\n}\n\n.rvs-monitor-tile {\n display: flex;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n padding: 8px;\n border-radius: 7px;\n background: var(--rvs-hover);\n}\n\n.rvs-monitor-tile-label {\n color: var(--rvs-fg2);\n font-size: 10px;\n font-weight: 600;\n letter-spacing: .06em;\n text-transform: uppercase;\n}\n\n.rvs-monitor-tile-value {\n color: var(--rvs-fg);\n font-size: 18px;\n font-weight: 650;\n line-height: 1.1;\n font-variant-numeric: tabular-nums;\n}\n\n.rvs-monitor-tile-sub {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--rvs-fg2);\n font-size: 10.5px;\n}\n\n.rvs-monitor-bar {\n height: 4px;\n border-radius: 2px;\n background: var(--rvs-border);\n overflow: hidden;\n}\n\n.rvs-monitor-bar-fill {\n display: block;\n height: 100%;\n border-radius: inherit;\n background: var(--rvs-brand);\n transition: width .35s ease;\n}\n\n.rvs-monitor-bar-fill.warn {\n background: var(--rvs-git-m);\n}\n\n.rvs-monitor-bar-fill.hot {\n background: var(--rvs-danger);\n}\n\n/* Four facts: a 2×2 block reads calmer than three-then-one with auto-fit. */\n.rvs-monitor-facts {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 6px;\n margin-top: 8px;\n}\n\n.rvs-monitor-fact {\n min-width: 0;\n padding: 6px 8px;\n border: 1px solid var(--rvs-border);\n border-radius: 7px;\n}\n\n.rvs-monitor-fact-label {\n color: var(--rvs-fg2);\n font-size: 10px;\n font-weight: 600;\n letter-spacing: .06em;\n text-transform: uppercase;\n}\n\n.rvs-monitor-fact-value {\n color: var(--rvs-fg);\n font-size: 11.5px;\n line-height: 1.35;\n font-variant-numeric: tabular-nums;\n overflow-wrap: anywhere;\n}\n\n.rvs-monitor-sparks {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));\n gap: 8px;\n margin-top: 10px;\n}\n\n.rvs-monitor-spark {\n min-width: 0;\n padding: 6px 8px 4px;\n border: 1px solid var(--rvs-border);\n border-radius: 7px;\n}\n\n.rvs-monitor-spark-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 6px;\n min-width: 0;\n}\n\n.rvs-monitor-spark-legend {\n display: inline-flex;\n align-items: center;\n gap: 7px;\n flex: none;\n color: var(--rvs-fg3);\n font-size: 10px;\n}\n\n.rvs-monitor-spark-key {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n}\n\n.rvs-monitor-spark-line {\n display: inline-block;\n width: 10px;\n height: 0;\n border-top: 2px solid currentColor;\n}\n\n.rvs-monitor-spark-line.tx {\n border-top-style: dashed;\n opacity: .7;\n}\n\n.rvs-monitor-spark-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--rvs-fg2);\n font-size: 10px;\n font-weight: 600;\n letter-spacing: .06em;\n text-transform: uppercase;\n}\n\n.rvs-monitor-spark svg {\n display: block;\n width: 100%;\n height: 34px;\n margin-top: 2px;\n}\n\n.rvs-monitor-spark.cpu {\n color: var(--rvs-brand);\n}\n\n.rvs-monitor-spark.mem {\n color: var(--rvs-git-a);\n}\n\n.rvs-monitor-spark.net {\n color: var(--rvs-git-c);\n}\n\n.rvs-monitor-spark.temp {\n color: var(--rvs-git-m);\n}\n\n.rvs-monitor-spark-empty {\n padding: 8px 0 4px;\n text-align: center;\n color: var(--rvs-fg3);\n font-size: 10.5px;\n}\n\n.rvs-monitor-hint {\n margin-top: 8px;\n color: var(--rvs-fg3);\n font-size: 10.5px;\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n.rvs-monitor-list {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.rvs-monitor-summary {\n padding: 0 2px 4px;\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n.rvs-monitor-row {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n padding: 8px;\n border: 1px solid var(--rvs-border);\n border-radius: 8px;\n background: var(--rvs-layer3);\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-monitor-row:hover {\n border-color: var(--rvs-border2);\n background: var(--rvs-hover);\n}\n\n.rvs-monitor-row.error {\n border-color: rgba(224, 85, 85, .45);\n}\n\n.rvs-monitor-row-top {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n.rvs-monitor-row-name {\n flex: none;\n max-width: 50%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12.5px;\n font-weight: 600;\n}\n\n.rvs-monitor-row-host {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--rvs-fg3);\n font-size: 10.5px;\n}\n\n.rvs-monitor-row-cpu {\n flex: none;\n font-size: 12px;\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n}\n\n.rvs-monitor-row-bars {\n display: flex;\n gap: 4px;\n}\n\n.rvs-monitor-row-bar {\n flex: 1;\n height: 3px;\n border-radius: 2px;\n background: var(--rvs-border);\n overflow: hidden;\n}\n\n.rvs-monitor-row-facts {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 8px;\n color: var(--rvs-fg3);\n font-size: 10.5px;\n font-variant-numeric: tabular-nums;\n}\n\n/* ------------------------------------------------- narrow sidebar (<=260px)\n Container queries, not media queries: the rail is narrow while the WINDOW is\n wide. Reactions: the three gauges stack (an orphan grid cell with ~90px of\n empty space next to it looked broken), the four curves go 2×2 instead of a\n single tall column, and the all-hosts facts become a 2×2 grid so row heights\n stay uniform. */\n@container (max-width: 260px) {\n .rvs-monitor-grid {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .rvs-monitor-sparks {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n\n .rvs-monitor-row-facts {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n\n /* A 2-column spark is ~80px wide; the label must win over the legend there. */\n .rvs-monitor-spark-legend {\n display: none;\n }\n}\n\n/* ------------------------------------------------------ Ctrl+P quick open */\n\n.rvs-qo-mask {\n /* PORTALED to <body>, i.e. OUTSIDE `.rvs-root` where these tokens are\n declared — without this block every var() below resolves to nothing: the\n active row paints transparent (keyboard selection invisible), the directory\n column stops dimming, and error/warning copy comes out the same colour as\n ordinary text (so \"index failed\" looks like \"no match\"). Keep this subset in\n sync with `.rvs-root`; it lists exactly the tokens the `.rvs-qo*` rules use. */\n --rvs-fg: var(--dsw-alias-label-primary, #e6e6e6);\n --rvs-fg2: var(--dsw-alias-label-secondary, #b9b9b9);\n --rvs-fg3: var(--dsw-alias-label-tertiary, #8b8b8b);\n --rvs-hover: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, .14));\n --rvs-active: var(--dsw-alias-interactive-bg-active, rgba(77, 107, 254, .22));\n --rvs-border: var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n --rvs-border2: var(--dsw-alias-border-l2, rgba(127, 127, 127, .38));\n --rvs-input: var(--dsw-alias-bg-input, rgba(127, 127, 127, .12));\n --rvs-brand: var(--dsw-alias-brand-primary, #4d6bfe);\n --rvs-danger: var(--dsw-alias-state-error-primary, #e05555);\n --rvs-git-m: #e2b714;\n --rvs-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;\n position: fixed;\n inset: 0;\n /* The modal layer (100000), so toasts (100001) still paint above it. */\n z-index: 100000;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n padding-top: 12vh;\n background: rgba(0, 0, 0, .38);\n backdrop-filter: blur(2px);\n animation: rvsFade .12s ease;\n}\n\n/**\n * Opaque base first, skin overlay on top: the overlay token is frequently\n * translucent, and using it alone let the panel's text bleed through the sheet\n * (the same fix the menu/modal layer needed).\n */\n.rvs-qo {\n width: min(680px, calc(100vw - 40px));\n max-height: min(62vh, 560px);\n display: flex;\n flex-direction: column;\n border: 1px solid var(--rvs-border2);\n border-radius: 10px;\n background-color: Canvas;\n background-image: linear-gradient(var(--dsw-alias-bg-overlay, transparent), var(--dsw-alias-bg-overlay, transparent));\n color: var(--rvs-fg);\n box-shadow: 0 16px 48px rgba(0, 0, 0, .42);\n font-size: 12.5px;\n overflow: hidden;\n animation: rvsPop .12s ease;\n}\n\n.rvs-qo-bar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 10px 12px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-qo-input {\n flex: 1;\n min-width: 0;\n height: 28px;\n padding: 0 8px;\n border: 1px solid var(--rvs-border);\n border-radius: 6px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n outline: none;\n}\n\n.rvs-qo-input:focus {\n border-color: var(--rvs-brand);\n}\n\n.rvs-qo-hint {\n flex: none;\n color: var(--rvs-fg3);\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-qo-list {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n padding: 4px;\n}\n\n.rvs-qo-row {\n display: flex;\n align-items: baseline;\n gap: 8px;\n padding: 4px 8px;\n border-radius: 5px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n\n.rvs-qo-row:hover {\n background: var(--rvs-hover);\n}\n\n/* Declared AFTER :hover so a hovered active row keeps the active colour. */\n.rvs-qo-row.active {\n background: var(--rvs-active);\n}\n\n.rvs-qo-dir {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n color: var(--rvs-fg3);\n font-size: 11.5px;\n}\n\n.rvs-qo-name {\n flex: none;\n color: var(--rvs-fg);\n font-family: var(--rvs-mono);\n font-size: 12px;\n}\n\n.rvs-qo-hit {\n padding: 0;\n border-radius: 2px;\n background: rgba(77, 107, 254, .32);\n color: inherit;\n font-weight: 600;\n}\n\n.rvs-qo-foot {\n flex: none;\n display: flex;\n flex-direction: column;\n gap: 2px;\n max-height: 72px;\n overflow-y: auto;\n padding: 6px 12px;\n border-top: 1px solid var(--rvs-border);\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n.rvs-qo-note {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.rvs-qo-note.error {\n color: var(--rvs-danger);\n}\n\n.rvs-qo-note.warn {\n color: var(--rvs-git-m);\n}\n\n";
|
|
14
|
+
const css$3 = "/**\n * VS Code-style design system for the remote explorer. Every surface below\n * is scoped under `.rvs-root` so the sheet can never leak into the host GUI,\n * and every host token carries a literal fallback: the plugin also renders in\n * the native right-Sidebar fallback and on hosts whose alias tokens differ.\n *\n * Palette and metrics are aligned with the reference implementation\n * (dsh-solution-explorer): 13px/20px panel type, 5px/10px tree rows with a\n * 10px radius, a 30px activity button with the badge tucked into the icon's\n * bottom-right corner, GitHub-Dark token colors, and the\n * `--e2b714 / #4ec9b0 / #f14c4c` modified/added/deleted triple.\n */\n\n.rvs-root {\n --rvs-fg: var(--dsw-alias-label-primary, #e6e6e6);\n --rvs-fg2: var(--dsw-alias-label-secondary, #b9b9b9);\n --rvs-fg3: var(--dsw-alias-label-tertiary, #8b8b8b);\n --rvs-hover: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, .14));\n --rvs-active: var(--dsw-alias-interactive-bg-active, rgba(77, 107, 254, .22));\n --rvs-border: var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n --rvs-border2: var(--dsw-alias-border-l2, rgba(127, 127, 127, .38));\n --rvs-input: var(--dsw-alias-bg-input, rgba(127, 127, 127, .12));\n --rvs-overlay: var(--dsw-alias-bg-overlay, #24262e);\n --rvs-layer3: var(--dsw-alias-bg-layer-3, rgba(127, 127, 127, .16));\n --rvs-brand: var(--dsw-alias-brand-primary, #4d6bfe);\n --rvs-accent: var(--dsw-alias-button-info-fill, #4d6bfe);\n --rvs-danger: var(--dsw-alias-state-error-primary, #e05555);\n --rvs-ok: #2ea043;\n --rvs-git-m: #e2b714;\n --rvs-git-a: #4ec9b0;\n --rvs-git-d: #f14c4c;\n --rvs-git-r: #4ec9b0;\n --rvs-git-c: #58a6ff;\n --rvs-git-u: #f14c4c;\n --rvs-git-x: #6e6e6e;\n --rvs-add-bg: rgba(78, 201, 176, .15);\n --rvs-del-bg: rgba(241, 76, 76, .15);\n /* Opaque equivalents, for elements that must not show what scrolls under\n them (the pinned diff line numbers). */\n --rvs-add-solid: #e4f6f1;\n --rvs-del-solid: #fdeaea;\n --rvs-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;\n /* Opaque code surfaces (Light+ default; the dark block below flips them). */\n --rvs-code-bg: #ffffff;\n --rvs-code-fg: #1f1f1f;\n --rvs-code-gutter-fg: #237893;\n /* Editor chrome (tab strip / file info bar / breadcrumb / status bar) and\n the editor's own surfaces: Light+ defaults, flipped by the dark block\n below. The float window inherits them because it carries `.rvs-root`. */\n --rvs-editor-panel-bg: #f3f3f3;\n --rvs-editor-panel-fg: #1f1f1f;\n --rvs-editor-input-bg: #ffffff;\n --rvs-editor-chrome-border: rgba(0, 0, 0, .12);\n /* Reserved for the editor's own type scale (the font A−/A+ controls). */\n --rvs-editor-font-size: 13px;\n\n display: flex;\n flex-direction: row;\n height: 100%;\n min-height: 0;\n overflow: hidden;\n color: var(--rvs-fg);\n font-size: 13px;\n line-height: 20px;\n}\n\n/**\n * Code surfaces are OPAQUE, in the editor's own palette rather than the DSH\n * skin: syntax colors need a definite background to stay readable, and the\n * app shell marks its resolved scheme on <body> (same signal theme.ts reads).\n */\nbody[data-ds-dark-theme] .rvs-root {\n --rvs-code-bg: #1e1e1e;\n --rvs-code-fg: #d4d4d4;\n --rvs-code-gutter-fg: #858585;\n --rvs-add-solid: #16332e;\n --rvs-del-solid: #3b2325;\n --rvs-editor-panel-bg: #252526;\n --rvs-editor-panel-fg: #cccccc;\n --rvs-editor-input-bg: #3c3c3c;\n --rvs-editor-chrome-border: rgba(255, 255, 255, .12);\n}\n\n.rvs-edge {\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n}\n\n.rvs-root *,\n.rvs-portal * {\n box-sizing: border-box;\n}\n\n/* ------------------------------------------------------------ activity rail */\n\n.rvs-rail {\n flex: none;\n width: 38px;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n padding: 8px 0;\n border-right: 1px solid var(--rvs-border);\n background: var(--dsw-specific-sidebar-fill, transparent);\n}\n\n.rvs-rail-btn {\n position: relative;\n flex: none;\n width: 30px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: var(--rvs-fg3);\n cursor: pointer;\n}\n\n.rvs-rail-btn:hover {\n color: var(--rvs-fg);\n background: var(--rvs-hover);\n}\n\n.rvs-rail-btn.active {\n color: var(--rvs-fg);\n background: var(--rvs-hover);\n box-shadow: inset 2px 0 0 var(--rvs-brand);\n}\n\n.rvs-rail-btn.danger:hover {\n color: var(--rvs-danger);\n}\n\n.rvs-rail-badge {\n position: absolute;\n bottom: 1px;\n right: 1px;\n min-width: 14px;\n height: 14px;\n padding: 0 3px;\n border-radius: 7px;\n background: var(--rvs-accent);\n color: #fff;\n font-size: 9px;\n font-weight: 700;\n line-height: 14px;\n text-align: center;\n pointer-events: none;\n}\n\n.rvs-rail-sep {\n flex: none;\n width: 20px;\n height: 1px;\n margin: 4px 0;\n background: var(--rvs-border);\n}\n\n/* -------------------------------------------------------- panel + editor */\n\n.rvs-column {\n flex: 1;\n min-width: 0;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.rvs-pane {\n display: flex;\n flex-direction: column;\n min-height: 0;\n min-width: 0;\n overflow: hidden;\n}\n\n/**\n * One lazily-mounted panel slot: a visited panel stays mounted and is merely\n * hidden, so returning to the explorer (or the terminal) neither refetches nor\n * flashes a reload.\n */\n.rvs-viewslot {\n flex: 1;\n min-height: 0;\n min-width: 0;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n}\n\n/**\n * Padding for the legacy views (workspaces / terminal) that draw no chrome.\n *\n * It MUST be a flex column: the workspaces view scroller is its child and gets\n * its bounded height only from a flex parent (`flex:1; min-height:0`). As a\n * plain block it grew with its content instead, so the panel clipped at the\n * viewslot's `overflow:hidden` and the binding list could not scroll at all —\n * a seventh workspace (and the wizard under it) was simply unreachable.\n */\n.rvs-viewpad {\n display: flex;\n flex-direction: column;\n min-height: 0;\n padding: 10px 12px 14px;\n box-sizing: border-box;\n}\n\n.rvs-pane.grow {\n flex: 1;\n}\n\n.rvs-header {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n height: 34px;\n padding: 0 8px 0 10px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-header .rvs-title {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: .04em;\n text-transform: uppercase;\n color: var(--rvs-fg3);\n}\n\n.rvs-hbtn {\n flex: none;\n width: 22px;\n height: 22px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n border-radius: 5px;\n background: transparent;\n color: var(--rvs-fg3);\n cursor: pointer;\n}\n\n.rvs-hbtn:hover {\n color: var(--rvs-fg);\n background: var(--rvs-hover);\n}\n\n.rvs-hbtn.danger:hover {\n color: #fff;\n background: var(--rvs-danger);\n}\n\n.rvs-hbtn:disabled {\n opacity: .4;\n cursor: default;\n}\n\n.rvs-scroll {\n flex: 1;\n min-height: 0;\n overflow: auto;\n scrollbar-width: thin;\n}\n\n.rvs-globalbar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 8px;\n border-bottom: 1px solid var(--rvs-border);\n font-size: 11px;\n}\n\n/*\n * Connection chip: the Host's SSH link health for the workspace on screen.\n * Lives in the top bar and, compact, in the editor info bar. Only the errored\n * state is interactive (retry); the others are a status read-out.\n */\n.rvs-conn {\n flex: none;\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 1px 6px 1px 5px;\n border: 1px solid transparent;\n border-radius: 9px;\n background: transparent;\n color: var(--rvs-fg2);\n font: inherit;\n font-size: 11px;\n line-height: 16px;\n cursor: default;\n}\n\n.rvs-conn.compact {\n padding: 0 2px;\n border: none;\n background: none;\n}\n\n.rvs-conn.clickable {\n cursor: pointer;\n}\n\n.rvs-conn.clickable:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-conn-dot {\n flex: none;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--rvs-fg3);\n}\n\n.rvs-conn-ok .rvs-conn-dot {\n background: var(--rvs-ok, #2ea043);\n}\n\n.rvs-conn-error {\n color: var(--rvs-danger);\n}\n\n.rvs-conn-error .rvs-conn-dot {\n background: var(--rvs-danger);\n}\n\n.rvs-conn-label {\n max-width: 9em;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.rvs-scroll::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n}\n\n.rvs-scroll::-webkit-scrollbar-thumb {\n background: var(--dsw-alias-scrollbar-bg-l2, rgba(127, 127, 127, .4));\n border-radius: 4px;\n}\n\n.rvs-scroll::-webkit-scrollbar-thumb:hover {\n background: var(--dsw-alias-scrollbar-hover-l2, rgba(127, 127, 127, .6));\n}\n\n.rvs-scroll::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.rvs-vsplit-handle {\n flex: none;\n position: relative;\n height: 7px;\n cursor: row-resize;\n touch-action: none;\n}\n\n.rvs-vsplit-handle::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n top: 3px;\n height: 1px;\n background: var(--rvs-border);\n}\n\n.rvs-vsplit-handle:hover::after,\n.rvs-vsplit-handle[data-dragging='true']::after {\n top: 2px;\n height: 3px;\n border-radius: 2px;\n background: var(--rvs-brand);\n}\n\n/* ------------------------------------------------------------------ tree */\n\n.rvs-tree {\n padding: 4px 6px 12px;\n min-width: 0;\n}\n\n.rvs-node {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n width: 100%;\n padding: 4px 8px;\n border: none;\n background: transparent;\n border-radius: 8px;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 13px;\n line-height: 18px;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-node:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-node.selected {\n background: var(--rvs-active);\n}\n\n.rvs-node.cut {\n opacity: .5;\n}\n\n.rvs-node.drop-target {\n background: var(--rvs-active);\n outline: 1px solid var(--rvs-brand);\n outline-offset: -1px;\n}\n\n/* Where a file drag will land: a slip must not silently drop a tree into the\n wrong directory. */\n.rvs-drop-hint {\n margin: 2px 8px 4px;\n padding: 3px 8px;\n border: 1px dashed var(--rvs-brand);\n border-radius: 3px;\n font-size: 11px;\n color: var(--rvs-brand);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n direction: rtl;\n unicode-bidi: plaintext;\n}\n/* Upload progress: one line under the header. A multi-minute transfer with no\n feedback is indistinguishable from a hung explorer, so the row names the\n count and the file on the wire. */\n.rvs-upload-bar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 3px 10px 4px;\n font-size: 11px;\n color: var(--dsw-alias-text-secondary, rgba(127, 127, 127, .95));\n}\n\n.rvs-upload-text {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n direction: rtl;\n unicode-bidi: plaintext;\n}\n\n.rvs-node-icon {\n flex: none;\n width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--rvs-fg3);\n}\n\n.rvs-node-name {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-node-actions {\n flex: none;\n display: none;\n align-items: center;\n gap: 2px;\n}\n\n.rvs-node:hover .rvs-node-actions {\n display: flex;\n}\n\n.rvs-git-letter {\n flex: none;\n width: 14px;\n margin-left: 2px;\n font-size: 11px;\n font-weight: 700;\n text-align: center;\n}\n\n.rvs-git-M, .rvs-letter-M { color: var(--rvs-git-m); }\n.rvs-git-A, .rvs-letter-A { color: var(--rvs-git-a); }\n.rvs-git-D, .rvs-letter-D { color: var(--rvs-git-d); }\n.rvs-git-R, .rvs-letter-R { color: var(--rvs-git-r); }\n.rvs-git-C, .rvs-letter-C { color: var(--rvs-git-c); }\n.rvs-git-U, .rvs-letter-U { color: var(--rvs-git-u); }\n.rvs-git-q, .rvs-letter-q, .rvs-git-\\\\? { color: var(--rvs-git-a); }\n.rvs-git-x, .rvs-letter-x { color: var(--rvs-git-x); }\n.rvs-git-T, .rvs-letter-T { color: var(--rvs-git-m); }\n\n.rvs-rename-input {\n flex: 1;\n min-width: 0;\n padding: 0 4px;\n border: 1px solid var(--rvs-brand);\n border-radius: 4px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n font-size: 13px;\n line-height: 18px;\n outline: none;\n}\n\n.rvs-empty {\n padding: 18px 14px;\n color: var(--rvs-fg3);\n font-size: 12px;\n text-align: center;\n line-height: 1.7;\n}\n\n.rvs-banner {\n margin: 6px 8px;\n padding: 6px 9px;\n border-radius: 6px;\n font-size: 12px;\n line-height: 1.5;\n word-break: break-word;\n white-space: pre-wrap;\n}\n\n.rvs-banner.info {\n background: var(--rvs-hover);\n color: var(--rvs-fg2);\n}\n\n.rvs-banner.error {\n background: rgba(200, 60, 60, .16);\n color: var(--rvs-danger);\n}\n\n.rvs-banner.warn {\n background: rgba(226, 183, 20, .14);\n color: var(--rvs-git-m);\n}\n\n/* ------------------------------------------------- save conflict (refused) */\n\n/* The banner is a decision, not a message: it stacks its text over the actions\n so a narrow sidebar cannot squeeze the buttons into one unreadable row. */\n.rvs-conflict {\n display: flex;\n flex-direction: column;\n gap: 6px;\n white-space: normal;\n}\n\n.rvs-conflict-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.rvs-conflict-diff {\n margin: 6px 8px;\n max-height: 40vh;\n overflow: auto;\n border: 1px solid var(--rvs-border);\n border-radius: 6px;\n background: var(--rvs-hover);\n color: var(--rvs-fg2);\n font-family: var(--rvs-mono);\n font-size: 11.5px;\n line-height: 1.45;\n}\n\n.rvs-conflict-diff-head {\n position: sticky;\n top: 0;\n padding: 4px 8px;\n background: var(--rvs-panel, var(--rvs-hover));\n border-bottom: 1px solid var(--rvs-border);\n font-family: inherit;\n}\n\n.rvs-conflict-hunk-head {\n padding: 2px 8px;\n color: var(--rvs-fg3);\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-conflict-row {\n padding: 0 8px;\n white-space: pre;\n}\n\n.rvs-conflict-row.add {\n background: rgba(78, 201, 176, .14);\n color: var(--rvs-git-a);\n}\n\n.rvs-conflict-row.del {\n background: rgba(241, 76, 76, .12);\n color: var(--rvs-git-d);\n}\n\n.rvs-conflict-more {\n padding: 4px 8px;\n color: var(--rvs-fg3);\n}\n\n/* --------------------------------------------------------- source control */\n\n.rvs-scm-section {\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-scm-head {\n display: flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n padding: 0 6px 0 4px;\n cursor: pointer;\n user-select: none;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: .04em;\n text-transform: uppercase;\n color: var(--rvs-fg2);\n}\n\n.rvs-scm-head:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-scm-head .rvs-count {\n margin-left: 6px;\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0;\n color: var(--rvs-fg3);\n}\n\n.rvs-scm-head-actions {\n margin-left: auto;\n display: flex;\n align-items: center;\n gap: 2px;\n}\n\n.rvs-scm-section.collapsed > *:not(.rvs-scm-head) {\n display: none !important;\n}\n\n.rvs-chevron {\n flex: none;\n transition: transform .12s ease;\n}\n\n.rvs-chevron.open {\n transform: rotate(90deg);\n}\n\n.rvs-scm-item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 3px 8px 3px 22px;\n border: none;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12.5px;\n line-height: 19px;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-scm-item:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-scm-item.selected {\n background: var(--rvs-active);\n}\n\n.rvs-scm-path {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-scm-dir {\n flex: none;\n color: var(--rvs-fg3);\n}\n\n.rvs-scm-actions {\n flex: none;\n display: none;\n align-items: center;\n gap: 1px;\n}\n\n.rvs-scm-item:hover .rvs-scm-actions {\n display: flex;\n}\n\n.rvs-commit-box {\n flex: none;\n padding: 8px 10px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-commit-input {\n width: 100%;\n min-height: 58px;\n max-height: 180px;\n padding: 6px 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12.5px;\n line-height: 18px;\n resize: vertical;\n outline: none;\n}\n\n.rvs-commit-input:focus {\n border-color: var(--rvs-brand);\n}\n\n.rvs-commit-row {\n display: flex;\n gap: 6px;\n margin-top: 6px;\n}\n\n.rvs-commit-btn {\n flex: 1;\n padding: 5px 8px;\n border: none;\n border-radius: 6px;\n background: var(--rvs-accent);\n color: #fff;\n font: inherit;\n font-size: 12.5px;\n font-weight: 600;\n cursor: pointer;\n}\n\n.rvs-commit-btn:disabled {\n opacity: .45;\n cursor: default;\n}\n\n.rvs-repo-item {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 5px 10px 5px 12px;\n cursor: pointer;\n font-size: 12.5px;\n}\n\n.rvs-repo-item:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-repo-item.active {\n background: var(--rvs-active);\n}\n\n.rvs-repo-name {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-repo-branch {\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-pill {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 1px 8px;\n border-radius: 999px;\n background: var(--rvs-hover);\n font-size: 11px;\n font-weight: 600;\n color: var(--rvs-fg);\n}\n\n/* \"cached · refreshing\" badge: quieter than a pill that carries information the\n user asked for (a branch), because it is a qualifier on the list beside it. */\n.rvs-pill-cached {\n flex: none;\n font-weight: 500;\n color: var(--rvs-fg3);\n border: 1px solid var(--rvs-border2);\n background: transparent;\n}\n\n.rvs-subpanel {\n margin: 6px 8px;\n padding: 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n font-size: 12px;\n}\n\n.rvs-subpanel-head {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 6px;\n color: var(--rvs-fg2);\n font-weight: 600;\n}\n\n.rvs-chip {\n flex: none;\n padding: 2px 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 6px;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 11.5px;\n cursor: pointer;\n}\n\n.rvs-chip:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-chip.primary {\n background: var(--rvs-accent);\n border-color: transparent;\n color: #fff;\n}\n\n.rvs-chip.danger:hover {\n background: var(--rvs-danger);\n border-color: transparent;\n color: #fff;\n}\n\n.rvs-input {\n flex: 1;\n min-width: 0;\n padding: 4px 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 6px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12px;\n outline: none;\n}\n\n.rvs-input:focus {\n border-color: var(--rvs-brand);\n}\n\n.rvs-select {\n flex: 1;\n min-width: 0;\n padding: 3px 6px;\n border: 1px solid var(--rvs-border2);\n border-radius: 6px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12px;\n outline: none;\n color-scheme: light dark;\n}\n\n.rvs-select option {\n background: Canvas;\n color: CanvasText;\n}\n\n/* ------------------------------------------------- conversation-view mount */\n\n/**\n * Bound the center surface to the height the host gave the slot.\n *\n * `flex: 1 1 0` is the load-bearing declaration, and BOTH halves of it matter.\n * The host's own slot rules are:\n *\n * .wSkVaW_viewArea { flex: 1; min-height: 0; overflow: hidden }\n * [data-phase=active] .viewArea { flex: 1 0 auto; min-height: auto }\n * .wSkVaW_root { height: 100%; position: relative }\n *\n * While a conversation is active the slot's flex-basis is `auto`, so the slot's\n * height is driven by its child's INTRINSIC size. A full-height editor then\n * pushed it to 5510px for a 300-line file, the outer scroller took over, and\n * the tab strip and file info bar scrolled off the top with the code.\n *\n * `flex-basis: 0` breaks that cycle: the item stops contributing its content\n * height, so the slot stays the size the host intended and `.cm-scroller`\n * becomes the only scroller. Measured in the fixture (.spike/layout-fixture.html,\n * which mirrors the slot rules above) — only the bottom row fits:\n *\n * flex: 1 1 0 + min-height: 0 -> 736px OK\n * flex: 1 1 auto (i.e. `flex: 1`) -> 5510px broken\n * height: 0 + min-height: 100% -> 5510px broken\n * max-height: 100% -> 5510px broken\n * height: 100vh -> 5510px broken\n *\n * `height: 100%` is deliberately NOT set here any more. It resolves to `auto`\n * against a slot whose height is not definite — it reads like the fix but\n * measures as a no-op, which is how this regressed once already.\n *\n * NOT `position: absolute` either — that was another failed attempt: `.viewArea`\n * is not itself positioned, so `inset: 0` escaped to the host's `.wSkVaW_root`\n * (which is `position: relative`) and the plugin's global bar floated on top of\n * the host's 对话 / 轨迹 / 远程编辑器 tab row.\n *\n * The sidebar's `.rvs-viewslot` is deliberately not covered: it has a bounding\n * parent and this bug is specific to the conversation slot's `min-height: auto`\n * phase.\n */\n.rvs-center {\n flex: 1 1 0;\n display: flex;\n flex-direction: column;\n min-height: 0;\n min-width: 0;\n overflow: hidden;\n}\n\n/* ---------------------------------------------------------------- editor */\n\n/**\n * The editor shell keeps a code editor's proportions (30px tab strip, 26px\n * file info bar) rather than the surrounding panel's. Everything above the\n * code surface stays transparent and is separated only by\n * `--rvs-editor-chrome-border`, so the shell sits on any host background\n * without drawing a frame of its own. The `.rvs-center` rules further down\n * scale the same shell up for the full-width (conversation view) mount; the\n * float window keeps the compact size.\n */\n.rvs-etabs {\n flex: none;\n display: flex;\n align-items: stretch;\n gap: 1px;\n height: 30px;\n padding: 0;\n overflow-x: auto;\n overflow-y: hidden;\n background: transparent;\n border-bottom: 1px solid var(--rvs-editor-chrome-border);\n scrollbar-width: none;\n}\n\n.rvs-etabs::-webkit-scrollbar {\n height: 0;\n}\n\n.rvs-etab {\n flex: none;\n display: flex;\n align-items: center;\n gap: 4px;\n max-width: 190px;\n margin: 0;\n padding: 3px 6px;\n border: 0;\n border-right: 1px solid transparent;\n border-radius: 4px 4px 0 0;\n background: transparent;\n color: var(--rvs-fg3);\n font: inherit;\n font-size: 11px;\n white-space: nowrap;\n cursor: pointer;\n position: relative;\n}\n\n.rvs-etab:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg2);\n}\n\n/* The active tab is marked by the insert line under it, not by a filled\n block: the strip sits directly on the code surface. */\n.rvs-etab.active {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n box-shadow: inset 0 -2px 0 var(--rvs-accent);\n}\n\n.rvs-etab-name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-etab-glyph { color: var(--rvs-fg3); font-size: 10px; display: inline-flex; }\n\n.rvs-etab-diff .rvs-etab-glyph { color: var(--rvs-git-c); }\n\n/* Unsaved marker: a solid dot rather than a glyph, so its size does not\n follow the tab's font size. */\n.rvs-etab-dot {\n flex: none;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--rvs-git-m);\n}\n\n.rvs-etab-close {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0 1px;\n border: 0;\n border-radius: 3px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n line-height: 1;\n opacity: .45;\n}\n\n.rvs-etab-close:hover {\n opacity: 1;\n background: var(--rvs-hover);\n}\n\n/* File info bar: path on the left, actions on the right. The sidebar mount\n shows the path only (it has no room for a breadcrumb); the conversation\n mount swaps the path for one and appends its own action group. */\n.rvs-einfo {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n min-height: 26px;\n padding: 2px 6px;\n border-bottom: 1px solid var(--rvs-editor-chrome-border);\n background: transparent;\n color: inherit;\n font-size: 11px;\n}\n\n.rvs-einfo-path {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n /* Truncate from the LEFT (keep the tail) without reordering the text:\n `plaintext` gives the content its own LTR base direction, which is what\n stops a leading \"/\" from rendering as a trailing one. */\n direction: rtl;\n unicode-bidi: plaintext;\n text-align: left;\n}\n\n.rvs-einfo-spacer {\n margin-left: auto;\n}\n\n.rvs-einfo-actions {\n display: flex;\n align-items: center;\n gap: 2px;\n flex: 0 0 auto;\n}\n\n.rvs-einfo-actions-divider {\n width: 1px;\n height: 14px;\n margin: 0 2px;\n background: var(--rvs-editor-chrome-border);\n}\n\n/* Font A−/A+ glyphs: two letters read faster than two more icon shapes. */\n.rvs-font-glyph { font-size: 10.5px; font-weight: 600; letter-spacing: -.06em; }\n\n/* Conversation mount: one size up, and room to breathe. */\n.rvs-center .rvs-etabs { height: 34px; gap: 2px; padding: 0 6px; }\n\n.rvs-center .rvs-etab { font-size: 12.5px; padding: 5px 10px; max-width: 240px; gap: 6px; }\n\n.rvs-center .rvs-einfo { min-height: 32px; padding: 3px 10px; font-size: 12px; }\n\n.rvs-status.dirty { color: var(--rvs-git-m); }\n.rvs-status.saved { color: var(--rvs-git-a); }\n.rvs-status.saving { color: var(--rvs-fg2); }\n\n.rvs-body {\n flex: 1;\n min-height: 0;\n min-width: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n /* Anchors portalled overlays (the find widget) outside every scroller. */\n position: relative;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n}\n\n.rvs-editor-host {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n background: var(--rvs-code-bg);\n}\n\n/* Keep a panel mounted but out of layout (and out of the a11y tree). Used by\n the editor host in preview mode: unmounting it destroyed the buffer and the\n undo stack, hiding it preserves both. */\n.rvs-hidden {\n display: none !important;\n}\n\n/* Find-match marks. Painted by our own StateField (`findMatchHighlight`), and\n deliberately the SAME colours as the `.cm-searchMatch` rules below so the\n two paths cannot drift apart. */\n.rvs-find-match {\n background-color: rgba(226, 183, 20, .30);\n outline: 1px solid rgba(226, 183, 20, .55);\n border-radius: 2px;\n}\n\n.rvs-find-match.current {\n background-color: rgba(226, 183, 20, .48);\n}\n\n/* ------------------------------------------------------------- status bar */\n\n/**\n * VS Code-style status line: one 22px row of muted facts under the editor.\n * The surface is the editor panel colour (not the host background), which is\n * what separates it from the code surface above it in both themes.\n */\n.rvs-statusbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n flex: none;\n height: 22px;\n padding: 0 8px;\n font-size: 11px;\n color: var(--rvs-fg2);\n background: var(--rvs-editor-panel-bg);\n border-top: 1px solid var(--rvs-editor-chrome-border);\n}\n\n.rvs-status-left,\n.rvs-status-right {\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n overflow: hidden;\n}\n\n.rvs-status-item {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n white-space: nowrap;\n color: var(--rvs-fg3);\n}\n\n.rvs-status-btn {\n border: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n cursor: pointer;\n padding: 0 2px;\n border-radius: 3px;\n}\n\n.rvs-status-btn:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-status-error { color: var(--rvs-danger); }\n\n/* Conversation mount: the status line belongs to the editor, so it takes the\n panel's foreground instead of the sidebar's dimmer one. */\n.rvs-center .rvs-statusbar { background: var(--rvs-editor-panel-bg); color: var(--rvs-editor-panel-fg); }\n\n/* -------------------------------------------------------------- breadcrumb */\n\n/**\n * Breadcrumb over the full-width editor: path segments that open a sibling\n * picker on click. The navigation row itself is 22px and clips horizontally;\n * the dropdown is the only part that may overflow.\n *\n * The two child classes shared with the SCM repository picker\n * (`.rvs-crumb-wrap` / `.rvs-crumb`) are scoped to `.rvs-breadcrumb` here, and\n * the picker's own rules leave this subtree alone: one class, two surfaces,\n * neither restyled by the other.\n */\n.rvs-breadcrumb {\n position: relative;\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n min-width: 0;\n height: 22px;\n overflow: hidden;\n}\n\n.rvs-breadcrumb .rvs-crumb-wrap {\n display: inline-flex;\n align-items: center;\n min-width: 0;\n flex: 0 0 auto;\n max-width: 240px;\n}\n\n.rvs-crumb-sep {\n color: var(--rvs-fg3);\n margin: 0 1px;\n font-size: 10px;\n flex: 0 0 auto;\n opacity: .7;\n}\n\n.rvs-breadcrumb .rvs-crumb {\n border: 0;\n background: transparent;\n color: var(--rvs-fg2);\n font: inherit;\n font-size: 12px;\n padding: 1px 4px;\n border-radius: 4px;\n cursor: pointer;\n max-width: 240px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-breadcrumb .rvs-crumb:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-breadcrumb .rvs-crumb-file {\n color: var(--rvs-fg);\n font-weight: 600;\n}\n\n/* Sibling picker, positioned against `.rvs-breadcrumb`. */\n.rvs-crumb-menu {\n position: absolute;\n top: 100%;\n z-index: 30;\n min-width: 200px;\n max-width: 360px;\n max-height: 320px;\n display: flex;\n flex-direction: column;\n background: var(--rvs-editor-panel-bg);\n color: var(--rvs-editor-panel-fg);\n border: 1px solid var(--rvs-editor-chrome-border);\n border-radius: 6px;\n box-shadow: 0 6px 20px rgba(0, 0, 0, .35);\n overflow: hidden;\n}\n\n.rvs-crumb-menu-head {\n display: flex;\n align-items: center;\n gap: 4px;\n flex: 0 0 auto;\n padding: 3px 6px;\n border-bottom: 1px solid var(--rvs-editor-chrome-border);\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n.rvs-crumb-menu-up {\n flex: 0 0 auto;\n width: 20px;\n height: 20px;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: var(--rvs-fg2);\n cursor: pointer;\n line-height: 1;\n}\n\n.rvs-crumb-menu-up:hover:not(:disabled) { background: var(--rvs-hover); color: var(--rvs-fg); }\n\n.rvs-crumb-menu-up:disabled { opacity: .3; cursor: default; }\n\n.rvs-crumb-menu-path {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n direction: rtl;\n unicode-bidi: plaintext;\n text-align: left;\n}\n\n.rvs-crumb-menu-list {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n padding: 2px 0;\n}\n\n.rvs-crumb-menu-note {\n padding: 6px 10px;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n/* The note doubles as the dropdown's error line (see `.rvs-status-error`);\n the compound selector outranks the note's own muted colour. */\n.rvs-crumb-menu-note.rvs-status-error { color: var(--rvs-danger); }\n\n.rvs-crumb-menu-item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 4px 10px;\n border: 0;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12px;\n text-align: left;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.rvs-crumb-menu-item:hover { background: var(--rvs-hover); }\n\n.rvs-crumb-menu-item.rvs-dir { color: var(--rvs-fg2); }\n\n.rvs-crumb-menu-glyph { width: 10px; flex: 0 0 auto; color: var(--rvs-fg3); font-size: 10px; }\n\n.rvs-crumb-menu-name { overflow: hidden; text-overflow: ellipsis; }\n\n/* --------------------------------------------------------- image preview */\n\n/**\n * Binary image preview: `fit` scales the picture to the pane, `actual` keeps\n * natural pixels inside a scrollable one. The meta line stays out of the\n * picture's way (bottom, dim).\n */\n.rvs-image-preview {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n overflow: auto;\n padding: 12px;\n cursor: zoom-in;\n background: var(--rvs-code-bg);\n}\n\n.rvs-image-preview.rvs-image-actual {\n cursor: zoom-out;\n align-items: flex-start;\n justify-content: flex-start;\n}\n\n.rvs-image-preview-img {\n max-width: 100%;\n max-height: calc(100% - 24px);\n object-fit: contain;\n image-rendering: auto;\n}\n\n.rvs-image-actual .rvs-image-preview-img {\n max-width: none;\n max-height: none;\n}\n\n.rvs-image-preview-meta {\n display: flex;\n gap: 10px;\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-image-preview-hint { opacity: .75; }\n\n.rvs-image-preview-failed {\n cursor: default;\n color: var(--rvs-fg2);\n text-align: center;\n}\n\n/* -------------------------------------------------- editor notices / empty */\n\n/* Read-only / binary / loading copy inside the editor body. */\n.rvs-editor-notice {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 16px;\n font-size: 12px;\n color: var(--rvs-fg3);\n background: var(--rvs-code-bg);\n text-align: center;\n}\n\n.rvs-editor-notice-title {\n color: var(--rvs-fg);\n font-size: 13px;\n margin-bottom: 6px;\n}\n\n/* Conversation mount with no open file: say where files come from instead of\n leaving the pane blank. */\n.rvs-editor-empty {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 24px;\n text-align: center;\n color: var(--rvs-fg3);\n}\n\n.rvs-editor-empty-glyph {\n font-size: 34px;\n line-height: 1;\n opacity: .3;\n}\n\n.rvs-editor-empty-title {\n font-size: 15px;\n font-weight: 600;\n color: var(--rvs-fg);\n}\n\n.rvs-editor-empty-hint {\n font-size: 12px;\n line-height: 1.7;\n max-width: 560px;\n}\n\n/* Quieter empty state for the compact panes. */\n.rvs-empty-title {\n font-size: 13px;\n color: var(--rvs-fg2);\n}\n\n.rvs-empty-hint {\n font-size: 11px;\n color: var(--rvs-fg3);\n margin-top: 4px;\n}\n\n/* ------------------------------------------------------- preview surfaces */\n\n/* Image previews are the ported `.rvs-image-preview*` block above: the old\n plain `<img>` shell (`rvs-preview-img`) had no other user and was removed\n with the pane that rendered it. */\n.rvs-markdown {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 12px 14px 24px;\n font-size: 13px;\n line-height: 1.7;\n color: var(--rvs-code-fg);\n background: var(--rvs-code-bg);\n user-select: text;\n}\n\n.rvs-markdown h1, .rvs-markdown h2, .rvs-markdown h3, .rvs-markdown h4 {\n margin: 14px 0 6px;\n line-height: 1.35;\n}\n\n.rvs-markdown h1 { font-size: 19px; border-bottom: 1px solid var(--rvs-border); padding-bottom: 5px; }\n.rvs-markdown h2 { font-size: 16px; border-bottom: 1px solid var(--rvs-border); padding-bottom: 4px; }\n.rvs-markdown h3 { font-size: 14px; }\n.rvs-markdown p { margin: 6px 0; }\n.rvs-markdown ul, .rvs-markdown ol { margin: 6px 0; padding-left: 22px; }\n.rvs-markdown li { margin: 2px 0; }\n.rvs-markdown code {\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--rvs-hover);\n font-family: var(--rvs-mono);\n font-size: 12px;\n}\n.rvs-markdown pre {\n margin: 8px 0;\n padding: 9px 11px;\n border-radius: 8px;\n background: var(--rvs-input);\n overflow-x: auto;\n}\n.rvs-markdown pre code { padding: 0; background: transparent; }\n.rvs-markdown blockquote {\n margin: 8px 0;\n padding: 2px 12px;\n border-left: 3px solid var(--rvs-border2);\n color: var(--rvs-fg2);\n}\n.rvs-markdown a { color: var(--dsw-alias-label-link, #58a6ff); text-decoration: none; }\n.rvs-markdown a:hover { text-decoration: underline; }\n.rvs-markdown table { border-collapse: collapse; margin: 8px 0; font-size: 12px; }\n.rvs-markdown th, .rvs-markdown td { border: 1px solid var(--rvs-border2); padding: 4px 8px; }\n.rvs-markdown hr { border: none; border-top: 1px solid var(--rvs-border); margin: 12px 0; }\n\n.rvs-html-frame {\n flex: 1;\n min-height: 0;\n width: 100%;\n border: none;\n background: #fff;\n}\n\n/* ------------------------------------------------------------------ diff */\n\n.rvs-diff {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.rvs-diff-toolbar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 3px 8px;\n border-bottom: 1px solid var(--rvs-border);\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n/**\n * Prev/next change, in the toolbar's free space.\n *\n * Two chevrons around a tabular counter: the pair then reads as \"jump to change\n * n of N\" instead of two anonymous arrows, and the counter doubles as the \"where\n * am I\" cue while scrolling by hand.\n */\n.rvs-hunknav {\n display: inline-flex;\n align-items: center;\n gap: 1px;\n margin-right: 2px;\n}\n\n.rvs-hunknav-pos {\n min-width: 30px;\n text-align: center;\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n color: var(--rvs-fg3);\n user-select: none;\n}\n\n.rvs-seg {\n display: inline-flex;\n border: 1px solid var(--rvs-border2);\n border-radius: 6px;\n overflow: hidden;\n}\n\n.rvs-seg button {\n padding: 2px 9px;\n border: none;\n background: transparent;\n color: var(--rvs-fg2);\n font: inherit;\n font-size: 11px;\n cursor: pointer;\n}\n\n.rvs-seg button.active {\n background: var(--rvs-active);\n color: var(--rvs-fg);\n}\n\n.rvs-seg button:hover:not(.active) {\n background: var(--rvs-hover);\n}\n\n.rvs-diff-grid {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n overflow-x: hidden;\n font-family: var(--rvs-mono);\n font-size: 12px;\n line-height: 18px;\n scrollbar-width: thin;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n}\n\n/**\n * Top horizontal scrollbar.\n *\n * The two panes scroll horizontally on their own — so a long line can never\n * widen the layout — and this proxy bar drives both of them from the TOP of\n * the view, instead of forcing a scroll to the bottom of the file to reach a\n * horizontal bar. Its inner spacer is sized to the widest line, and the\n * component only renders it when a line really is wider than the grid.\n *\n * Sized and coloured to be SEEN: as a 13 px band with `scrollbar-width: thin`\n * and a faint thumb, it read as \"there is no horizontal scrollbar at all\".\n */\n.rvs-hbar {\n flex: none;\n height: 15px;\n overflow-x: auto;\n overflow-y: hidden;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-hover);\n}\n\n.rvs-hbar-inner {\n height: 1px;\n}\n\n.rvs-hbar::-webkit-scrollbar {\n height: 11px;\n}\n\n.rvs-hbar::-webkit-scrollbar-thumb {\n background: var(--dsw-alias-scrollbar-bg-l2, rgba(150, 160, 180, .75));\n border-radius: 6px;\n border: 2px solid transparent;\n background-clip: padding-box;\n}\n\n.rvs-hbar::-webkit-scrollbar-thumb:hover {\n background: var(--dsw-alias-scrollbar-hover-l2, rgba(170, 180, 200, .95));\n background-clip: padding-box;\n}\n\n.rvs-hbar::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.rvs-diff-cols {\n display: flex;\n align-items: stretch;\n min-width: 0;\n}\n\n/**\n * One diff pane. `flex: 1 1 0` keeps the panes EXACTLY equal however long a\n * line is (the previous row markup let a long line widen its own pane, which\n * is what broke the symmetry). Each pane keeps its own horizontal scroll, and\n * its scrollbar is now VISIBLE: the top proxy remains the convenient control,\n * but the pane's own bar is what a user reaches for first, and it sits right\n * under the content when the file is shorter than the view.\n */\n.rvs-diff-col {\n flex: 1 1 0;\n min-width: 0;\n overflow-x: auto;\n overflow-y: hidden;\n}\n\n.rvs-diff-col::-webkit-scrollbar {\n height: 9px;\n width: 0;\n}\n\n.rvs-diff-col::-webkit-scrollbar-thumb {\n background: var(--dsw-alias-scrollbar-bg-l2, rgba(150, 160, 180, .6));\n border-radius: 5px;\n}\n\n.rvs-diff-col::-webkit-scrollbar-thumb:hover {\n background: var(--dsw-alias-scrollbar-hover-l2, rgba(170, 180, 200, .85));\n}\n\n.rvs-diff-col::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.rvs-dline {\n display: flex;\n align-items: flex-start;\n height: 18px;\n line-height: 18px;\n white-space: pre;\n}\n\n.rvs-dline-num {\n /* Pinned while the line scrolls sideways, so a long line never takes the\n line numbers away with it. */\n position: sticky;\n left: 0;\n z-index: 1;\n flex: none;\n width: 3.4em;\n padding-right: 6px;\n text-align: right;\n color: var(--rvs-fg3);\n opacity: .85;\n user-select: none;\n background: var(--rvs-code-bg);\n}\n\n.rvs-row-del .rvs-dline-num {\n background: var(--rvs-del-solid);\n}\n\n.rvs-row-add .rvs-dline-num {\n background: var(--rvs-add-solid);\n}\n\n.rvs-dline-text {\n flex: 1;\n padding-right: 10px;\n user-select: text;\n}\n\n.rvs-gutter-col {\n flex: none;\n width: 30px;\n border-left: 1px solid var(--rvs-border);\n border-right: 1px solid var(--rvs-border);\n user-select: none;\n}\n\n.rvs-gutter-line {\n height: 18px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.rvs-diff-grid::-webkit-scrollbar {\n width: 9px;\n height: 0;\n}\n\n.rvs-diff-grid::-webkit-scrollbar-thumb {\n background: var(--dsw-alias-scrollbar-bg-l2, rgba(127, 127, 127, .4));\n border-radius: 4px;\n}\n\n.rvs-num {\n flex: none;\n display: inline-block;\n width: 3.2em;\n padding-right: 6px;\n text-align: right;\n color: var(--rvs-fg3);\n opacity: .6;\n user-select: none;\n}\n\n.rvs-row-del {\n background: var(--rvs-del-bg);\n}\n\n.rvs-row-del .rvs-dline-text,\n.rvs-row-del .rvs-dline-num,\n.rvs-row-del .rvs-num {\n color: #f14c4c;\n}\n\n.rvs-row-add {\n background: var(--rvs-add-bg);\n}\n\n.rvs-row-add .rvs-dline-text,\n.rvs-row-add .rvs-dline-num,\n.rvs-row-add .rvs-num {\n color: #4ec9b0;\n}\n\n.rvs-row-empty {\n color: var(--rvs-fg3);\n opacity: .35;\n}\n\n.rvs-gutter {\n flex: none;\n width: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-left: 1px solid var(--rvs-border);\n border-right: 1px solid var(--rvs-border);\n user-select: none;\n}\n\n.rvs-gutter-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n opacity: .7;\n}\n\n.rvs-hunk-btns {\n display: flex;\n gap: 2px;\n}\n\n.rvs-hunk-btn {\n width: 13px;\n height: 15px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n border-radius: 3px;\n background: transparent;\n color: var(--rvs-fg3);\n font-size: 11px;\n line-height: 1;\n cursor: pointer;\n}\n\n.rvs-hunk-btn:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-hunk-btn.stage:hover {\n color: var(--rvs-git-a);\n}\n\n.rvs-hunk-btn.revert:hover {\n color: var(--rvs-git-d);\n}\n\n/**\n * Token colors: VS Code Dark+ / Light+, matching the CodeMirror theme in\n * `vsc/editor-theme.ts`. Keeping ONE palette for both surfaces means a file\n * does not change colors when the diff is switched to its editable side.\n */\n.rvs-t-comment { color: #6a9955; }\n.rvs-t-string { color: #ce9178; }\n.rvs-t-keyword { color: #569cd6; }\n.rvs-t-number { color: #b5cea8; }\n.rvs-t-func { color: #dcdcaa; }\n.rvs-t-type { color: #4ec9b0; }\n.rvs-t-attr { color: #9cdcfe; }\n.rvs-t-variable { color: #9cdcfe; }\n.rvs-t-operator { color: #d4d4d4; }\n.rvs-t-punct { color: #d4d4d4; }\n.rvs-t-tag { color: #569cd6; }\n.rvs-t-meta { color: #c586c0; }\n.rvs-t-insert { color: #4ec9b0; }\n.rvs-t-delete { color: #f14c4c; }\n\nbody:not([data-ds-dark-theme]) .rvs-t-comment { color: #008000; }\nbody:not([data-ds-dark-theme]) .rvs-t-string { color: #a31515; }\nbody:not([data-ds-dark-theme]) .rvs-t-keyword { color: #0000ff; }\nbody:not([data-ds-dark-theme]) .rvs-t-number { color: #098658; }\nbody:not([data-ds-dark-theme]) .rvs-t-func { color: #795e26; }\nbody:not([data-ds-dark-theme]) .rvs-t-type { color: #267f99; }\nbody:not([data-ds-dark-theme]) .rvs-t-attr,\nbody:not([data-ds-dark-theme]) .rvs-t-variable { color: #001080; }\nbody:not([data-ds-dark-theme]) .rvs-t-operator,\nbody:not([data-ds-dark-theme]) .rvs-t-punct { color: #1f1f1f; }\nbody:not([data-ds-dark-theme]) .rvs-t-meta { color: #af00db; }\n\n/**\n * CodeMirror token colors, applied through FIXED class names emitted by the\n * highlight style (`vsc/editor-palette.ts`). Fixed names mean the colors come\n * from this stylesheet — the same one that paints the rest of the UI — so a\n * code file can never go monochrome because a generated class name changed or\n * an injected style failed. Same Dark+ / Light+ palette as the diff panes\n * above, so a file keeps its colors when switching between the two views.\n */\n.rvs-ck-comment { color: #6a9955; }\n.rvs-ck-keyword { color: #569cd6; }\n.rvs-ck-control { color: #c586c0; }\n.rvs-ck-string { color: #ce9178; }\n.rvs-ck-regexp { color: #d16969; }\n.rvs-ck-number { color: #b5cea8; }\n.rvs-ck-constant { color: #569cd6; }\n.rvs-ck-func { color: #dcdcaa; }\n.rvs-ck-type { color: #4ec9b0; }\n.rvs-ck-variable { color: #9cdcfe; }\n.rvs-ck-attr { color: #9cdcfe; }\n.rvs-ck-meta { color: #c586c0; }\n.rvs-ck-punct { color: #d4d4d4; }\n.rvs-ck-op { color: #d4d4d4; }\n.rvs-ck-heading { color: #569cd6; font-weight: 700; }\n.rvs-ck-em { font-style: italic; }\n.rvs-ck-link { color: #9cdcfe; text-decoration: underline; }\n.rvs-ck-strike { text-decoration: line-through; }\n.rvs-ck-invalid { color: #f44747; }\n\nbody:not([data-ds-dark-theme]) .rvs-ck-comment { color: #008000; }\nbody:not([data-ds-dark-theme]) .rvs-ck-keyword { color: #0000ff; }\nbody:not([data-ds-dark-theme]) .rvs-ck-control { color: #af00db; }\nbody:not([data-ds-dark-theme]) .rvs-ck-string { color: #a31515; }\nbody:not([data-ds-dark-theme]) .rvs-ck-regexp { color: #811f3f; }\nbody:not([data-ds-dark-theme]) .rvs-ck-number { color: #098658; }\nbody:not([data-ds-dark-theme]) .rvs-ck-constant { color: #0070c1; }\nbody:not([data-ds-dark-theme]) .rvs-ck-func { color: #795e26; }\nbody:not([data-ds-dark-theme]) .rvs-ck-type { color: #267f99; }\nbody:not([data-ds-dark-theme]) .rvs-ck-variable { color: #001080; }\nbody:not([data-ds-dark-theme]) .rvs-ck-attr { color: #e50000; }\nbody:not([data-ds-dark-theme]) .rvs-ck-meta { color: #0000ff; }\nbody:not([data-ds-dark-theme]) .rvs-ck-punct,\nbody:not([data-ds-dark-theme]) .rvs-ck-op { color: #1f1f1f; }\nbody:not([data-ds-dark-theme]) .rvs-ck-heading { color: #0000ff; }\nbody:not([data-ds-dark-theme]) .rvs-ck-link { color: #001080; }\nbody:not([data-ds-dark-theme]) .rvs-ck-invalid { color: #cd3131; }\n\n/**\n * Opaque editor surface, also as plain CSS: the CodeMirror theme paints it too\n * (following the scheme through a Compartment), but a transparent editor is\n * the one failure a user notices immediately, so the container states it as\n * well.\n */\n.rvs-edge .cm-editor,\n.rvs-edge .cm-scroller,\n.rvs-edge .cm-gutters {\n background-color: var(--rvs-code-bg);\n}\n\n.rvs-edge .cm-editor {\n color: var(--rvs-code-fg);\n}\n\n.rvs-edge .cm-gutters {\n color: var(--rvs-code-gutter-fg, var(--rvs-fg3));\n border-right: 1px solid var(--rvs-border);\n}\n\n.rvs-edge .cm-activeLine {\n background-color: rgba(127, 127, 127, .08);\n}\n\n.rvs-edge .cm-activeLineGutter {\n background-color: rgba(127, 127, 127, .12);\n}\n\n/**\n * The code editor's own scrollbars.\n *\n * These had NO rule at all: CodeMirror's scroller is `.cm-scroller`, which is\n * none of `.rvs-scroll` / `.rvs-diff-grid` / `.rvs-hbar`, so the editor fell\n * back to the browser default — too thin to hit with a mouse.\n *\n * Both notations are needed and must stay in step: Chromium honours\n * `scrollbar-width` over `::-webkit-scrollbar` when both apply, so setting\n * only the webkit half would silently have no effect. Keep the numbers equal.\n */\n.rvs-edge .cm-scroller {\n scrollbar-width: auto;\n}\n\n.rvs-edge .cm-scroller::-webkit-scrollbar {\n width: 14px;\n height: 14px;\n}\n\n.rvs-edge .cm-scroller::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.rvs-edge .cm-scroller::-webkit-scrollbar-thumb {\n /* Opaque, not a translucent token: a thin wash over code is exactly the\n low-contrast target that is hard to grab. */\n background: rgba(121, 121, 121, .8);\n border: 3px solid transparent;\n border-radius: 7px;\n background-clip: padding-box;\n min-height: 36px;\n}\n\n.rvs-edge .cm-scroller::-webkit-scrollbar-thumb:hover {\n background: rgba(150, 150, 150, .95);\n border: 3px solid transparent;\n background-clip: padding-box;\n}\n\n.rvs-edge .cm-scroller::-webkit-scrollbar-corner {\n background: transparent;\n}\n\n/* ------------------------------------------------------------ find widget */\n\n/**\n * \"You landed here\": the transient highlight on the line a jump landed on\n * (search hit, @-reference).\n *\n * Deliberately NOT a warm/amber wash: over the dark editor that muddies into a\n * brown-black band that reads as a shadow and swallows annotation colors. This\n * is the accent blue instead — a tinted band with a bright edge on the left and\n * hairlines top/bottom, so it reads as a marked region while every token keeps\n * its own colour and contrast.\n */\n.rvs-reveal-line {\n background-color: rgba(88, 166, 255, .22);\n box-shadow:\n inset 3px 0 0 0 #58a6ff,\n inset 0 1px 0 0 rgba(88, 166, 255, .38),\n inset 0 -1px 0 0 rgba(88, 166, 255, .38);\n}\n\nbody:not([data-ds-dark-theme]) .rvs-reveal-line {\n background-color: rgba(77, 107, 254, .14);\n box-shadow:\n inset 3px 0 0 0 #4d6bfe,\n inset 0 1px 0 0 rgba(77, 107, 254, .35),\n inset 0 -1px 0 0 rgba(77, 107, 254, .35);\n}\n\n/* --------------------------------------------------------- session changes */\n\n/**\n * 「本会话改了什么」:代码行背景 + 左侧改动栏(Cursor 风格)。\n *\n * 三种形态必须**一眼分得开**,光靠绿/红两个色相不够(色弱用户看新增行和删除行\n * 会糊成同一片),所以每种的左侧色条宽度/花样的语义也不同:\n * - 新增:实心绿条;\n * - 修改:实心蓝条(不是绿:修改块里既有留下的行也有新写的行,用\"中性的已变更\"\n * 色不会误导读者以为整块都是新内容);\n * - 删除:**斜纹**红底 + 更粗的红条 —— 这一行其实已经不存在了,只在中止位置上\n * 留个锚点,斜纹是这一层\"虚\"的信息里最不容易被当成真内容的花样。\n *\n * 选择器带上 `.cm-line`:`.cm-activeLine` 由 CodeMirror 的主题注入(运行时\n * `<style>`,通常排在本文档之后),只写 `.rvs-change-*` 两者同权重时会输给它,\n * 光标所在的那一行改动就会消失。\n */\n.rvs-edge .cm-line.rvs-change-add {\n background-color: rgba(46, 160, 67, .17);\n box-shadow:\n inset 3px 0 0 0 #2ea043,\n inset 0 -1px 0 0 rgba(46, 160, 67, .28);\n}\n\n.rvs-edge .cm-line.rvs-change-mod {\n background-color: rgba(56, 139, 253, .15);\n box-shadow:\n inset 3px 0 0 0 #388bfd,\n inset 0 -1px 0 0 rgba(56, 139, 253, .28);\n}\n\n.rvs-edge .cm-line.rvs-change-del {\n background-color: rgba(248, 81, 73, .09);\n background-image: repeating-linear-gradient(135deg, rgba(248, 81, 73, .17) 0 6px, transparent 6px 12px);\n box-shadow: inset 4px 0 0 0 #f85149;\n}\n\n/* 改动栏本身:符号 + 一列与行背景同色的窄条,读起来才是一条\"改动边\"。 */\n.rvs-edge .cm-gutterElement.rvs-change-gutter-add {\n box-shadow: inset 2px 0 0 0 #2ea043;\n}\n\n.rvs-edge .cm-gutterElement.rvs-change-gutter-mod {\n box-shadow: inset 2px 0 0 0 #388bfd;\n}\n\n.rvs-edge .cm-gutterElement.rvs-change-gutter-del {\n box-shadow: inset 2px 0 0 0 #f85149;\n}\n\n.rvs-edge .rvs-change-mark {\n display: inline-block;\n width: 12px;\n font-family: var(--rvs-mono);\n font-size: 12px;\n line-height: 1;\n text-align: center;\n user-select: none;\n}\n\n.rvs-edge .rvs-change-mark-add { color: #2ea043; }\n.rvs-edge .rvs-change-mark-mod { color: #388bfd; }\n.rvs-edge .rvs-change-mark-del { color: #f85149; }\n\n/**\n * 行内(字符级)差异:上面那三种底色回答\"哪几行变了\",这两条回答\"那一行的哪几个\n * 字变了\"。只改一个词的编辑,整行同色时完全看不出改了什么。\n *\n * `rvs-change-word-add` 刻意**只给背景、不给 `color`**:代码有自己的语法着色,\n * 覆盖前景色会把关键字/字符串/注释染成同一种颜色,比不标还难读。透明度压在行\n * 底色之上一点点,叠起来仍读得出\"整块改动\"的边界,又能看出块内哪几个字是新的。\n */\n.rvs-edge .rvs-change-word-add {\n background-color: rgba(46, 160, 67, .22);\n border-radius: 2px;\n}\n\n/**\n * 被删掉、在新文件里已经不存在的内容:零宽 widget,红底 + 删除线。\n *\n * 删除线画在 chip 自己身上(chip 是独立元素,不会波及周围代码);`white-space:\n * pre` 保留被删文本自己的缩进 —— 截断/去空白都会让 chip 谎报\"删了什么\"。\n * 字号略小 + 降一点不透明度,是让它读起来像\"残留物\"而不是一行真代码。\n */\n.rvs-edge .rvs-change-word-del {\n padding: 0 3px;\n margin: 0 1px;\n border-radius: 3px;\n background-color: rgba(248, 81, 73, .18);\n font-size: .92em;\n text-decoration: line-through;\n opacity: .85;\n white-space: pre;\n}\n\n/**\n * 撑宽度的隐形符号:只用它占位,绝不显示(见 `change-marks.ts` 的 SpacerMarker,\n * CodeMirror 会给这个 spacer 元素加 `visibility: hidden`,这里不重复声明)。\n */\n.rvs-edge .rvs-change-spacer {\n opacity: 0;\n}\n\n/* 浅色主题:同样的色相,压暗 + 提高不透明度,在近白底上才看得清。 */\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-line.rvs-change-add {\n background-color: rgba(31, 136, 61, .13);\n box-shadow:\n inset 3px 0 0 0 #1f883d,\n inset 0 -1px 0 0 rgba(31, 136, 61, .22);\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-line.rvs-change-mod {\n background-color: rgba(9, 105, 218, .12);\n box-shadow:\n inset 3px 0 0 0 #0969da,\n inset 0 -1px 0 0 rgba(9, 105, 218, .22);\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-line.rvs-change-del {\n background-color: rgba(207, 34, 46, .07);\n background-image: repeating-linear-gradient(135deg, rgba(207, 34, 46, .14) 0 6px, transparent 6px 12px);\n box-shadow: inset 4px 0 0 0 #cf222e;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-gutterElement.rvs-change-gutter-add {\n box-shadow: inset 2px 0 0 0 #1f883d;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-gutterElement.rvs-change-gutter-mod {\n box-shadow: inset 2px 0 0 0 #0969da;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .cm-gutterElement.rvs-change-gutter-del {\n box-shadow: inset 2px 0 0 0 #cf222e;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-mark-add { color: #1f883d; }\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-mark-mod { color: #0969da; }\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-mark-del { color: #cf222e; }\n\n/* 浅色主题的行内差异:同样的色相压暗,在近白底上才看得清(暗色那套会糊成一片)。 */\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-word-add {\n background-color: rgba(26, 127, 55, .18);\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-word-del {\n background-color: rgba(207, 34, 46, .14);\n}\n\n/**\n * 整块删除:一枚带行数的胶囊,不是一行划掉的文字。\n *\n * 多行删除的原文是一个段落,划线堆在锚点行首只会糊成一片(数据层因此把 `count > 1`\n * 的 chip 压成一枚,见 `change-marks.ts` 的 `RemovedChipWidget`)。这里只做外形:\n * 去掉继承来的删除线(胶囊不是\"被划掉的字符串\"),字号与计数对齐,别把行高撑开。\n */\n.rvs-edge .rvs-change-block-del {\n padding: 0 4px;\n margin: 0 1px;\n border-radius: 3px;\n background-color: rgba(248, 81, 73, .18);\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n text-decoration: none;\n opacity: 1;\n white-space: nowrap;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-edge .rvs-change-block-del {\n background-color: rgba(207, 34, 46, .14);\n}\n\n/**\n * 改动跳转按钮:浮在编辑器右上角。\n *\n * 放在编辑器上而不是面板里 —— 文件打开后光标就在这里,而面板可能被收起、被滚走。\n * 容器 `.rvs-body` 已经是 `position: relative`(它本来用于挂 find 浮层),所以这里\n * 只做绝对定位,不引入新的定位上下文。`pointer-events` 只开在按钮上:这块区域压在\n * 编辑器文字上方,整块可点会把右上角那几行变成死区。\n */\n.rvs-change-nav {\n position: absolute;\n top: 8px;\n right: 14px;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 3px 4px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n background: Canvas;\n box-shadow: 0 2px 8px rgba(0, 0, 0, .28);\n pointer-events: none;\n}\n\n/* The counter is what makes this read as \"3 of 7 changes\" rather than two\n anonymous arrows — and it keeps the buttons from looking like decoration. */\n.rvs-change-nav-count {\n padding: 0 6px 0 4px;\n color: var(--rvs-fg2);\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n line-height: 22px;\n white-space: nowrap;\n}\n\n.rvs-change-nav-btn {\n width: 26px;\n height: 22px;\n padding: 0;\n border: 1px solid transparent;\n border-radius: 5px;\n background: transparent;\n color: var(--rvs-fg);\n font-size: 13px;\n font-weight: 600;\n line-height: 20px;\n text-align: center;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.rvs-change-nav-btn:hover {\n border-color: var(--rvs-border2);\n background: var(--rvs-hover);\n color: var(--rvs-brand);\n}\n\n.rvs-change-nav-btn:active { background: var(--rvs-active); }\n\n/**\n * 悬浮在改动行上出现的「撤销这处改动」按钮。\n *\n * 它**不在编辑器的 DOM 里**:`undo-affordance.ts` 把它当 `position: fixed` 的元素挂到\n * `document.body`(和「添加到对话」那个浮层同一套做法),所以这里的选择器不带\n * `.rvs-edge` —— 带上了就一条都不生效。固定定位 + 高 z-index 是刻意的:宿主容器有\n * `overflow: hidden`,挂在里面会被 CodeMirror 的滚动层裁掉。\n *\n * 颜色按\"危险动作\"给:默认红边红字、悬停实心红。底色不透明(不用半透明的 overlay\n * token),否则后面的代码文字会透出来。\n */\n.rvs-undo-affordance {\n position: fixed;\n z-index: 2100;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n max-width: 220px;\n padding: 3px 9px;\n border: 1px solid #f85149;\n border-radius: 6px;\n background-color: #1e2229;\n color: #ffb4ae;\n /* 按钮挂在 body 上,没有 .rvs-edge 的字体上下文:跟随宿主页面字体。 */\n font-family: inherit;\n font-size: 12px;\n line-height: 1.5;\n white-space: nowrap;\n cursor: pointer;\n box-shadow: 0 6px 18px rgba(0, 0, 0, .45);\n /* 纵向以悬停行的中线对齐(横向坐标由 JS 按行尾算好)。 */\n transform: translateY(-50%);\n}\n\n.rvs-undo-affordance:hover {\n background-color: #f85149;\n border-color: #f85149;\n color: #fff;\n}\n\n.rvs-undo-affordance:active {\n transform: translateY(-50%) scale(.97);\n}\n\n.rvs-undo-affordance:focus-visible {\n outline: 2px solid #58a6ff;\n outline-offset: 1px;\n}\n\n/* 删除锚点:这一行其实已经不在了,虚线边框把它和\"真实存在的行\"分开。 */\n.rvs-undo-affordance[data-kind=\"del\"] {\n border-style: dashed;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-undo-affordance {\n border-color: #cf222e;\n background-color: #ffffff;\n color: #a40e26;\n box-shadow: 0 6px 18px rgba(31, 35, 40, .18);\n}\n\nbody:not([data-ds-dark-theme]) .rvs-undo-affordance:hover {\n background-color: #cf222e;\n border-color: #cf222e;\n color: #fff;\n}\n\nbody:not([data-ds-dark-theme]) .rvs-undo-affordance:focus-visible {\n outline-color: #4d6bfe;\n}\n\n/**\n * CodeMirror's own search decorations, also stated here: the editor's theme is\n * injected by the library, and these must stay readable even when only this\n * stylesheet is in play.\n */\n.rvs-edge .cm-searchMatch {\n background-color: rgba(226, 183, 20, .30);\n outline: 1px solid rgba(226, 183, 20, .55);\n}\n\n.rvs-edge .cm-searchMatch-selected {\n background-color: rgba(226, 183, 20, .48);\n}\n\n.rvs-edge .cm-selectionBackground,\n.rvs-edge .cm-content ::selection {\n background-color: rgba(58, 110, 165, .55) !important;\n}\n\n/** Build stamp in the editor info bar: identifies the loaded client bundle. */\n.rvs-build {\n flex: none;\n padding: 0 5px;\n border: 1px solid var(--rvs-border);\n border-radius: 4px;\n color: var(--rvs-fg3);\n font-size: 10px;\n font-family: var(--rvs-mono);\n opacity: .85;\n user-select: text;\n}\n\n/**\n * Find box, aligned with the editor panel it floats over.\n *\n * It is PORTALLED to <body>, i.e. OUTSIDE `.rvs-root` where the editor tokens\n * are declared, so it carries that subset itself (same rule as the other\n * portalled panels): the dark block right below flips it back.\n */\n.rvs-find {\n --rvs-editor-panel-bg: #f3f3f3;\n --rvs-editor-panel-fg: #1f1f1f;\n --rvs-editor-input-bg: #ffffff;\n --rvs-editor-chrome-border: rgba(0, 0, 0, .12);\n position: absolute;\n top: 6px;\n right: 18px;\n z-index: 30;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 3px 4px 3px 7px;\n border: 1px solid var(--rvs-editor-chrome-border);\n border-radius: 8px;\n background: var(--rvs-editor-panel-bg);\n color: var(--rvs-editor-panel-fg);\n box-shadow: 0 4px 14px rgba(0, 0, 0, .28);\n font-size: 12px;\n}\n\nbody[data-ds-dark-theme] .rvs-find {\n --rvs-editor-panel-bg: #252526;\n --rvs-editor-panel-fg: #cccccc;\n --rvs-editor-input-bg: #3c3c3c;\n --rvs-editor-chrome-border: rgba(255, 255, 255, .12);\n}\n\n.rvs-find-input {\n width: 170px;\n padding: 2px 6px;\n border: 1px solid var(--rvs-editor-chrome-border);\n border-radius: 5px;\n background: var(--rvs-editor-input-bg);\n color: var(--rvs-editor-panel-fg);\n font: inherit;\n font-size: 12px;\n outline: none;\n}\n\n.rvs-find-input:focus {\n border-color: var(--rvs-brand);\n}\n\n.rvs-find-count {\n flex: none;\n min-width: 54px;\n text-align: center;\n color: var(--rvs-editor-panel-fg);\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-find-count.none {\n color: var(--rvs-git-d);\n}\n\n.rvs-code {\n flex: 1;\n min-height: 0;\n overflow: auto;\n margin: 0;\n padding: 6px 0 16px;\n font-family: var(--rvs-mono);\n font-size: 12.5px;\n line-height: 18px;\n white-space: pre;\n scrollbar-width: thin;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n}\n\n.rvs-code-line {\n display: flex;\n align-items: flex-start;\n min-width: max-content;\n}\n\n.rvs-code-line:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-code-text {\n flex: 1;\n padding-right: 10px;\n white-space: pre-wrap;\n word-break: break-word;\n user-select: text;\n}\n\n/* ---------------------------------------------------------- history list */\n\n.rvs-commit-item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 4px 8px 4px 4px;\n border: none;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12.5px;\n line-height: 18px;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-commit-item:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-commit-item.selected {\n background: var(--rvs-active);\n}\n\n.rvs-graph-svg {\n flex: none;\n display: block;\n}\n\n.rvs-commit-hash {\n flex: none;\n font-family: var(--rvs-mono);\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-commit-msg {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-commit-date {\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-ref-badge {\n flex: none;\n padding: 0 5px;\n border-radius: 8px;\n border: 1px solid var(--rvs-border2);\n font-size: 10px;\n line-height: 15px;\n color: var(--rvs-fg2);\n}\n\n.rvs-ref-badge.head {\n border-color: var(--rvs-brand);\n background: rgba(77, 107, 254, .2);\n color: var(--rvs-fg);\n}\n\n.rvs-ref-badge.tag {\n border-color: rgba(226, 183, 20, .55);\n background: rgba(226, 183, 20, .16);\n color: var(--rvs-git-m);\n}\n\n.rvs-detail {\n margin: 0 6px 8px;\n padding: 8px 10px;\n border: 1px solid var(--rvs-border2);\n border-left: 3px solid var(--rvs-accent);\n border-radius: 8px;\n background: var(--rvs-layer3);\n font-size: 12px;\n}\n\n.rvs-detail-meta {\n color: var(--rvs-fg3);\n font-size: 11px;\n margin-bottom: 6px;\n white-space: pre-wrap;\n}\n\n.rvs-file-row {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 4px;\n border-radius: 5px;\n cursor: pointer;\n}\n\n.rvs-file-row:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-file-path {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n /* Same tail-first truncation as the info bar; `plaintext` keeps the path's\n own LTR order (see .rvs-einfo-path). */\n direction: rtl;\n unicode-bidi: plaintext;\n text-align: left;\n}\n\n.rvs-file-status {\n flex: none;\n width: 16px;\n text-align: center;\n font-weight: 700;\n font-size: 11px;\n}\n\n/* ------------------------------------------------------- commit pane */\n\n/**\n * The history panel's bottom half: the graph keeps the top, the selected\n * commit takes this pane below the drag handle (same gesture and styling as\n * the editor split, so `.rvs-vsplit-handle` is reused rather than copied).\n */\n.rvs-history-body {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.rvs-hpane {\n flex: none;\n min-height: 140px;\n max-height: 82%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border-top: 1px solid var(--rvs-border);\n /* Same glass as the graph above (the sidebar's own backdrop shows through):\n an opaque `.rvs-code-bg` here read as a separate dark slab glued under the\n list. Patch rows already carry their own translucent add/del washes, so the\n diff stays legible without a filled background. */\n background: transparent;\n}\n\n/* Full-height mode: the graph is hidden by the panel, so the pane takes the\n remaining column instead of its persisted pixel height. */\n.rvs-hpane.expanded {\n flex: 1;\n max-height: none;\n}\n\n/* A toolbar toggle that is currently ON (wrap, for example). */\n.rvs-hbtn.active {\n color: var(--rvs-brand);\n}\n\n.rvs-hpane-body {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n/* Tab strip: same underline idiom as the editor's diff/worktree switch, but\n scoped so the pane's three views cannot be confused with editor tabs. */\n.rvs-htabs {\n flex: none;\n display: flex;\n align-items: center;\n gap: 2px;\n height: 30px;\n padding: 0 6px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n/* The tabs themselves live in their own role=tablist element: the strip also\n carries the hash, expand and close buttons, and those must NOT inherit the\n tablist's arrow-key handling (ArrowRight on \"close\" used to switch tabs). */\n.rvs-hpane-tablist {\n flex: none;\n display: flex;\n align-items: center;\n gap: 2px;\n}\n\n.rvs-htab {\n appearance: none;\n border: none;\n border-bottom: 2px solid transparent;\n background: transparent;\n color: var(--rvs-fg3);\n font: inherit;\n font-size: 12px;\n padding: 5px 8px 4px;\n cursor: pointer;\n}\n\n.rvs-htab:hover {\n color: var(--rvs-fg);\n}\n\n.rvs-htab.active {\n color: var(--rvs-fg);\n border-bottom-color: var(--rvs-brand);\n}\n\n.rvs-htabs-spacer {\n flex: 1;\n min-width: 0;\n}\n\n.rvs-hhash-mini {\n flex: none;\n margin-right: 2px;\n font-family: var(--rvs-mono);\n font-size: 10.5px;\n color: var(--rvs-fg3);\n}\n\n/**\n * Every tab body stays mounted (the patch's scroll position and parse survive\n * a look at 提交详情) and is hidden with the `hidden` attribute. The class\n * declares `flex`, which outranks the UA `[hidden]` rule, so hiding needs an\n * explicit rule of its own.\n */\n.rvs-hbody {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 10px 12px 14px;\n}\n\n.rvs-hbody[hidden] {\n display: none;\n}\n\n/* -- 提交详情 -- */\n\n.rvs-hsubject {\n font-size: 13px;\n font-weight: 600;\n line-height: 1.45;\n margin-bottom: 8px;\n white-space: pre-wrap;\n word-break: break-word;\n user-select: text;\n}\n\n.rvs-hmeta {\n display: flex;\n align-items: center;\n gap: 6px;\n min-height: 21px;\n font-size: 11.5px;\n color: var(--rvs-fg3);\n}\n\n.rvs-hmeta-icon {\n flex: none;\n display: flex;\n width: 13px;\n align-items: center;\n color: var(--rvs-fg3);\n}\n\n.rvs-hmeta-value {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-hmeta-label {\n flex: none;\n}\n\n.rvs-hhash {\n font-family: var(--rvs-mono);\n font-size: 11px;\n line-height: 16px;\n padding: 0 5px;\n border: 1px solid var(--rvs-border);\n border-radius: 4px;\n background: var(--rvs-input);\n color: var(--rvs-fg2);\n user-select: all;\n}\n\n.rvs-hparent {\n font-family: var(--rvs-mono);\n font-size: 11px;\n line-height: 16px;\n padding: 0 4px;\n border: 1px solid var(--rvs-border2);\n border-radius: 4px;\n color: var(--rvs-fg2);\n}\n\n.rvs-hdash {\n color: var(--rvs-fg3);\n}\n\n.rvs-hrefs {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n margin-top: 6px;\n}\n\n.rvs-hmsg {\n margin-top: 10px;\n padding-top: 8px;\n border-top: 1px dashed var(--rvs-border);\n font-size: 12px;\n line-height: 1.55;\n color: var(--rvs-fg2);\n white-space: pre-wrap;\n word-break: break-word;\n user-select: text;\n}\n\n.rvs-hfooter {\n display: flex;\n gap: 6px;\n margin-top: 14px;\n}\n\n/* -- 内容 -- */\n\n.rvs-hhint {\n margin-bottom: 6px;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n/* One line: how many files, and the path filter that makes a 60-file commit\n narrowable without scrolling. */\n.rvs-hcontent-head {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 6px;\n}\n\n.rvs-hcount {\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-hfilter {\n flex: 1;\n min-width: 0;\n}\n\n.rvs-hfiles {\n display: flex;\n flex-direction: column;\n gap: 1px;\n}\n\n/* Directory row of the 内容 tree: chevron + folder glyph + path + count. */\n.rvs-hfolder {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 4px;\n border-radius: 4px;\n color: var(--rvs-fg2);\n font-size: 12px;\n cursor: pointer;\n user-select: none;\n}\n\n.rvs-hfolder:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-hfolder-name {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: var(--rvs-mono);\n font-size: 11.5px;\n}\n\n.rvs-hfolder-count {\n flex: none;\n font-size: 10.5px;\n color: var(--rvs-fg3);\n}\n\n/* Files under a folder keep the editor tree's indent idiom. */\n.rvs-file-row.indent {\n padding-left: 18px;\n}\n\n.rvs-file-row.active {\n background: var(--rvs-active);\n}\n\n/* The row's quick \"open in editor\" affordance: invisible until the row is\n hovered/focused, so the path keeps the whole width at rest. */\n.rvs-file-open {\n opacity: 0;\n}\n\n.rvs-file-row:hover .rvs-file-open,\n.rvs-file-row:focus-within .rvs-file-open,\n.rvs-file-row:focus .rvs-file-open {\n opacity: 1;\n}\n\n/* Keyboard focus must be visible on the pane's role=button rows (a bare\n browser default is nearly invisible on this dark chrome). */\n.rvs-file-row:focus-visible,\n.rvs-hfolder:focus-visible,\n.rvs-commit-item:focus-visible,\n.rvs-patch-chevron:focus-visible,\n.rvs-vsplit-handle:focus-visible {\n outline: 2px solid var(--rvs-brand);\n outline-offset: -2px;\n}\n\n/* -- 差异 -- */\n\n/**\n * The diff tab is a column: a PINNED tool row, then the one scroller. The\n * reference pane made the whole tab a scroll area, so the file you were in and\n * the controls both disappeared on a long patch.\n */\n.rvs-hdiff {\n display: flex;\n flex-direction: column;\n padding: 0;\n overflow: hidden;\n}\n\n.rvs-hdiff[hidden] {\n display: none;\n}\n\n.rvs-ptoolbar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 3px;\n height: 30px;\n padding: 0 6px;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-layer3);\n}\n\n.rvs-pfile-index {\n flex: none;\n min-width: 32px;\n font-family: var(--rvs-mono);\n font-size: 10.5px;\n color: var(--rvs-fg3);\n}\n\n.rvs-pfile-name {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 11.5px;\n color: var(--rvs-fg2);\n}\n\n.rvs-pscroll {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 10px 12px 14px;\n}\n\n.rvs-patch-file {\n margin-bottom: 10px;\n border: 1px solid var(--rvs-border);\n border-radius: 6px;\n}\n\n.rvs-patch-file.folded .rvs-patch-head {\n border-bottom: none;\n border-radius: 6px;\n}\n\n.rvs-patch-file.active {\n border-color: var(--rvs-brand);\n}\n\n/* Sticky per-file header: scrolling a 3000-line hunk keeps saying which file\n it belongs to. `position: sticky` needs the nearest scrollport, which is\n `.rvs-pscroll` — no `overflow` on the section itself. */\n.rvs-patch-head {\n position: sticky;\n top: 0;\n z-index: 1;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 3px 6px;\n border-bottom: 1px solid var(--rvs-border);\n border-radius: 6px 6px 0 0;\n background: var(--rvs-layer3);\n cursor: pointer;\n}\n\n.rvs-patch-head:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-patch-chevron {\n flex: none;\n display: flex;\n align-items: center;\n color: var(--rvs-fg3);\n cursor: pointer;\n transform: rotate(0deg);\n}\n\n.rvs-patch-chevron.open {\n transform: rotate(90deg);\n}\n\n.rvs-patch-path {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n}\n\n.rvs-patch-letter {\n flex: none;\n font-size: 11px;\n font-weight: 700;\n}\n\n.rvs-patch-counts {\n flex: none;\n display: flex;\n gap: 5px;\n font-family: var(--rvs-mono);\n font-size: 10.5px;\n}\n\n.rvs-patch-add-count {\n color: var(--rvs-git-a);\n}\n\n.rvs-patch-del-count {\n color: var(--rvs-git-d);\n}\n\n.rvs-patch-rows {\n padding: 2px 0 6px;\n font-family: var(--rvs-mono);\n font-size: 11.5px;\n line-height: 17px;\n}\n\n.rvs-patch-row {\n display: flex;\n align-items: stretch;\n min-width: max-content;\n white-space: pre;\n}\n\n/* Wrap mode: the row gives up its horizontal runway and the text wraps under\n the gutter instead (the whole point on a narrow sidebar). */\n.rvs-patch-rows.wrap .rvs-patch-row {\n min-width: 0;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.rvs-patch-rows.wrap .rvs-patch-text {\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n/* A block whose raw patch text could not be paired with the parsed model\n (defensive: block count and model count disagreed) is dimmed instead of\n silently looking complete. */\n.rvs-patch-rows.partial {\n opacity: .62;\n}\n\n/* Truncation marker in the pinned toolbar: the cut point can be thousands of\n rows away, so the bottom note is not where a reader learns about it. */\n.rvs-ptruncated {\n flex: none;\n font-size: 12px;\n color: var(--rvs-git-m);\n}\n\n.rvs-patch-row.add {\n background: var(--rvs-add-bg);\n}\n\n.rvs-patch-row.del {\n background: var(--rvs-del-bg);\n}\n\n.rvs-patch-num {\n flex: none;\n width: 42px;\n padding-right: 6px;\n text-align: right;\n color: var(--rvs-fg3);\n user-select: none;\n}\n\n.rvs-patch-sign {\n flex: none;\n width: 14px;\n text-align: center;\n color: var(--rvs-fg3);\n user-select: none;\n}\n\n.rvs-patch-text {\n flex: 1;\n padding-right: 12px;\n user-select: text;\n}\n\n/* One \"the hunk jumped ahead\" marker, so a patch never pretends its line\n numbers are contiguous. */\n.rvs-patch-skip {\n margin: 2px 0;\n border-top: 1px dashed var(--rvs-border);\n border-bottom: 1px dashed var(--rvs-border);\n color: var(--rvs-fg3);\n font-size: 11px;\n text-align: center;\n user-select: none;\n}\n\n.rvs-patch-note {\n padding: 6px 8px;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n/* ---------------------------------------------------- floating editor window */\n\n/**\n * The floating editor lives in the host's frame-wide overlay layer\n * (`position: absolute; inset: 0; z-index: 20`, click-through, children opt\n * back into pointer events). It is placed with viewport coordinates, so it\n * floats above every column without joining any of their stacking contexts.\n *\n * `.rvs-root` carries the whole design-system token set and is row-flex by\n * default; this frame overrides the direction to a column and takes its size\n * from the inline rect the component keeps.\n */\n.rvs-float-window {\n position: fixed;\n flex-direction: column;\n /* The rect maths (clamp/persist) is in border-box terms; without this the\n painted border would sit one pixel outside the computed rectangle. */\n box-sizing: border-box;\n min-width: 360px;\n min-height: 220px;\n overflow: hidden;\n border: 1px solid var(--rvs-border2);\n border-radius: 10px;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n box-shadow: 0 18px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .28);\n z-index: 30;\n /* The overlay layer itself is click-through; the window opts back in even if\n the host wraps each overlay entry in its own element. */\n pointer-events: auto;\n}\n\n/* Minimized: the frame IS the ball (see `.rvs-float-mini`); the body stays\n mounted but hidden, and it must not impose a minimum height. */\n.rvs-float-window[data-rvs-float=\"collapsed\"] {\n min-height: 0;\n}\n\n/**\n * Minimized window = floating ball.\n *\n * A full-width 34px bar was too long: it read as a broken window and covered a\n * whole strip. The ball is a small circle at the window's own corner, draggable\n * anywhere, restored by a click (or Enter/Space). It keeps the dirty dot, so\n * \"the editor is out and has unsaved edits\" is still one glance away.\n */\n.rvs-float-window.rvs-float-mini {\n min-width: 0;\n min-height: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n cursor: move;\n touch-action: none;\n}\n\n.rvs-float-ball {\n flex: 1;\n /* Stretch to the circle: the frame is a COLUMN flex box with centred items,\n so without this the hit area (and the absolutely positioned dot) would be\n sized by the 16px glyph instead of the 44px ball. */\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n border-radius: 50%;\n color: var(--rvs-brand);\n font-size: 16px;\n line-height: 1;\n cursor: move;\n outline: none;\n}\n\n.rvs-float-ball:hover,\n.rvs-float-ball:focus-visible {\n background: var(--rvs-hover);\n}\n\n.rvs-float-ball-glyph {\n pointer-events: none;\n}\n\n/* Unsaved edits stay visible while minimized. */\n.rvs-float-ball-dot {\n position: absolute;\n top: 8px;\n right: 8px;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--rvs-git-m);\n box-shadow: 0 0 0 2px var(--rvs-code-bg);\n pointer-events: none;\n}\n\n/* While a drag/resize gesture runs the pointer must not select editor text. */\n.rvs-float-window.dragging {\n user-select: none;\n}\n\n.rvs-float-titlebar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 7px;\n height: 34px;\n padding: 0 6px 0 10px;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-layer3);\n cursor: move;\n user-select: none;\n touch-action: none;\n}\n\n.rvs-float-glyph {\n color: var(--rvs-brand);\n font-size: 11px;\n}\n\n.rvs-float-title {\n flex: none;\n font-size: 12px;\n font-weight: 600;\n color: var(--rvs-fg2);\n}\n\n.rvs-float-file {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 11.5px;\n color: var(--rvs-fg3);\n direction: rtl;\n unicode-bidi: plaintext;\n text-align: left;\n}\n\n.rvs-float-spacer {\n flex: 1;\n}\n\n.rvs-float-btn {\n flex: none;\n width: 22px;\n height: 22px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n border-radius: 5px;\n background: transparent;\n color: var(--rvs-fg3);\n font: inherit;\n font-size: 12px;\n line-height: 1;\n cursor: pointer;\n}\n\n.rvs-float-btn:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-float-close:hover {\n background: rgba(241, 76, 76, .18);\n color: var(--rvs-danger);\n}\n\n.rvs-float-body {\n flex: 1 1 0;\n min-height: 0;\n min-width: 0;\n display: flex;\n overflow: hidden;\n background: var(--rvs-code-bg);\n}\n\n/* Keep the height chain pinned: the editor pane grows inside this box. */\n.rvs-float-body > .rvs-pane {\n flex: 1 1 0;\n min-height: 0;\n min-width: 0;\n}\n\n/* Eight grips, placed INSIDE the border box: the window clips overflow (rounded\n corners), so grips hanging outside would lose half their hit area. Corners\n are larger so they can actually be hit. */\n.rvs-float-resize {\n position: absolute;\n z-index: 3;\n}\n\n.rvs-float-resize-n { top: 0; left: 10px; right: 10px; height: 6px; cursor: ns-resize; }\n.rvs-float-resize-s { bottom: 0; left: 10px; right: 10px; height: 6px; cursor: ns-resize; }\n.rvs-float-resize-e { top: 10px; bottom: 10px; right: 0; width: 6px; cursor: ew-resize; }\n.rvs-float-resize-w { top: 10px; bottom: 10px; left: 0; width: 6px; cursor: ew-resize; }\n.rvs-float-resize-ne { top: 0; right: 0; width: 12px; height: 12px; cursor: nesw-resize; }\n.rvs-float-resize-nw { top: 0; left: 0; width: 12px; height: 12px; cursor: nwse-resize; }\n.rvs-float-resize-se { bottom: 0; right: 0; width: 12px; height: 12px; cursor: nwse-resize; }\n.rvs-float-resize-sw { bottom: 0; left: 0; width: 12px; height: 12px; cursor: nesw-resize; }\n\n/* Shown by whichever surface the single editor left behind (centre tab or the\n sidebar's editor panel). */\n.rvs-float-placeholder {\n flex: 1;\n min-height: 0;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 10px;\n padding: 24px;\n text-align: center;\n color: var(--rvs-fg3);\n font-size: 12.5px;\n}\n\n.rvs-float-placeholder-title {\n color: var(--rvs-fg2);\n font-size: 13px;\n font-weight: 600;\n}\n\n.rvs-float-placeholder-text {\n max-width: 360px;\n line-height: 1.6;\n}\n\n/* --------------------------------------------------------- context menu */\n\n.rvs-portal {\n font-family: inherit;\n}\n\n/**\n * Floating surfaces (menu / modal / toast) paint an OPAQUE base first and then\n * lay the skin's overlay token on top. The token is frequently translucent, so\n * using it alone let the panel's own text bleed through the menu and overlap\n * the entries; `Canvas` follows the resolved light/dark scheme, so the base is\n * correct in either theme.\n */\n.rvs-menu,\n.rvs-modal-box,\n.rvs-toast {\n background-color: Canvas;\n background-image: linear-gradient(var(--dsw-alias-bg-overlay, transparent), var(--dsw-alias-bg-overlay, transparent));\n color: var(--rvs-fg);\n}\n\n.rvs-menu {\n position: fixed;\n z-index: 1000;\n min-width: 172px;\n max-height: calc(100vh - 16px);\n overflow-y: auto;\n padding: 4px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n box-shadow: 0 6px 20px rgba(0, 0, 0, .35);\n font-size: 12.5px;\n line-height: 18px;\n}\n\n.rvs-menu-sep {\n height: 1px;\n margin: 4px 6px;\n background: var(--rvs-border);\n}\n\n.rvs-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 5px 10px;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-menu-item:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-menu-item.danger {\n color: var(--vsc-danger, #f14c4c);\n}\n\n.rvs-menu-item.danger:hover {\n background: rgba(241, 76, 76, .16);\n}\n\n.rvs-menu-item:disabled {\n opacity: .45;\n cursor: default;\n}\n\n.rvs-menu-item:disabled:hover {\n background: transparent;\n}\n\n.rvs-menu-hint {\n margin-left: auto;\n font-size: 11px;\n opacity: .6;\n}\n\n/* ------------------------------------------------------- modal + toast */\n\n.rvs-modal-mask {\n position: fixed;\n inset: 0;\n z-index: 100000;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, .45);\n backdrop-filter: blur(2px);\n animation: rvsFade .12s ease;\n}\n\n.rvs-modal-box {\n width: min(420px, calc(100vw - 40px));\n padding: 16px 18px;\n border: 1px solid var(--rvs-border2);\n border-radius: 10px;\n color: var(--rvs-fg);\n box-shadow: 0 12px 40px rgba(0, 0, 0, .38);\n font-size: 13px;\n animation: rvsPop .14s ease;\n}\n\n.rvs-modal-title {\n margin-bottom: 8px;\n font-size: 14px;\n font-weight: 600;\n}\n\n.rvs-modal-text {\n margin-bottom: 12px;\n color: var(--rvs-fg2);\n font-size: 12.5px;\n line-height: 1.6;\n word-break: break-word;\n white-space: pre-wrap;\n}\n\n.rvs-modal-row {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 14px;\n}\n\n.rvs-modal-btn {\n padding: 5px 14px;\n border: 1px solid var(--rvs-border2);\n border-radius: 7px;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12.5px;\n cursor: pointer;\n}\n\n.rvs-modal-btn:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-modal-btn.primary {\n border-color: transparent;\n background: var(--rvs-accent);\n color: #fff;\n}\n\n.rvs-modal-btn.danger {\n border-color: transparent;\n background: var(--rvs-danger);\n color: #fff;\n}\n\n.rvs-toasts {\n position: fixed;\n right: 16px;\n bottom: 18px;\n z-index: 100001;\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: flex-end;\n pointer-events: none;\n}\n\n.rvs-toast {\n max-width: 340px;\n padding: 7px 12px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n color: var(--rvs-fg);\n box-shadow: 0 6px 20px rgba(0, 0, 0, .35);\n font-size: 12.5px;\n line-height: 1.5;\n word-break: break-word;\n white-space: pre-wrap;\n animation: rvsPop .14s ease;\n}\n\n.rvs-toast.error {\n border-color: rgba(241, 76, 76, .6);\n background-image: linear-gradient(rgba(58, 31, 34, .92), rgba(58, 31, 34, .92));\n}\n\n/* ------------------------------------------------------------- terminal */\n\n.rvs-term-tabs {\n flex: none;\n display: flex;\n align-items: stretch;\n gap: 2px;\n height: 32px;\n padding: 0 4px;\n overflow-x: auto;\n overflow-y: hidden;\n border-bottom: 1px solid var(--rvs-border);\n scrollbar-width: none;\n}\n\n.rvs-term-tabs::-webkit-scrollbar {\n height: 0;\n}\n\n.rvs-term-tab {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n max-width: 180px;\n margin: 4px 0;\n padding: 0 6px 0 9px;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: var(--rvs-fg3);\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n\n/* Wrapper that pairs a tab with its close button. The two are siblings so the\n ✕ can be a real focusable <button> (a nested one is invalid HTML and left\n keyboard users no way to close a tab). */\n.rvs-term-tabwrap {\n position: relative;\n flex: none;\n display: flex;\n align-items: center;\n}\n\n.rvs-term-tabwrap .rvs-term-tab {\n padding-right: 22px;\n}\n\n.rvs-term-tabwrap .rvs-etab-close {\n position: absolute;\n right: 3px;\n opacity: 0;\n /* The shared `.rvs-etab-close` is content-sized for the editor tab strip\n (where the ✕ sits inside a padded tab). The terminal tab pairs it with an\n absolutely positioned wrapper, so it keeps the 16x16 box it always had\n instead of shrinking with the new padding. */\n width: 16px;\n height: 16px;\n}\n\n.rvs-term-tabwrap:hover .rvs-etab-close,\n.rvs-term-tabwrap:focus-within .rvs-etab-close {\n opacity: .8;\n}\n\n.rvs-term-tab:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-term-tab.active {\n background: var(--rvs-layer3);\n color: var(--rvs-fg);\n}\n\n.rvs-term-tab.dead {\n color: var(--rvs-git-d);\n}\n\n.rvs-term-name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-term-body {\n flex: 1;\n min-height: 0;\n position: relative;\n overflow: hidden;\n}\n\n.rvs-term-slot {\n position: absolute;\n inset: 0;\n}\n\n.rvs-term-dead {\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n}\n\n/* --------------------------------------------------------- terminal snippets\n *\n * The \"常用指令\" button lives in the terminal header; its popover is portaled to\n * <body>, so it CANNOT use the `.rvs-root`-scoped `--rvs-*` tokens (they resolve\n * to nothing there). It follows the plugin's popup convention instead: an opaque\n * `Canvas` base plus the skin's overlay token, and the app-wide `--dsw-alias-*`\n * colours (with literal fallbacks) for text, hover and accents.\n */\n.rvs-snips-btn {\n flex: none;\n width: auto;\n min-width: 0;\n gap: 3px;\n padding: 0 6px;\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-snips-panel {\n position: fixed;\n z-index: 60;\n display: flex;\n flex-direction: column;\n max-height: 420px;\n overflow: hidden;\n border: 1px solid var(--dsw-alias-border-l2, rgba(127, 127, 127, .38));\n border-radius: 8px;\n background-color: Canvas;\n background-image: linear-gradient(var(--dsw-alias-bg-overlay, transparent), var(--dsw-alias-bg-overlay, transparent));\n color: var(--dsw-alias-label-primary, CanvasText);\n box-shadow: 0 10px 30px rgba(0, 0, 0, .4);\n font-size: 12px;\n}\n\n.rvs-snips-head {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 6px 8px;\n border-bottom: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n}\n\n.rvs-snips-title {\n font-weight: 600;\n font-size: 12px;\n}\n\n.rvs-snips-spacer { flex: 1; }\n\n.rvs-snips-add {\n width: 22px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: 1px solid var(--dsw-alias-brand-primary, #4d6bfe);\n border-radius: 5px;\n background: transparent;\n color: var(--dsw-alias-brand-primary, #4d6bfe);\n font: inherit;\n font-size: 14px;\n line-height: 1;\n cursor: pointer;\n}\n\n.rvs-snips-add:hover {\n background: var(--dsw-alias-brand-primary, #4d6bfe);\n color: #fff;\n}\n\n.rvs-snips-list {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 1px;\n padding: 4px;\n overflow: auto;\n}\n\n.rvs-snips-empty {\n padding: 10px 8px;\n color: var(--dsw-alias-label-tertiary, #8b8b8b);\n font-size: 11px;\n line-height: 1.6;\n}\n\n.rvs-snips-row {\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 1px 3px;\n border-radius: 5px;\n}\n\n.rvs-snips-row:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, .14)); }\n\n/* Drop indicator: a line above the row the pointer is over. */\n.rvs-snips-row.drop { box-shadow: inset 0 2px 0 var(--dsw-alias-brand-primary, #4d6bfe); }\n\n.rvs-snips-grip {\n flex: none;\n padding: 0 2px;\n color: var(--dsw-alias-label-tertiary, #8b8b8b);\n font-size: 11px;\n cursor: grab;\n user-select: none;\n}\n\n.rvs-snips-grip:active { cursor: grabbing; }\n\n.rvs-snips-insert {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: baseline;\n gap: 5px;\n padding: 4px 2px;\n border: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-snips-name {\n flex: 0 1 auto;\n max-width: 45%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-label-primary, CanvasText);\n font-weight: 600;\n font-size: 11.5px;\n}\n\n.rvs-snips-arrow {\n flex: none;\n color: var(--dsw-alias-label-tertiary, #8b8b8b);\n font-size: 10px;\n}\n\n.rvs-snips-text {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-label-secondary, #b9b9b9);\n font-family: var(--rvs-mono, ui-monospace, monospace);\n font-size: 11px;\n}\n\n.rvs-snips-icon {\n flex: none;\n width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: var(--dsw-alias-label-tertiary, #8b8b8b);\n font: inherit;\n font-size: 12px;\n line-height: 1;\n cursor: pointer;\n}\n\n.rvs-snips-icon:hover {\n background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, .14));\n color: var(--dsw-alias-label-primary, CanvasText);\n}\n\n.rvs-snips-icon.danger:hover { color: var(--dsw-alias-state-error-primary, #e05555); }\n\n.rvs-snips-foot {\n flex: none;\n padding: 4px 8px;\n border-top: 1px solid var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n color: var(--dsw-alias-label-tertiary, #8b8b8b);\n font-size: 10.5px;\n}\n\n/* The add/edit form reuses the shared modal chrome; only its fields and error\n line are local, and they carry their own colours because the modal is\n portaled outside `.rvs-root` as well. */\n.rvs-snips-field {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin: 8px 0;\n color: var(--dsw-alias-label-secondary, CanvasText);\n font-size: 11.5px;\n}\n\n.rvs-snips-field input,\n.rvs-snips-field textarea {\n flex: none;\n width: 100%;\n padding: 5px 8px;\n border: 1px solid var(--dsw-alias-border-l2, rgba(127, 127, 127, .38));\n border-radius: 6px;\n background: var(--dsw-alias-bg-input, rgba(127, 127, 127, .12));\n color: inherit;\n font: inherit;\n font-size: 12px;\n outline: none;\n}\n\n.rvs-snips-field input:focus,\n.rvs-snips-field textarea:focus {\n border-color: var(--dsw-alias-brand-primary, #4d6bfe);\n}\n\n.rvs-snips-command {\n font-family: var(--rvs-mono, ui-monospace, monospace) !important;\n resize: vertical;\n}\n\n.rvs-snips-error {\n margin: 2px 0 0;\n color: var(--dsw-alias-state-error-primary, #e05555);\n font-size: 11.5px;\n}\n\n/* `.rvs-toast.error` is styled with the overlay form further up, so the popup\n opacity convention (an opaque Canvas base plus a token layer) still governs\n it. A flat `background: #3a1f22` shorthand sat here and overrode that chain —\n same opaque result, but outside the convention. */\n\n@keyframes rvsFade {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes rvsPop {\n from { opacity: 0; transform: scale(.97) translateY(3px); }\n to { opacity: 1; transform: none; }\n}\n\n.rvs-search-row {\n display: flex;\n gap: 6px;\n padding: 6px 8px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n/* --------------------------------------------------------- search options */\n\n.rvs-toggles {\n flex: none;\n display: inline-flex;\n border: 1px solid var(--rvs-border2);\n border-radius: 6px;\n overflow: hidden;\n}\n\n.rvs-toggle {\n min-width: 26px;\n height: 22px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 5px;\n border: none;\n border-right: 1px solid var(--rvs-border);\n background: transparent;\n color: var(--rvs-fg3);\n font: inherit;\n cursor: pointer;\n}\n\n.rvs-toggle:last-child {\n border-right: none;\n}\n\n.rvs-toggle:hover {\n background: var(--rvs-hover);\n color: var(--rvs-fg);\n}\n\n.rvs-toggle.active {\n background: var(--rvs-active);\n color: var(--rvs-fg);\n box-shadow: inset 0 0 0 1px var(--rvs-brand);\n}\n\n.rvs-glyph {\n font-family: var(--rvs-mono);\n font-weight: 600;\n line-height: 1;\n letter-spacing: -0.02em;\n}\n\n.rvs-glyph-underline {\n text-decoration: underline;\n}\n\n.rvs-scope-label {\n flex: none;\n align-self: center;\n font-size: 11px;\n color: var(--rvs-fg3);\n white-space: nowrap;\n}\n\n/* --------------------------------------------------------- search results */\n\n.rvs-hit {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 3px 10px;\n border: none;\n background: transparent;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12.5px;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-hit:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-hit-file {\n font-weight: 600;\n}\n\n.rvs-hit-line {\n padding-left: 30px;\n align-items: flex-start;\n font-family: var(--rvs-mono);\n font-size: 12px;\n color: var(--rvs-fg2);\n}\n\n.rvs-hit-count {\n flex: none;\n min-width: 18px;\n padding: 0 5px;\n border-radius: 9px;\n background: var(--rvs-hover);\n font-size: 10.5px;\n line-height: 15px;\n text-align: center;\n color: var(--rvs-fg3);\n}\n\n.rvs-hit-lineno {\n flex: none;\n width: 3.2em;\n text-align: right;\n color: var(--rvs-fg3);\n opacity: .8;\n font-size: 11px;\n}\n\n.rvs-hit-text {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n direction: ltr;\n}\n\n.rvs-mark {\n padding: 0 1px;\n border-radius: 2px;\n background: rgba(226, 183, 20, .3);\n color: inherit;\n}\n\n.rvs-hit-dir {\n flex: none;\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n.rvs-hit-name {\n flex: none;\n font-weight: 600;\n}\n\n.rvs-kbd {\n padding: 0 4px;\n border: 1px solid var(--rvs-border2);\n border-radius: 4px;\n font-size: 10px;\n color: var(--rvs-fg3);\n}\n\n/* --- SCM: repository directory row (git runs in THIS directory) ------------- */\n\n.rvs-repo-bar {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px 8px 4px 10px;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-bg2, var(--dsw-alias-bg-layer-1, #1b1b1b));\n font-size: 11px;\n flex: none;\n}\n\n.rvs-repo-bar-label {\n color: var(--rvs-fg3);\n white-space: nowrap;\n}\n\n.rvs-repo-bar-path {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n direction: rtl;\n unicode-bidi: plaintext;\n text-align: left;\n padding: 2px 6px;\n border: 1px solid var(--rvs-border2);\n border-radius: 4px;\n background: var(--rvs-bg3, rgba(255, 255, 255, .04));\n color: var(--rvs-fg);\n font-family: var(--rvs-mono, ui-monospace, Consolas, monospace);\n font-size: 11px;\n cursor: pointer;\n}\n\n.rvs-repo-bar-path:hover {\n border-color: var(--rvs-brand);\n color: var(--rvs-brand-fg, var(--rvs-fg));\n}\n\n.rvs-repo-bar-fix {\n margin-top: 10px;\n display: flex;\n justify-content: center;\n}\n\n/* --- SCM: repository directory picker -------------------------------------- */\n\n.rvs-repopick {\n width: min(560px, calc(100vw - 40px));\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.rvs-repopick .rvs-modal-title {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n.rvs-repopick-bar {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 2px;\n min-height: 22px;\n font-family: var(--rvs-mono, ui-monospace, Consolas, monospace);\n font-size: 12px;\n}\n\n.rvs-crumb-wrap {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n color: var(--rvs-fg3);\n}\n\n.rvs-crumb {\n border: none;\n background: none;\n padding: 1px 3px;\n border-radius: 3px;\n color: var(--rvs-brand-fg, var(--rvs-fg));\n font: inherit;\n cursor: pointer;\n}\n\n.rvs-crumb:hover {\n background: var(--rvs-row-hover, rgba(255, 255, 255, .07));\n}\n\n.rvs-repopick-probe {\n padding: 5px 8px;\n border-radius: 4px;\n font-size: 11.5px;\n border: 1px solid var(--rvs-border2);\n background: var(--rvs-bg3, rgba(255, 255, 255, .04));\n color: var(--rvs-fg2);\n}\n\n.rvs-repopick-probe.root {\n border-color: var(--rvs-ok, #2ea043);\n color: var(--rvs-ok, #2ea043);\n}\n\n.rvs-repopick-probe.inside {\n border-color: var(--rvs-brand);\n color: var(--rvs-brand-fg, var(--rvs-fg));\n}\n\n.rvs-repopick-found {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 4px;\n padding-bottom: 2px;\n}\n\n.rvs-repopick-found-label {\n color: var(--rvs-fg3);\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-repopick-list {\n flex: 1 1 auto;\n min-height: 150px;\n max-height: 42vh;\n overflow: auto;\n border: 1px solid var(--rvs-border);\n border-radius: 5px;\n background: var(--rvs-bg-layer, rgba(0, 0, 0, .18));\n padding: 2px;\n}\n\n.rvs-repopick-row {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 3px 6px;\n border: none;\n border-radius: 3px;\n background: none;\n color: var(--rvs-fg);\n font: inherit;\n font-size: 12px;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-repopick-row:hover {\n background: var(--rvs-row-hover, rgba(255, 255, 255, .07));\n}\n\n.rvs-repopick-row span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-repopick-dim {\n color: var(--rvs-fg3);\n font-size: 11.5px;\n padding: 6px;\n}\n\n.rvs-repopick-type {\n display: flex;\n gap: 6px;\n align-items: center;\n}\n\n.rvs-repopick-type .rvs-input {\n flex: 1 1 auto;\n}\n\n.rvs-repopick-error {\n color: var(--rvs-error, #f85149);\n font-size: 11.5px;\n}\n\n/* --------------------------------------------------- streaming exec panel */\n\n/**\n * Live log for the network verbs (fetch / pull / push / sync).\n *\n * Fixed to the viewport's bottom-right instead of joining the panel's own\n * column: the pane can be collapsed or scrolled away while the push runs, and a\n * dialog that vanishes with its parent would hide the cancel button exactly\n * when it matters.\n */\n.rvs-execpanel {\n /* PORTALED to <body>, i.e. OUTSIDE `.rvs-root` where these tokens are\n declared — without this block every var() below resolves to nothing and the\n panel renders transparent and borderless over the page content. Keep this\n subset in sync with `.rvs-root`; the dark code surfaces get their own\n `body[data-ds-dark-theme]` override right after this rule. */\n --rvs-fg: var(--dsw-alias-label-primary, #e6e6e6);\n --rvs-fg2: var(--dsw-alias-label-secondary, #b9b9b9);\n --rvs-fg3: var(--dsw-alias-label-tertiary, #8b8b8b);\n --rvs-hover: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, .14));\n --rvs-border: var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n --rvs-border2: var(--dsw-alias-border-l2, rgba(127, 127, 127, .38));\n --rvs-overlay: var(--dsw-alias-bg-overlay, #24262e);\n --rvs-brand: var(--dsw-alias-brand-primary, #4d6bfe);\n --rvs-danger: var(--dsw-alias-state-error-primary, #e05555);\n --rvs-git-m: #e2b714;\n --rvs-git-a: #4ec9b0;\n --rvs-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;\n --rvs-code-bg: #1e1e1e;\n --rvs-code-fg: #d4d4d4;\n position: fixed;\n right: 16px;\n bottom: 16px;\n z-index: 45;\n width: min(620px, calc(100vw - 32px));\n max-height: min(60vh, 520px);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--rvs-border2);\n border-radius: 10px;\n background: var(--rvs-overlay);\n color: var(--rvs-fg);\n box-shadow: 0 18px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .28);\n}\n\nbody[data-ds-dark-theme] .rvs-execpanel {\n --rvs-code-bg: #1e1e1e;\n --rvs-code-fg: #d4d4d4;\n}\n\n\n.rvs-execpanel-head {\n flex: none;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 5px 6px 5px 10px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-execpanel-title {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n font-weight: 600;\n}\n\n.rvs-execpanel-status {\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n font-variant-numeric: tabular-nums;\n}\n\n.rvs-execpanel-status.done { color: var(--rvs-git-a); }\n.rvs-execpanel-status.error { color: var(--rvs-danger); }\n.rvs-execpanel-status.cancelled { color: var(--rvs-git-m); }\n\n.rvs-execpanel-spacer {\n flex: 1;\n min-width: 0;\n}\n\n.rvs-execpanel-body {\n flex: 1;\n min-height: 60px;\n margin: 0;\n padding: 8px 10px;\n overflow: auto;\n background: var(--rvs-code-bg);\n color: var(--rvs-code-fg);\n font-family: var(--rvs-mono);\n font-size: 11.5px;\n line-height: 1.45;\n white-space: pre-wrap;\n word-break: break-word;\n user-select: text;\n}\n\n.rvs-execpanel-foot {\n flex: none;\n padding: 4px 10px 6px;\n border-top: 1px solid var(--rvs-border);\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n/* --------------------------------------------------------- download dock */\n/* PORTALed to <body>, i.e. OUTSIDE `.rvs-root` where the tokens are declared:\n declare the subset this panel uses (same rule as `.rvs-execpanel`). */\n.rvs-downloads {\n --rvs-fg: var(--dsw-alias-label-primary, #e6e6e6);\n --rvs-fg2: var(--dsw-alias-label-secondary, #b9b9b9);\n --rvs-fg3: var(--dsw-alias-label-tertiary, #8b8b8b);\n --rvs-border: var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n --rvs-border2: var(--dsw-alias-border-l2, rgba(127, 127, 127, .38));\n --rvs-overlay: var(--dsw-alias-bg-overlay, #24262e);\n --rvs-brand: var(--dsw-alias-brand-primary, #4d6bfe);\n --rvs-danger: var(--dsw-alias-state-error-primary, #e05555);\n --rvs-git-m: #e2b714;\n --rvs-git-a: #4ec9b0;\n position: fixed;\n /* Bottom-RIGHT, not over the sidebar's own footer (first screenshot: the\n dock sat on the usage/account block). `bottom: 64px` keeps it above the\n transient toast stack (right 16 / bottom 18 / z 100001) and above the\n network exec panel (right 16 / bottom 16 / z 45), so neither covers it. */\n right: 16px;\n bottom: 64px;\n z-index: 100000;\n animation: rvsFade .12s ease;\n width: min(380px, calc(100vw - 32px));\n max-height: min(45vh, 420px);\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 10px;\n background: var(--rvs-overlay);\n color: var(--rvs-fg);\n box-shadow: 0 18px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .28);\n}\n\n.rvs-download {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 6px 8px;\n border: 1px solid var(--rvs-border);\n border-radius: 8px;\n background: rgba(127, 127, 127, .06);\n}\n\n.rvs-download-head {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n.rvs-download-icon {\n flex: none;\n display: flex;\n align-items: center;\n color: var(--rvs-fg2);\n}\n\n.rvs-download-name {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n font-weight: 600;\n}\n\n.rvs-download-status {\n flex: none;\n font-size: 11px;\n color: var(--rvs-fg3);\n}\n\n.rvs-download-status.done { color: var(--rvs-git-a); }\n.rvs-download-status.failed { color: var(--rvs-danger); }\n.rvs-download-status.cancelled { color: var(--rvs-git-m); }\n\n.rvs-download-bar {\n height: 4px;\n overflow: hidden;\n border-radius: 2px;\n background: rgba(127, 127, 127, .22);\n}\n\n.rvs-download-fill {\n height: 100%;\n width: 0;\n border-radius: 2px;\n background: var(--rvs-brand);\n transition: width .12s linear;\n}\n\n.rvs-download-fill.indeterminate {\n width: 35%;\n animation: rvs-download-slide 1.2s ease-in-out infinite;\n}\n\n@keyframes rvs-download-slide {\n from { transform: translateX(-120%); }\n to { transform: translateX(320%); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .rvs-download-fill.indeterminate { animation-duration: 2.4s; }\n .rvs-download-fill { transition: none; }\n}\n\n.rvs-download-meta {\n overflow: hidden;\n color: var(--rvs-fg3);\n font-size: 11px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rvs-download-meta.failed { color: var(--rvs-danger); white-space: normal; word-break: break-word; }\n.rvs-download-meta.done { color: var(--rvs-fg2); }\n.rvs-download-meta.cancelled { color: var(--rvs-git-m); }\n\n/* ----------------------------------------------------------- doctor panel */\n\n/*\n * Remote-environment report, opened from the host list (which lives in the DSH\n * Settings dialog, i.e. OUTSIDE `.rvs-root`). Fixed overlay like the input\n * dialog so the host list behind it does not move, and its own token subset for\n * the same reason as `.rvs-execpanel`: `var(--rvs-*)` resolves to nothing out\n * there without it. Three state colors, and `unknown` deliberately looks\n * neutral (not red, not green): it is ignorance, not a verdict.\n */\n.rvs-doctor {\n --rvs-fg: var(--dsw-alias-label-primary, #e6e6e6);\n --rvs-fg2: var(--dsw-alias-label-secondary, #b9b9b9);\n --rvs-fg3: var(--dsw-alias-label-tertiary, #8b8b8b);\n --rvs-border: var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n --rvs-overlay: var(--dsw-alias-bg-overlay, #24262e);\n --rvs-git-m: #e2b714;\n --rvs-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, .45);\n color: var(--rvs-fg);\n font-size: 13px;\n}\n\n.rvs-doctor-card {\n display: flex;\n flex-direction: column;\n width: min(860px, 92vw);\n max-height: min(80vh, 720px);\n border: 1px solid var(--rvs-border);\n border-radius: 8px;\n background: var(--rvs-overlay);\n box-shadow: 0 8px 32px rgba(0, 0, 0, .35);\n}\n\n.rvs-doctor-head {\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 12px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-doctor-title {\n font-weight: 600;\n}\n\n.rvs-doctor-body {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 4px 12px 10px;\n}\n\n.rvs-doctor-loading {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 0;\n color: var(--rvs-fg2);\n}\n\n.rvs-doctor-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 12px;\n}\n\n.rvs-doctor-table th {\n position: sticky;\n top: 0;\n padding: 6px 8px;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-overlay);\n color: var(--rvs-fg2);\n font-weight: 600;\n text-align: left;\n}\n\n.rvs-doctor-table td {\n padding: 5px 8px;\n border-top: 1px solid var(--rvs-border);\n vertical-align: top;\n}\n\n.rvs-doctor-item {\n white-space: nowrap;\n color: var(--rvs-fg2);\n}\n\n.rvs-doctor-badge {\n display: inline-block;\n padding: 0 6px;\n border: 1px solid currentColor;\n border-radius: 8px;\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-doctor-badge.ok { color: var(--rvs-ok, #2ea043); }\n.rvs-doctor-badge.missing { color: var(--rvs-git-m, #e2b714); }\n.rvs-doctor-badge.unknown { color: var(--rvs-fg3); }\n\n.rvs-doctor-detail {\n color: var(--rvs-fg3);\n font-family: var(--rvs-mono);\n font-size: 11px;\n word-break: break-word;\n user-select: text;\n}\n\n.rvs-doctor-hint {\n flex: none;\n padding: 8px 12px;\n border-top: 1px solid var(--rvs-border);\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n\n\n\n/* ------------------------------------------------------------ port forwards */\n\n/**\n * The port panel: one form above two lists, all inside the sidebar column.\n *\n * The column can be dragged very narrow, so nothing here may assume a width: an\n * address/URL is ONE unbreakable token (`overflow-wrap: anywhere`), the action\n * row wraps instead of overflowing, and the form stacks vertically — a\n * three-input row is unusable at the panel's default width.\n */\n.rvs-ports-body {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 8px 8px 14px;\n}\n\n/**\n * The restore-failure banner: one sentence plus the \"forget these rules\"\n * action, side by side when there is room and stacked when the column is very\n * narrow (the action must never squeeze the explanation into a sliver).\n */\n.rvs-ports-restore {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.rvs-ports-form {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px;\n border: 1px solid var(--rvs-border2);\n border-radius: 8px;\n}\n\n.rvs-ports-field {\n display: flex;\n flex-direction: column;\n gap: 3px;\n min-width: 0;\n}\n\n.rvs-ports-label {\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n/* `.rvs-input` carries `flex: 1`; in a COLUMN flex parent that would stretch\n the field's HEIGHT, so the input fills the width and keeps its own height. */\n.rvs-ports-input {\n flex: none;\n width: 100%;\n box-sizing: border-box;\n}\n\n.rvs-ports-form-actions {\n display: flex;\n justify-content: flex-end;\n}\n\n.rvs-ports-section {\n margin-top: 12px;\n border-top: 1px solid var(--rvs-border);\n}\n\n.rvs-ports-sec-head {\n display: flex;\n align-items: center;\n gap: 6px;\n height: 26px;\n padding: 0 4px;\n color: var(--rvs-fg2);\n font-size: 11px;\n font-weight: 700;\n letter-spacing: .04em;\n text-transform: uppercase;\n user-select: none;\n}\n\n.rvs-ports-count {\n padding: 0 6px;\n border-radius: 999px;\n background: var(--rvs-hover);\n color: var(--rvs-fg3);\n font-size: 10.5px;\n letter-spacing: 0;\n}\n\n.rvs-ports-row {\n display: flex;\n flex-direction: column;\n gap: 3px;\n min-width: 0;\n padding: 6px 6px 7px;\n border-radius: 6px;\n}\n\n.rvs-ports-row:hover {\n background: var(--rvs-hover);\n}\n\n.rvs-ports-line {\n display: flex;\n align-items: baseline;\n gap: 6px;\n min-width: 0;\n}\n\n.rvs-ports-addr {\n flex: 1;\n min-width: 0;\n overflow-wrap: anywhere;\n color: var(--rvs-fg);\n font-family: var(--rvs-mono);\n font-size: 11.5px;\n line-height: 1.45;\n}\n\n.rvs-ports-proc {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n/* State is never colour-only: the dot carries the state word as its label. */\n.rvs-ports-dot {\n flex: none;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--rvs-fg3);\n}\n\n.rvs-ports-dot.listening {\n background: var(--rvs-ok, #2ea043);\n}\n\n.rvs-ports-dot.error {\n background: var(--rvs-danger);\n}\n\n.rvs-ports-conn {\n color: var(--rvs-fg3);\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-ports-err {\n color: var(--rvs-danger);\n font-size: 11px;\n line-height: 1.45;\n overflow-wrap: anywhere;\n}\n\n.rvs-ports-actions {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 2px;\n min-width: 0;\n}\n\n/* The \"open\" affordance is a real link styled as a header button. */\n.rvs-ports-open {\n text-decoration: none;\n}\n\n.rvs-ports-hint {\n margin-top: 4px;\n color: var(--rvs-fg3);\n font-size: 11px;\n line-height: 1.45;\n overflow-wrap: anywhere;\n}\n\n/* --------------------------------------------------------- host monitor */\n\n/**\n * The monitor panel is cross-host (not bound to the workspace): one card for a\n * single subject, a compact clickable list for \"all hosts\". Values are\n * tabular-nums so a 5 s refresh does not make the text dance.\n */\n.rvs-monitor-body {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 8px 8px 14px;\n /* Container for the narrow-sidebar layout rules at the end of this section. */\n container-type: inline-size;\n}\n\n/* The rail title and the scope picker both wanted flex:1; the title yields so\n the picker keeps enough width for its own label at 230px. */\n.rvs-monitor-header .rvs-title {\n flex: none;\n}\n\n/* The panel's own settings (refresh interval). Shown under the header only\n while the gear is active; it is chrome, not a modal, so the live values stay\n visible above it. */\n.rvs-monitor-settings {\n flex: none;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px;\n border-bottom: 1px solid var(--rvs-border);\n background: var(--rvs-layer3);\n}\n\n.rvs-monitor-settings-head {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.rvs-monitor-settings-label {\n color: var(--rvs-fg2);\n font-size: 11px;\n font-weight: 600;\n}\n\n.rvs-monitor-settings-hint {\n color: var(--rvs-fg3);\n font-size: 10.5px;\n}\n\n.rvs-monitor-settings .rvs-seg {\n align-self: flex-start;\n}\n\n.rvs-monitor-card {\n margin: 2px 0 8px;\n padding: 10px;\n border: 1px solid var(--rvs-border2);\n border-radius: 9px;\n background: var(--rvs-layer3);\n}\n\n.rvs-monitor-card.error {\n border-color: rgba(224, 85, 85, .45);\n}\n\n.rvs-monitor-head {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n.rvs-monitor-dot {\n flex: none;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--rvs-fg3);\n}\n\n.rvs-monitor-dot.ok {\n background: var(--rvs-ok, #2ea043);\n}\n\n.rvs-monitor-dot.error {\n background: var(--rvs-danger);\n}\n\n.rvs-monitor-title {\n flex: none;\n max-width: 55%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 13px;\n font-weight: 650;\n color: var(--rvs-fg);\n}\n\n.rvs-monitor-conn {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: right;\n color: var(--rvs-fg3);\n font-size: 10.5px;\n}\n\n.rvs-monitor-sub {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: 6px;\n margin-top: 3px;\n font-size: 11px;\n}\n\n.rvs-monitor-state {\n flex: none;\n font-weight: 600;\n}\n\n.rvs-monitor-state.ok {\n color: var(--rvs-ok, #2ea043);\n}\n\n.rvs-monitor-state.error {\n color: var(--rvs-danger);\n}\n\n.rvs-monitor-state.unknown {\n color: var(--rvs-fg3);\n}\n\n.rvs-monitor-age {\n color: var(--rvs-fg3);\n font-variant-numeric: tabular-nums;\n}\n\n.rvs-monitor-reason {\n flex-basis: 100%;\n min-width: 0;\n overflow-wrap: anywhere;\n color: var(--rvs-fg2);\n line-height: 1.45;\n}\n\n.rvs-monitor-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));\n gap: 8px;\n margin-top: 10px;\n}\n\n.rvs-monitor-tile {\n display: flex;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n padding: 8px;\n border-radius: 7px;\n background: var(--rvs-hover);\n}\n\n.rvs-monitor-tile-label {\n color: var(--rvs-fg2);\n font-size: 10px;\n font-weight: 600;\n letter-spacing: .06em;\n text-transform: uppercase;\n}\n\n.rvs-monitor-tile-value {\n color: var(--rvs-fg);\n font-size: 18px;\n font-weight: 650;\n line-height: 1.1;\n font-variant-numeric: tabular-nums;\n}\n\n.rvs-monitor-tile-sub {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--rvs-fg2);\n font-size: 10.5px;\n}\n\n.rvs-monitor-bar {\n height: 4px;\n border-radius: 2px;\n background: var(--rvs-border);\n overflow: hidden;\n}\n\n.rvs-monitor-bar-fill {\n display: block;\n height: 100%;\n border-radius: inherit;\n background: var(--rvs-brand);\n transition: width .35s ease;\n}\n\n.rvs-monitor-bar-fill.warn {\n background: var(--rvs-git-m);\n}\n\n.rvs-monitor-bar-fill.hot {\n background: var(--rvs-danger);\n}\n\n/* Four facts: a 2×2 block reads calmer than three-then-one with auto-fit. */\n.rvs-monitor-facts {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 6px;\n margin-top: 8px;\n}\n\n.rvs-monitor-fact {\n min-width: 0;\n padding: 6px 8px;\n border: 1px solid var(--rvs-border);\n border-radius: 7px;\n}\n\n.rvs-monitor-fact-label {\n color: var(--rvs-fg2);\n font-size: 10px;\n font-weight: 600;\n letter-spacing: .06em;\n text-transform: uppercase;\n}\n\n.rvs-monitor-fact-value {\n color: var(--rvs-fg);\n font-size: 11.5px;\n line-height: 1.35;\n font-variant-numeric: tabular-nums;\n overflow-wrap: anywhere;\n}\n\n.rvs-monitor-sparks {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));\n gap: 8px;\n margin-top: 10px;\n}\n\n.rvs-monitor-spark {\n min-width: 0;\n padding: 6px 8px 4px;\n border: 1px solid var(--rvs-border);\n border-radius: 7px;\n}\n\n.rvs-monitor-spark-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 6px;\n min-width: 0;\n}\n\n.rvs-monitor-spark-legend {\n display: inline-flex;\n align-items: center;\n gap: 7px;\n flex: none;\n color: var(--rvs-fg3);\n font-size: 10px;\n}\n\n.rvs-monitor-spark-key {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n}\n\n.rvs-monitor-spark-line {\n display: inline-block;\n width: 10px;\n height: 0;\n border-top: 2px solid currentColor;\n}\n\n.rvs-monitor-spark-line.tx {\n border-top-style: dashed;\n opacity: .7;\n}\n\n.rvs-monitor-spark-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--rvs-fg2);\n font-size: 10px;\n font-weight: 600;\n letter-spacing: .06em;\n text-transform: uppercase;\n}\n\n.rvs-monitor-spark svg {\n display: block;\n width: 100%;\n height: 34px;\n margin-top: 2px;\n}\n\n.rvs-monitor-spark.cpu {\n color: var(--rvs-brand);\n}\n\n.rvs-monitor-spark.mem {\n color: var(--rvs-git-a);\n}\n\n.rvs-monitor-spark.net {\n color: var(--rvs-git-c);\n}\n\n.rvs-monitor-spark.temp {\n color: var(--rvs-git-m);\n}\n\n.rvs-monitor-spark-empty {\n padding: 8px 0 4px;\n text-align: center;\n color: var(--rvs-fg3);\n font-size: 10.5px;\n}\n\n.rvs-monitor-hint {\n margin-top: 8px;\n color: var(--rvs-fg3);\n font-size: 10.5px;\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n.rvs-monitor-list {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.rvs-monitor-summary {\n padding: 0 2px 4px;\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n.rvs-monitor-row {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n padding: 8px;\n border: 1px solid var(--rvs-border);\n border-radius: 8px;\n background: var(--rvs-layer3);\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n}\n\n.rvs-monitor-row:hover {\n border-color: var(--rvs-border2);\n background: var(--rvs-hover);\n}\n\n.rvs-monitor-row.error {\n border-color: rgba(224, 85, 85, .45);\n}\n\n.rvs-monitor-row-top {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n.rvs-monitor-row-name {\n flex: none;\n max-width: 50%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12.5px;\n font-weight: 600;\n}\n\n.rvs-monitor-row-host {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--rvs-fg3);\n font-size: 10.5px;\n}\n\n.rvs-monitor-row-cpu {\n flex: none;\n font-size: 12px;\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n}\n\n.rvs-monitor-row-bars {\n display: flex;\n gap: 4px;\n}\n\n.rvs-monitor-row-bar {\n flex: 1;\n height: 3px;\n border-radius: 2px;\n background: var(--rvs-border);\n overflow: hidden;\n}\n\n.rvs-monitor-row-facts {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 8px;\n color: var(--rvs-fg3);\n font-size: 10.5px;\n font-variant-numeric: tabular-nums;\n}\n\n/* ------------------------------------------------- narrow sidebar (<=260px)\n Container queries, not media queries: the rail is narrow while the WINDOW is\n wide. Reactions: the three gauges stack (an orphan grid cell with ~90px of\n empty space next to it looked broken), the four curves go 2×2 instead of a\n single tall column, and the all-hosts facts become a 2×2 grid so row heights\n stay uniform. */\n@container (max-width: 260px) {\n .rvs-monitor-grid {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .rvs-monitor-sparks {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n\n .rvs-monitor-row-facts {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n\n /* A 2-column spark is ~80px wide; the label must win over the legend there. */\n .rvs-monitor-spark-legend {\n display: none;\n }\n}\n\n/* ------------------------------------------------------ Ctrl+P quick open */\n\n.rvs-qo-mask {\n /* PORTALED to <body>, i.e. OUTSIDE `.rvs-root` where these tokens are\n declared — without this block every var() below resolves to nothing: the\n active row paints transparent (keyboard selection invisible), the directory\n column stops dimming, and error/warning copy comes out the same colour as\n ordinary text (so \"index failed\" looks like \"no match\"). Keep this subset in\n sync with `.rvs-root`; it lists exactly the tokens the `.rvs-qo*` rules use. */\n --rvs-fg: var(--dsw-alias-label-primary, #e6e6e6);\n --rvs-fg2: var(--dsw-alias-label-secondary, #b9b9b9);\n --rvs-fg3: var(--dsw-alias-label-tertiary, #8b8b8b);\n --rvs-hover: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, .14));\n --rvs-active: var(--dsw-alias-interactive-bg-active, rgba(77, 107, 254, .22));\n --rvs-border: var(--dsw-alias-border-l1, rgba(127, 127, 127, .25));\n --rvs-border2: var(--dsw-alias-border-l2, rgba(127, 127, 127, .38));\n --rvs-input: var(--dsw-alias-bg-input, rgba(127, 127, 127, .12));\n --rvs-brand: var(--dsw-alias-brand-primary, #4d6bfe);\n --rvs-danger: var(--dsw-alias-state-error-primary, #e05555);\n --rvs-git-m: #e2b714;\n --rvs-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;\n position: fixed;\n inset: 0;\n /* The modal layer (100000), so toasts (100001) still paint above it. */\n z-index: 100000;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n padding-top: 12vh;\n background: rgba(0, 0, 0, .38);\n backdrop-filter: blur(2px);\n animation: rvsFade .12s ease;\n}\n\n/**\n * Opaque base first, skin overlay on top: the overlay token is frequently\n * translucent, and using it alone let the panel's text bleed through the sheet\n * (the same fix the menu/modal layer needed).\n */\n.rvs-qo {\n width: min(680px, calc(100vw - 40px));\n max-height: min(62vh, 560px);\n display: flex;\n flex-direction: column;\n border: 1px solid var(--rvs-border2);\n border-radius: 10px;\n background-color: Canvas;\n background-image: linear-gradient(var(--dsw-alias-bg-overlay, transparent), var(--dsw-alias-bg-overlay, transparent));\n color: var(--rvs-fg);\n box-shadow: 0 16px 48px rgba(0, 0, 0, .42);\n font-size: 12.5px;\n overflow: hidden;\n animation: rvsPop .12s ease;\n}\n\n.rvs-qo-bar {\n flex: none;\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 10px 12px;\n border-bottom: 1px solid var(--rvs-border);\n}\n\n.rvs-qo-input {\n flex: 1;\n min-width: 0;\n height: 28px;\n padding: 0 8px;\n border: 1px solid var(--rvs-border);\n border-radius: 6px;\n background: var(--rvs-input);\n color: var(--rvs-fg);\n font: inherit;\n outline: none;\n}\n\n.rvs-qo-input:focus {\n border-color: var(--rvs-brand);\n}\n\n.rvs-qo-hint {\n flex: none;\n color: var(--rvs-fg3);\n font-size: 11px;\n white-space: nowrap;\n}\n\n.rvs-qo-list {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n padding: 4px;\n}\n\n.rvs-qo-row {\n display: flex;\n align-items: baseline;\n gap: 8px;\n padding: 4px 8px;\n border-radius: 5px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n\n.rvs-qo-row:hover {\n background: var(--rvs-hover);\n}\n\n/* Declared AFTER :hover so a hovered active row keeps the active colour. */\n.rvs-qo-row.active {\n background: var(--rvs-active);\n}\n\n.rvs-qo-dir {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n color: var(--rvs-fg3);\n font-size: 11.5px;\n}\n\n.rvs-qo-name {\n flex: none;\n color: var(--rvs-fg);\n font-family: var(--rvs-mono);\n font-size: 12px;\n}\n\n.rvs-qo-hit {\n padding: 0;\n border-radius: 2px;\n background: rgba(77, 107, 254, .32);\n color: inherit;\n font-weight: 600;\n}\n\n.rvs-qo-foot {\n flex: none;\n display: flex;\n flex-direction: column;\n gap: 2px;\n max-height: 72px;\n overflow-y: auto;\n padding: 6px 12px;\n border-top: 1px solid var(--rvs-border);\n color: var(--rvs-fg3);\n font-size: 11px;\n}\n\n.rvs-qo-note {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.rvs-qo-note.error {\n color: var(--rvs-danger);\n}\n\n.rvs-qo-note.warn {\n color: var(--rvs-git-m);\n}\n";
|
|
15
15
|
const key$2 = "src/client/vsc/vsc.css";
|
|
16
16
|
const injected$2 = typeof document === "undefined" ? void 0 : Array.prototype.find.call(document.querySelectorAll("style[data-rvs-css]"), (tag) => tag.dataset.rvsCss === key$2);
|
|
17
17
|
if (typeof document !== "undefined" && injected$2 === void 0) {
|
|
@@ -264,11 +264,11 @@ window.__ModuleLoader__.load({
|
|
|
264
264
|
const views = /* @__PURE__ */ new Map();
|
|
265
265
|
/** Explicit-retry successes (epoch ms): a stale poll error must not undo them. */
|
|
266
266
|
const probes = /* @__PURE__ */ new Map();
|
|
267
|
-
const listeners$
|
|
267
|
+
const listeners$6 = /* @__PURE__ */ new Set();
|
|
268
268
|
/** Last value handed to `useSyncExternalStore` — a new object only on change. */
|
|
269
269
|
let snapshot$1;
|
|
270
270
|
function notify$1() {
|
|
271
|
-
for (const listener of listeners$
|
|
271
|
+
for (const listener of listeners$6) listener();
|
|
272
272
|
}
|
|
273
273
|
/** Recompute the snapshot for the ACTIVE alias and wake subscribers. */
|
|
274
274
|
function refreshSnapshot() {
|
|
@@ -368,8 +368,8 @@ window.__ModuleLoader__.load({
|
|
|
368
368
|
/** Subscribe to the active alias's connection view (undefined when none). */
|
|
369
369
|
function useConnectionStatus() {
|
|
370
370
|
return (0, react.useSyncExternalStore)((listener) => {
|
|
371
|
-
listeners$
|
|
372
|
-
return () => listeners$
|
|
371
|
+
listeners$6.add(listener);
|
|
372
|
+
return () => listeners$6.delete(listener);
|
|
373
373
|
}, () => snapshot$1);
|
|
374
374
|
}
|
|
375
375
|
//#endregion
|
|
@@ -513,6 +513,25 @@ window.__ModuleLoader__.load({
|
|
|
513
513
|
"term.copy": "复制",
|
|
514
514
|
"term.paste": "粘贴",
|
|
515
515
|
"term.selectAll": "全选",
|
|
516
|
+
"term.pathMissing": "终端里的这个路径在远端不存在,无法在目录中定位。",
|
|
517
|
+
"term.pathOutside": "这个路径不在任何远端工作区内,目录树里没有它的位置。",
|
|
518
|
+
"term.pathBlocked": "有未保存的编辑器标签:切换工作区会关闭它们,先处理再跳转。",
|
|
519
|
+
"term.snippets": "常用指令",
|
|
520
|
+
"term.snippetAdd": "新增常用指令",
|
|
521
|
+
"term.snippetEdit": "修改常用指令",
|
|
522
|
+
"term.snippetDelete": "删除",
|
|
523
|
+
"term.snippetDeleteTitle": "删除这条常用指令?",
|
|
524
|
+
"term.snippetName": "指令名",
|
|
525
|
+
"term.snippetNamePlaceholder": "例如:推送 master",
|
|
526
|
+
"term.snippetCommand": "指令内容",
|
|
527
|
+
"term.snippetCommandPlaceholder": "例如:git push origin master",
|
|
528
|
+
"term.snippetEmpty": "还没有常用指令:点「+」或按 Ctrl+B 新增。",
|
|
529
|
+
"term.snippetInsertHint": "点一下粘贴到终端命令行(不发送)",
|
|
530
|
+
"term.snippetFootHint": "点条目粘贴(不发送)· 拖拽排序 · Ctrl+B 新增",
|
|
531
|
+
"term.snippetDragHint": "拖拽调整顺序(Alt+↑/↓ 也可)",
|
|
532
|
+
"term.snippetNameRequired": "指令名不能为空。",
|
|
533
|
+
"term.snippetCommandRequired": "指令内容不能为空。",
|
|
534
|
+
"term.snippetNoTerminal": "当前没有已连接的终端,先新建一个终端。",
|
|
516
535
|
"term.noHosts": "还没有主机,请先去「设置 → 远程主机」配置。",
|
|
517
536
|
"tab.git": "Git",
|
|
518
537
|
"git.hint": "请选择远端路径为 git 仓库的工作区。",
|
|
@@ -526,6 +545,7 @@ window.__ModuleLoader__.load({
|
|
|
526
545
|
"common.loading": "加载中…",
|
|
527
546
|
"common.ok": "确定",
|
|
528
547
|
"common.cancel": "取消",
|
|
548
|
+
"common.save": "保存",
|
|
529
549
|
"flow.title": "添加工作区",
|
|
530
550
|
"flow.local": "本地",
|
|
531
551
|
"flow.remote": "远程",
|
|
@@ -585,6 +605,11 @@ window.__ModuleLoader__.load({
|
|
|
585
605
|
"float.placeholderHint": "编辑器只有一份实例,已浮出到窗口中央;关闭悬浮窗或点「停靠」后回到这里。",
|
|
586
606
|
"float.dockBack": "停靠回主界面",
|
|
587
607
|
"float.unavailable": "当前宿主没有全帧悬浮层(shell.overlay),悬浮编辑器不可用。",
|
|
608
|
+
"float.dockedElsewhere": "远程编辑器已停靠在侧边栏",
|
|
609
|
+
"float.dockedElsewhereHint": "编辑器只有一份实例,当前在侧边栏里;点下面的按钮把它移到这里全宽显示。",
|
|
610
|
+
"float.openHere": "在这里全宽打开",
|
|
611
|
+
"float.centerElsewhere": "远程编辑器在会话区全宽显示",
|
|
612
|
+
"float.centerElsewhereHint": "编辑器只有一份实例,当前在会话区的「远程编辑器」标签里;点下面的按钮把它收回侧边栏。",
|
|
588
613
|
"files.rename": "重命名",
|
|
589
614
|
"files.copy": "复制",
|
|
590
615
|
"files.cut": "剪切",
|
|
@@ -829,14 +854,11 @@ window.__ModuleLoader__.load({
|
|
|
829
854
|
"history.expand": "展开详情面板",
|
|
830
855
|
"history.restore": "还原列表布局",
|
|
831
856
|
"history.diffToolbar": "补丁工具",
|
|
832
|
-
"editor.empty": "没有打开的文件。在资源管理器里双击文件,或在源代码管理里点击更改。",
|
|
833
|
-
"editor.saveHint": "保存",
|
|
834
857
|
"editor.preview": "预览",
|
|
835
858
|
"editor.source": "源码",
|
|
836
859
|
"editor.imageFailed": "图片读取失败。",
|
|
837
860
|
"editor.closeDirty": "有未保存的修改",
|
|
838
861
|
"editor.discardClose": "放弃并关闭",
|
|
839
|
-
"editor.resizeHint": "拖拽调整面板 / 编辑器占比",
|
|
840
862
|
"editor.openedIn": "已在顶部标签打开:",
|
|
841
863
|
"editor.readTimeout": "读取超时(远端无响应)",
|
|
842
864
|
"editor.conflictTitle": "远端文件已变更,已阻止覆盖",
|
|
@@ -861,6 +883,48 @@ window.__ModuleLoader__.load({
|
|
|
861
883
|
"editor.discardSwitch": "放弃修改并切换",
|
|
862
884
|
"editor.switchTimeout": "等待切换确认超时,已取消本次切换(未保存的修改仍在);请重新选择工作区。",
|
|
863
885
|
"editor.truncatedReadOnly": "文件超过可编辑上限(8MiB),只读呈现,不能保存。",
|
|
886
|
+
"editor.tabsLabel": "打开的编辑器",
|
|
887
|
+
"editor.diffSuffix": "(差异)",
|
|
888
|
+
"editor.wrap": "自动换行",
|
|
889
|
+
"editor.fontSmaller": "减小字号(Ctrl+滚轮)",
|
|
890
|
+
"editor.fontLarger": "增大字号(Ctrl+滚轮)",
|
|
891
|
+
"editor.openInCenter": "在会话区全宽打开",
|
|
892
|
+
"editor.dockToSidebar": "收回侧边栏",
|
|
893
|
+
"editor.binaryTitle": "二进制文件",
|
|
894
|
+
"editor.dockEmptyTitle": "编辑器",
|
|
895
|
+
"editor.dockEmptyHint": "从资源管理器或搜索结果中打开一个文件",
|
|
896
|
+
"editor.centerEmptyTitle": "远程编辑器",
|
|
897
|
+
"editor.centerEmptyHint": "从侧边栏的「资源管理器」或「搜索」打开一个文件,它会在这里全宽显示。",
|
|
898
|
+
"editor.emptyShortcuts": "Ctrl+S 保存 · Ctrl+F 查找 · Ctrl+滚轮缩放字号",
|
|
899
|
+
"editor.statusSaving": "保存中…",
|
|
900
|
+
"editor.statusClean": "已保存",
|
|
901
|
+
"editor.statusLanguage": "语言",
|
|
902
|
+
"editor.statusPosition": "行:列(1-based)",
|
|
903
|
+
"editor.statusPositionValue": "行 {line},列 {column}",
|
|
904
|
+
"editor.statusSelected": "已选字符数",
|
|
905
|
+
"editor.statusSelectedValue": "已选 {count}",
|
|
906
|
+
"editor.statusIndent": "缩进(按文件内容推测)",
|
|
907
|
+
"editor.statusReadOnly": "只读",
|
|
908
|
+
"editor.statusReadOnlyTitle": "只读(二进制、文件过大或连接断开)",
|
|
909
|
+
"editor.statusWrapOn": "自动换行:开",
|
|
910
|
+
"editor.statusWrapOff": "自动换行:关",
|
|
911
|
+
"editor.statusWrapToggle": "切换自动换行",
|
|
912
|
+
"editor.statusFont": "字号(Ctrl+滚轮可缩放)",
|
|
913
|
+
"editor.statusSaved": "保存状态",
|
|
914
|
+
"editor.statusEncoding": "文件编码(远端按 UTF-8 读写)",
|
|
915
|
+
"editor.statusError": "错误",
|
|
916
|
+
"editor.diffTitle": "差异",
|
|
917
|
+
"editor.diffReadOnlyTitle": "统一 diff 以只读方式渲染",
|
|
918
|
+
"editor.crumbRoot": "工作区",
|
|
919
|
+
"editor.crumbLabel": "文件路径",
|
|
920
|
+
"editor.crumbUp": "上一级",
|
|
921
|
+
"editor.crumbEmpty": "空目录",
|
|
922
|
+
"editor.imageHint": "点击切换适应窗口 / 原始大小",
|
|
923
|
+
"editor.imageFitHint": "点击适应窗口",
|
|
924
|
+
"editor.imageFailedHint": "文件可能已损坏,或不是受支持的图片格式。",
|
|
925
|
+
"editor.imageTooLargeTitle": "图片过大",
|
|
926
|
+
"editor.imageTooLargeHint": "大小 {size} KiB,超出读取上限,不提供预览。",
|
|
927
|
+
"editor.switchToEdit": "切换为内容编辑(在编辑器里打开这个文件)",
|
|
864
928
|
"git.notARepo": "当前远端工作区不是 git 仓库。",
|
|
865
929
|
"changes.title": "本次改动",
|
|
866
930
|
"changes.toggle": "展开或收起本次会话的改动文件",
|
|
@@ -1143,6 +1207,25 @@ window.__ModuleLoader__.load({
|
|
|
1143
1207
|
"term.copy": "Copy",
|
|
1144
1208
|
"term.paste": "Paste",
|
|
1145
1209
|
"term.selectAll": "Select all",
|
|
1210
|
+
"term.pathMissing": "That path does not exist on the remote host, so there is nothing to reveal.",
|
|
1211
|
+
"term.pathOutside": "That path is outside every remote workspace, so the directory tree cannot show it.",
|
|
1212
|
+
"term.pathBlocked": "Some editor tabs have unsaved changes; switching workspace would close them. Save or discard those first.",
|
|
1213
|
+
"term.snippets": "Snippets",
|
|
1214
|
+
"term.snippetAdd": "Add snippet",
|
|
1215
|
+
"term.snippetEdit": "Edit snippet",
|
|
1216
|
+
"term.snippetDelete": "Delete",
|
|
1217
|
+
"term.snippetDeleteTitle": "Delete this snippet?",
|
|
1218
|
+
"term.snippetName": "Name",
|
|
1219
|
+
"term.snippetNamePlaceholder": "e.g. push master",
|
|
1220
|
+
"term.snippetCommand": "Command",
|
|
1221
|
+
"term.snippetCommandPlaceholder": "e.g. git push origin master",
|
|
1222
|
+
"term.snippetEmpty": "No snippets yet: press \"+\" or Ctrl+B to add one.",
|
|
1223
|
+
"term.snippetInsertHint": "Click to paste into the terminal (not sent)",
|
|
1224
|
+
"term.snippetFootHint": "Click a row to paste (no Enter) · drag to reorder · Ctrl+B to add",
|
|
1225
|
+
"term.snippetDragHint": "Drag to reorder (Alt+Up/Down works too)",
|
|
1226
|
+
"term.snippetNameRequired": "The name cannot be empty.",
|
|
1227
|
+
"term.snippetCommandRequired": "The command cannot be empty.",
|
|
1228
|
+
"term.snippetNoTerminal": "No connected terminal: open one first.",
|
|
1146
1229
|
"term.noHosts": "No hosts yet. Configure one in Settings → Remote Hosts first.",
|
|
1147
1230
|
"tab.git": "Git",
|
|
1148
1231
|
"git.hint": "Pick a workspace whose remote path is a git repository.",
|
|
@@ -1156,6 +1239,7 @@ window.__ModuleLoader__.load({
|
|
|
1156
1239
|
"common.loading": "Loading…",
|
|
1157
1240
|
"common.ok": "OK",
|
|
1158
1241
|
"common.cancel": "Cancel",
|
|
1242
|
+
"common.save": "Save",
|
|
1159
1243
|
"flow.title": "Add workspace",
|
|
1160
1244
|
"flow.local": "Local",
|
|
1161
1245
|
"flow.remote": "Remote",
|
|
@@ -1215,6 +1299,11 @@ window.__ModuleLoader__.load({
|
|
|
1215
1299
|
"float.placeholderHint": "There is only one editor instance and it is out in the floating window; close that window or press Dock to bring it back here.",
|
|
1216
1300
|
"float.dockBack": "Dock back",
|
|
1217
1301
|
"float.unavailable": "This host has no frame-wide overlay slot (shell.overlay); the floating editor is unavailable.",
|
|
1302
|
+
"float.dockedElsewhere": "The remote editor is docked in the sidebar",
|
|
1303
|
+
"float.dockedElsewhereHint": "There is only one editor instance and it lives in the sidebar; press the button below to show it here at full width.",
|
|
1304
|
+
"float.openHere": "Open here at full width",
|
|
1305
|
+
"float.centerElsewhere": "The remote editor is shown full width in the conversation view",
|
|
1306
|
+
"float.centerElsewhereHint": "There is only one editor instance and it lives in the conversation view's \"remote editor\" tab; press the button below to dock it back into the sidebar.",
|
|
1218
1307
|
"files.rename": "Rename",
|
|
1219
1308
|
"files.copy": "Copy",
|
|
1220
1309
|
"files.cut": "Cut",
|
|
@@ -1459,14 +1548,11 @@ window.__ModuleLoader__.load({
|
|
|
1459
1548
|
"history.expand": "Expand the details pane",
|
|
1460
1549
|
"history.restore": "Restore the list layout",
|
|
1461
1550
|
"history.diffToolbar": "Patch tools",
|
|
1462
|
-
"editor.empty": "No open file. Double-click a file in the explorer, or click a change in source control.",
|
|
1463
|
-
"editor.saveHint": "save",
|
|
1464
1551
|
"editor.preview": "Preview",
|
|
1465
1552
|
"editor.source": "Source",
|
|
1466
1553
|
"editor.imageFailed": "Could not read the image.",
|
|
1467
1554
|
"editor.closeDirty": "Unsaved changes",
|
|
1468
1555
|
"editor.discardClose": "Discard and close",
|
|
1469
|
-
"editor.resizeHint": "Drag to resize panel / editor",
|
|
1470
1556
|
"editor.openedIn": "Opened in the top tab:",
|
|
1471
1557
|
"editor.readTimeout": "Read timed out (host not responding)",
|
|
1472
1558
|
"editor.conflictTitle": "Remote file changed — save blocked",
|
|
@@ -1491,6 +1577,48 @@ window.__ModuleLoader__.load({
|
|
|
1491
1577
|
"editor.discardSwitch": "Discard changes and switch",
|
|
1492
1578
|
"editor.switchTimeout": "Timed out waiting for the switch confirmation, so the switch was cancelled (unsaved edits are kept). Pick the workspace again.",
|
|
1493
1579
|
"editor.truncatedReadOnly": "File is larger than the editable limit (8MiB): read-only, saving is blocked.",
|
|
1580
|
+
"editor.tabsLabel": "Open editors",
|
|
1581
|
+
"editor.diffSuffix": " (diff)",
|
|
1582
|
+
"editor.wrap": "Word wrap",
|
|
1583
|
+
"editor.fontSmaller": "Smaller font (Ctrl+wheel)",
|
|
1584
|
+
"editor.fontLarger": "Larger font (Ctrl+wheel)",
|
|
1585
|
+
"editor.openInCenter": "Open full width in the conversation view",
|
|
1586
|
+
"editor.dockToSidebar": "Dock back to the sidebar",
|
|
1587
|
+
"editor.binaryTitle": "Binary file",
|
|
1588
|
+
"editor.dockEmptyTitle": "Editor",
|
|
1589
|
+
"editor.dockEmptyHint": "Open a file from the explorer or the search results",
|
|
1590
|
+
"editor.centerEmptyTitle": "Remote editor",
|
|
1591
|
+
"editor.centerEmptyHint": "Open a file from the sidebar Explorer or Search and it appears here at full width.",
|
|
1592
|
+
"editor.emptyShortcuts": "Ctrl+S save · Ctrl+F find · Ctrl+wheel zoom",
|
|
1593
|
+
"editor.statusSaving": "Saving…",
|
|
1594
|
+
"editor.statusClean": "Saved",
|
|
1595
|
+
"editor.statusLanguage": "Language",
|
|
1596
|
+
"editor.statusPosition": "Line:column (1-based)",
|
|
1597
|
+
"editor.statusPositionValue": "Line {line}, column {column}",
|
|
1598
|
+
"editor.statusSelected": "Selected characters",
|
|
1599
|
+
"editor.statusSelectedValue": "{count} selected",
|
|
1600
|
+
"editor.statusIndent": "Indentation (guessed from the content)",
|
|
1601
|
+
"editor.statusReadOnly": "Read-only",
|
|
1602
|
+
"editor.statusReadOnlyTitle": "Read-only (binary, over the read cap, or the link is down)",
|
|
1603
|
+
"editor.statusWrapOn": "Word wrap: on",
|
|
1604
|
+
"editor.statusWrapOff": "Word wrap: off",
|
|
1605
|
+
"editor.statusWrapToggle": "Toggle word wrap",
|
|
1606
|
+
"editor.statusFont": "Font size (Ctrl+wheel to zoom)",
|
|
1607
|
+
"editor.statusSaved": "Save state",
|
|
1608
|
+
"editor.statusEncoding": "File encoding (the remote side is read and written as UTF-8)",
|
|
1609
|
+
"editor.statusError": "Error",
|
|
1610
|
+
"editor.diffTitle": "Diff",
|
|
1611
|
+
"editor.diffReadOnlyTitle": "A unified diff is rendered read-only",
|
|
1612
|
+
"editor.crumbRoot": "Workspace",
|
|
1613
|
+
"editor.crumbLabel": "File path",
|
|
1614
|
+
"editor.crumbUp": "Parent folder",
|
|
1615
|
+
"editor.crumbEmpty": "Empty directory",
|
|
1616
|
+
"editor.imageHint": "Click to toggle fit / actual size",
|
|
1617
|
+
"editor.imageFitHint": "Click to fit the window",
|
|
1618
|
+
"editor.imageFailedHint": "The file may be damaged or not a supported image format.",
|
|
1619
|
+
"editor.imageTooLargeTitle": "Image too large",
|
|
1620
|
+
"editor.imageTooLargeHint": "Size {size} KiB, above the read cap; no preview is provided.",
|
|
1621
|
+
"editor.switchToEdit": "Switch to content editing (open this file in the editor)",
|
|
1494
1622
|
"git.notARepo": "This remote workspace is not a git repository.",
|
|
1495
1623
|
"changes.title": "Changed files",
|
|
1496
1624
|
"changes.toggle": "Show or hide the files this session changed",
|
|
@@ -4084,14 +4212,14 @@ window.__ModuleLoader__.load({
|
|
|
4084
4212
|
}
|
|
4085
4213
|
//#endregion
|
|
4086
4214
|
//#region src/client/changes/undo-context.ts
|
|
4087
|
-
let current;
|
|
4215
|
+
let current$2;
|
|
4088
4216
|
/** Publish the validated provenance for the tab currently on screen (or nothing). */
|
|
4089
4217
|
function setUndoContext(context) {
|
|
4090
|
-
current = context;
|
|
4218
|
+
current$2 = context;
|
|
4091
4219
|
}
|
|
4092
4220
|
/** The coordinates a revert should use right now, if any. */
|
|
4093
4221
|
function undoContext() {
|
|
4094
|
-
return current;
|
|
4222
|
+
return current$2;
|
|
4095
4223
|
}
|
|
4096
4224
|
//#endregion
|
|
4097
4225
|
//#region src/client/changes/undo-target.ts
|
|
@@ -5920,6 +6048,41 @@ window.__ModuleLoader__.load({
|
|
|
5920
6048
|
for (const id of [...viewStates.keys()]) if (!liveIds.has(id)) viewStates.delete(id);
|
|
5921
6049
|
}
|
|
5922
6050
|
//#endregion
|
|
6051
|
+
//#region src/client/editor-capability.ts
|
|
6052
|
+
/**
|
|
6053
|
+
* Whether this page has ANY seat that can render the plugin's editor.
|
|
6054
|
+
*
|
|
6055
|
+
* Why not "is an `EditorPane` mounted right now": the editor panels are
|
|
6056
|
+
* lazy/keep-alive (the sidebar's editor page is only rendered after the rail has
|
|
6057
|
+
* visited it, and the conversation-view seat only exists while its host tab is
|
|
6058
|
+
* selected). That made the first file click after a page load fall back to the
|
|
6059
|
+
* host's native preview — which cannot resolve remote paths at all — even though
|
|
6060
|
+
* our editor was one click away. The question the interceptor must answer is
|
|
6061
|
+
* "could this file be shown in our editor in this page", i.e. a seat exists.
|
|
6062
|
+
*
|
|
6063
|
+
* Seats are registered exactly where a surface is registered:
|
|
6064
|
+
* - the better-sidebar tab (`index.tsx` `goBetter`),
|
|
6065
|
+
* - the native right-sidebar page (`registerNativeExplorer` returning a
|
|
6066
|
+
* disposer),
|
|
6067
|
+
* - the conversation-view tab (`conversation.view` registration).
|
|
6068
|
+
*
|
|
6069
|
+
* Pure module (no React/DOM) so the gate can drive register/unregister.
|
|
6070
|
+
*/
|
|
6071
|
+
/** Live seats on this page (0 = nothing of ours can render an editor). */
|
|
6072
|
+
let seats = 0;
|
|
6073
|
+
/** One seat became available (a tab/view registration succeeded). */
|
|
6074
|
+
function noteEditorSeatAvailable() {
|
|
6075
|
+
seats += 1;
|
|
6076
|
+
}
|
|
6077
|
+
/** One seat went away (a registration was disposed); never negative. */
|
|
6078
|
+
function noteEditorSeatGone() {
|
|
6079
|
+
seats = Math.max(0, seats - 1);
|
|
6080
|
+
}
|
|
6081
|
+
/** How many seats exist right now. */
|
|
6082
|
+
function editorSeatCount() {
|
|
6083
|
+
return seats;
|
|
6084
|
+
}
|
|
6085
|
+
//#endregion
|
|
5923
6086
|
//#region src/client/shell.ts
|
|
5924
6087
|
/**
|
|
5925
6088
|
* Shell quoting for the lines this plugin types into a remote terminal.
|
|
@@ -7289,6 +7452,10 @@ window.__ModuleLoader__.load({
|
|
|
7289
7452
|
function IconDiff(props) {
|
|
7290
7453
|
return svg(props.size ?? 14, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M2.6 3.6h10.8M5.4 8h8M5.4 12.4h8M2.6 8h.01M2.6 12.4h.01" }), props.className);
|
|
7291
7454
|
}
|
|
7455
|
+
/** Float / pop-out: a small frame with an arrow leaving its top-right corner. */
|
|
7456
|
+
function IconFloat(props) {
|
|
7457
|
+
return svg(props.size ?? 13, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M9.4 2.6h4v4M13.4 2.6 8.4 7.6" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12.6 9.4v3.2a.8.8 0 0 1-.8.8H3a.8.8 0 0 1-.8-.8V4a.8.8 0 0 1 .8-.8h3.4" })] }), props.className);
|
|
7458
|
+
}
|
|
7292
7459
|
function IconSync(props) {
|
|
7293
7460
|
return svg(props.size ?? 14, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M13 8a5 5 0 0 1-8.6 3.4M3 8a5 5 0 0 1 8.6-3.4M11.6 2.4v2.6H9M4.4 13.6v-2.6H7" }), props.className);
|
|
7294
7461
|
}
|
|
@@ -7357,13 +7524,21 @@ window.__ModuleLoader__.load({
|
|
|
7357
7524
|
className: props.className
|
|
7358
7525
|
});
|
|
7359
7526
|
}
|
|
7527
|
+
/**
|
|
7528
|
+
* Raster formats the editor previews as pictures.
|
|
7529
|
+
*
|
|
7530
|
+
* SVG is deliberately NOT here: it is UTF-8 markup, editing it as text is
|
|
7531
|
+
* genuinely useful, and the host only ships base64 for files it classified as
|
|
7532
|
+
* binary — an SVG would arrive as text with no payload, so an "image" tab could
|
|
7533
|
+
* neither render it nor edit it (reported by review 2026-11-23). `mimeFor` keeps
|
|
7534
|
+
* the `image/svg+xml` entry for callers that only need a MIME type.
|
|
7535
|
+
*/
|
|
7360
7536
|
const IMAGE_EXTS = /* @__PURE__ */ new Set([
|
|
7361
7537
|
"png",
|
|
7362
7538
|
"jpg",
|
|
7363
7539
|
"jpeg",
|
|
7364
7540
|
"gif",
|
|
7365
7541
|
"webp",
|
|
7366
|
-
"svg",
|
|
7367
7542
|
"bmp",
|
|
7368
7543
|
"ico",
|
|
7369
7544
|
"avif"
|
|
@@ -7467,14 +7642,14 @@ window.__ModuleLoader__.load({
|
|
|
7467
7642
|
let toasts = [];
|
|
7468
7643
|
/** Mounted dialog hosts in mount order: the first one renders the portal. */
|
|
7469
7644
|
let hostOwners = [];
|
|
7470
|
-
const listeners$
|
|
7471
|
-
function emit() {
|
|
7472
|
-
for (const listener of listeners$
|
|
7645
|
+
const listeners$5 = /* @__PURE__ */ new Set();
|
|
7646
|
+
function emit$2() {
|
|
7647
|
+
for (const listener of listeners$5) listener();
|
|
7473
7648
|
}
|
|
7474
7649
|
function subscribe(listener) {
|
|
7475
|
-
listeners$
|
|
7650
|
+
listeners$5.add(listener);
|
|
7476
7651
|
return () => {
|
|
7477
|
-
listeners$
|
|
7652
|
+
listeners$5.delete(listener);
|
|
7478
7653
|
};
|
|
7479
7654
|
}
|
|
7480
7655
|
/**
|
|
@@ -7511,7 +7686,7 @@ window.__ModuleLoader__.load({
|
|
|
7511
7686
|
placeholder: void 0,
|
|
7512
7687
|
resolve: (value) => resolve(value === true)
|
|
7513
7688
|
};
|
|
7514
|
-
emit();
|
|
7689
|
+
emit$2();
|
|
7515
7690
|
});
|
|
7516
7691
|
}
|
|
7517
7692
|
/** Themed prompt; resolves undefined when dismissed. */
|
|
@@ -7531,7 +7706,7 @@ window.__ModuleLoader__.load({
|
|
|
7531
7706
|
placeholder: opts.placeholder,
|
|
7532
7707
|
resolve: (value) => resolve(typeof value === "string" ? value : void 0)
|
|
7533
7708
|
};
|
|
7534
|
-
emit();
|
|
7709
|
+
emit$2();
|
|
7535
7710
|
});
|
|
7536
7711
|
}
|
|
7537
7712
|
/** Transient status message (bottom-right, auto-dismiss). */
|
|
@@ -7542,16 +7717,16 @@ window.__ModuleLoader__.load({
|
|
|
7542
7717
|
text,
|
|
7543
7718
|
error
|
|
7544
7719
|
}];
|
|
7545
|
-
emit();
|
|
7720
|
+
emit$2();
|
|
7546
7721
|
setTimeout(() => {
|
|
7547
7722
|
toasts = toasts.filter((t) => t.id !== id);
|
|
7548
|
-
emit();
|
|
7723
|
+
emit$2();
|
|
7549
7724
|
}, error ? 6e3 : 2600).unref?.();
|
|
7550
7725
|
}
|
|
7551
7726
|
/** Dismiss the open modal without a decision. */
|
|
7552
7727
|
function closeModal() {
|
|
7553
7728
|
modalRequest = void 0;
|
|
7554
|
-
emit();
|
|
7729
|
+
emit$2();
|
|
7555
7730
|
}
|
|
7556
7731
|
/**
|
|
7557
7732
|
* The single host that renders the modal + toast layer.
|
|
@@ -7570,11 +7745,11 @@ window.__ModuleLoader__.load({
|
|
|
7570
7745
|
const id = mine.current;
|
|
7571
7746
|
if (!hostOwners.includes(id)) {
|
|
7572
7747
|
hostOwners = [...hostOwners, id];
|
|
7573
|
-
emit();
|
|
7748
|
+
emit$2();
|
|
7574
7749
|
}
|
|
7575
7750
|
return () => {
|
|
7576
7751
|
hostOwners = hostOwners.filter((owner) => owner !== id);
|
|
7577
|
-
emit();
|
|
7752
|
+
emit$2();
|
|
7578
7753
|
};
|
|
7579
7754
|
}, []);
|
|
7580
7755
|
if (typeof document === "undefined") return null;
|
|
@@ -7921,6 +8096,133 @@ window.__ModuleLoader__.load({
|
|
|
7921
8096
|
});
|
|
7922
8097
|
}
|
|
7923
8098
|
//#endregion
|
|
8099
|
+
//#region src/client/vsc/terminal-links.ts
|
|
8100
|
+
/**
|
|
8101
|
+
* A run that may be a path: either an explicitly rooted form (`/`, `~/`, `./`,
|
|
8102
|
+
* `../`) or a relative one that contains a `/` with a non-empty first segment.
|
|
8103
|
+
*/
|
|
8104
|
+
const PATH_RUN = /(?:~\/|\/|\.{1,2}\/|[A-Za-z0-9_.@%+-]+\/)[A-Za-z0-9_.%+/@~-]*/g;
|
|
8105
|
+
/** Characters that end a path when they are the LAST character (sentence/quote noise). */
|
|
8106
|
+
const TRAILING_NOISE = /* @__PURE__ */ new Set([
|
|
8107
|
+
".",
|
|
8108
|
+
",",
|
|
8109
|
+
":",
|
|
8110
|
+
";",
|
|
8111
|
+
"!",
|
|
8112
|
+
"?",
|
|
8113
|
+
")",
|
|
8114
|
+
"]",
|
|
8115
|
+
"}",
|
|
8116
|
+
">",
|
|
8117
|
+
"\"",
|
|
8118
|
+
"'",
|
|
8119
|
+
"`"
|
|
8120
|
+
]);
|
|
8121
|
+
/** `file.ts:12` / `file.ts:12:5` — the part editors and compilers append. */
|
|
8122
|
+
const LOCATION_SUFFIX = /^(.*?):(\d+)(?::(\d+))?$/;
|
|
8123
|
+
/** Lower-case file extension-ish tail that a sentence dot must not eat. */
|
|
8124
|
+
function stripLocationSuffix(raw) {
|
|
8125
|
+
const match = LOCATION_SUFFIX.exec(raw);
|
|
8126
|
+
if (match === null) return raw;
|
|
8127
|
+
const base = match[1] ?? "";
|
|
8128
|
+
if (base === "" || !base.includes("/")) return raw;
|
|
8129
|
+
return base;
|
|
8130
|
+
}
|
|
8131
|
+
/** Collapse `//`, resolve `.`/`..` and drop a trailing slash (POSIX semantics). */
|
|
8132
|
+
function normalizeRemotePath(path) {
|
|
8133
|
+
const absolute = path.startsWith("/");
|
|
8134
|
+
const parts = [];
|
|
8135
|
+
for (const part of path.split("/")) {
|
|
8136
|
+
if (part === "" || part === ".") continue;
|
|
8137
|
+
if (part === "..") {
|
|
8138
|
+
if (parts.length > 0 && parts[parts.length - 1] !== "..") parts.pop();
|
|
8139
|
+
else if (!absolute) parts.push("..");
|
|
8140
|
+
continue;
|
|
8141
|
+
}
|
|
8142
|
+
parts.push(part);
|
|
8143
|
+
}
|
|
8144
|
+
const joined = parts.join("/");
|
|
8145
|
+
if (absolute) return parts.length === 0 ? "/" : `/${joined}`;
|
|
8146
|
+
return joined === "" ? "." : joined;
|
|
8147
|
+
}
|
|
8148
|
+
/** Join a base directory and a relative token (POSIX, no trailing slash). */
|
|
8149
|
+
function joinRemotePath(base, token) {
|
|
8150
|
+
return normalizeRemotePath(`${base.replace(/\/+$/, "")}/${token}`);
|
|
8151
|
+
}
|
|
8152
|
+
/** The parent directory of an absolute path (`/a/b/c` → `/a/b`; `/a` → `/`). */
|
|
8153
|
+
function parentDirectoryOf(path) {
|
|
8154
|
+
const normalized = normalizeRemotePath(path);
|
|
8155
|
+
if (normalized === "/") return "/";
|
|
8156
|
+
const cut = normalized.lastIndexOf("/");
|
|
8157
|
+
return cut <= 0 ? "/" : normalized.slice(0, cut);
|
|
8158
|
+
}
|
|
8159
|
+
/** Whether `path` is `root` itself or lives under it. */
|
|
8160
|
+
function isWithinRoot(path, root) {
|
|
8161
|
+
const normalizedPath = normalizeRemotePath(path);
|
|
8162
|
+
const normalizedRoot = normalizeRemotePath(root);
|
|
8163
|
+
return normalizedPath === normalizedRoot || normalizedPath.startsWith(`${normalizedRoot.replace(/\/+$/, "")}/`);
|
|
8164
|
+
}
|
|
8165
|
+
/**
|
|
8166
|
+
* Every path-looking token of one terminal line, in order.
|
|
8167
|
+
*
|
|
8168
|
+
* Trailing sentence punctuation is trimmed rather than excluded beforehand, so
|
|
8169
|
+
* `see /opt/src/a.c.` links `a.c`; a location suffix is removed before that trim
|
|
8170
|
+
* so `a.c:12` links `a.c` (not `a.c:12`).
|
|
8171
|
+
*/
|
|
8172
|
+
function findTerminalPathTokens(text) {
|
|
8173
|
+
const tokens = [];
|
|
8174
|
+
if (text === "") return tokens;
|
|
8175
|
+
PATH_RUN.lastIndex = 0;
|
|
8176
|
+
for (let match = PATH_RUN.exec(text); match !== null; match = PATH_RUN.exec(text)) {
|
|
8177
|
+
const matchStart = match.index;
|
|
8178
|
+
if (matchStart > 0 && /:\/\/[^\s]*$/.test(text.slice(0, matchStart))) continue;
|
|
8179
|
+
let raw = match[0];
|
|
8180
|
+
if (raw.includes("://")) continue;
|
|
8181
|
+
if (raw.startsWith("//")) continue;
|
|
8182
|
+
if (raw.startsWith("-")) continue;
|
|
8183
|
+
raw = stripLocationSuffix(raw);
|
|
8184
|
+
while (raw.length > 1 && TRAILING_NOISE.has(raw[raw.length - 1])) raw = raw.slice(0, -1);
|
|
8185
|
+
if (raw.length < 2) continue;
|
|
8186
|
+
if (raw === "/" || raw === "~/" || raw === "./" || raw === "../") continue;
|
|
8187
|
+
if (!raw.startsWith("/") && !raw.startsWith("~") && !/[A-Za-z_]/.test(raw)) continue;
|
|
8188
|
+
tokens.push({
|
|
8189
|
+
start: matchStart,
|
|
8190
|
+
end: matchStart + raw.length - 1,
|
|
8191
|
+
path: raw
|
|
8192
|
+
});
|
|
8193
|
+
}
|
|
8194
|
+
return tokens;
|
|
8195
|
+
}
|
|
8196
|
+
/**
|
|
8197
|
+
* Absolute candidates for one token, in the order they should be validated.
|
|
8198
|
+
*
|
|
8199
|
+
* The caller stats each in turn (bounded) and acts on the first hit, which is
|
|
8200
|
+
* why the order matters: the shell's reported cwd beats a workspace-root guess,
|
|
8201
|
+
* and the home directory is the last resort (most relative paths a shell prints
|
|
8202
|
+
* are relative to where the user is).
|
|
8203
|
+
*/
|
|
8204
|
+
function resolutionCandidates(token, ctx = {}) {
|
|
8205
|
+
const out = [];
|
|
8206
|
+
const push = (candidate) => {
|
|
8207
|
+
if (candidate === void 0 || candidate === "") return;
|
|
8208
|
+
const normalized = normalizeRemotePath(candidate);
|
|
8209
|
+
if (!normalized.startsWith("/")) return;
|
|
8210
|
+
if (!out.includes(normalized)) out.push(normalized);
|
|
8211
|
+
};
|
|
8212
|
+
if (token.startsWith("/")) {
|
|
8213
|
+
push(token);
|
|
8214
|
+
return out;
|
|
8215
|
+
}
|
|
8216
|
+
if (token.startsWith("~/")) {
|
|
8217
|
+
if (ctx.home !== void 0 && ctx.home !== "") push(joinRemotePath(ctx.home, token.slice(2)));
|
|
8218
|
+
return out;
|
|
8219
|
+
}
|
|
8220
|
+
if (ctx.cwd !== void 0 && ctx.cwd !== "") push(joinRemotePath(ctx.cwd, token));
|
|
8221
|
+
for (const root of ctx.roots ?? []) push(joinRemotePath(root, token));
|
|
8222
|
+
if (ctx.home !== void 0 && ctx.home !== "") push(joinRemotePath(ctx.home, token));
|
|
8223
|
+
return out;
|
|
8224
|
+
}
|
|
8225
|
+
//#endregion
|
|
7924
8226
|
//#region src/client/store.tsx
|
|
7925
8227
|
/**
|
|
7926
8228
|
* Shared explorer state.
|
|
@@ -8196,7 +8498,7 @@ window.__ModuleLoader__.load({
|
|
|
8196
8498
|
}
|
|
8197
8499
|
return derivedViews;
|
|
8198
8500
|
}
|
|
8199
|
-
const listeners$
|
|
8501
|
+
const listeners$4 = /* @__PURE__ */ new Set();
|
|
8200
8502
|
let snapshot = build();
|
|
8201
8503
|
function build() {
|
|
8202
8504
|
const workspace = state.workspaces.find((item) => item.id === state.workspaceId) ?? state.workspaces[0];
|
|
@@ -8256,6 +8558,8 @@ window.__ModuleLoader__.load({
|
|
|
8256
8558
|
openDiffInFloatEditor,
|
|
8257
8559
|
openFloatingEditor,
|
|
8258
8560
|
dockFloatingEditor,
|
|
8561
|
+
openEditorInCenter,
|
|
8562
|
+
dockEditorSidebar,
|
|
8259
8563
|
openDiff,
|
|
8260
8564
|
openCommitFile,
|
|
8261
8565
|
activateTab,
|
|
@@ -8276,7 +8580,7 @@ window.__ModuleLoader__.load({
|
|
|
8276
8580
|
function publish$1() {
|
|
8277
8581
|
snapshot = build();
|
|
8278
8582
|
persistTabsIfChanged();
|
|
8279
|
-
for (const listener of listeners$
|
|
8583
|
+
for (const listener of listeners$4) listener();
|
|
8280
8584
|
}
|
|
8281
8585
|
function patch$1(next) {
|
|
8282
8586
|
Object.assign(state, next);
|
|
@@ -8285,9 +8589,9 @@ window.__ModuleLoader__.load({
|
|
|
8285
8589
|
/** Subscribe to the explorer store. */
|
|
8286
8590
|
function useExplorer() {
|
|
8287
8591
|
return (0, react.useSyncExternalStore)((listener) => {
|
|
8288
|
-
listeners$
|
|
8592
|
+
listeners$4.add(listener);
|
|
8289
8593
|
return () => {
|
|
8290
|
-
listeners$
|
|
8594
|
+
listeners$4.delete(listener);
|
|
8291
8595
|
};
|
|
8292
8596
|
}, () => snapshot);
|
|
8293
8597
|
}
|
|
@@ -8586,6 +8890,58 @@ window.__ModuleLoader__.load({
|
|
|
8586
8890
|
} });
|
|
8587
8891
|
setView("explorer");
|
|
8588
8892
|
}
|
|
8893
|
+
/**
|
|
8894
|
+
* Jump from a path printed in the TERMINAL to that folder in the directory tree
|
|
8895
|
+
* (Ctrl+Click in the terminal; the wiring lives in `XTerm`/`TerminalView`).
|
|
8896
|
+
*
|
|
8897
|
+
* The token is only text, so the absolute path is decided by a short candidate
|
|
8898
|
+
* chain (`vsc/terminal-links.ts`) and then CONFIRMED against the host: the first
|
|
8899
|
+
* candidate that exists wins, and its directory (the path itself for a folder,
|
|
8900
|
+
* its parent for a file) is revealed in the tree. A hit outside every binding on
|
|
8901
|
+
* that host is reported instead of silently jumping somewhere unrelated — the
|
|
8902
|
+
* tree can only show what a binding covers.
|
|
8903
|
+
*
|
|
8904
|
+
* @param alias - host the terminal TAB is connected to (not the panel's host
|
|
8905
|
+
* picker: a tab can outlive a picker change).
|
|
8906
|
+
* @param token - the path as printed in the terminal.
|
|
8907
|
+
* @param hints - shell cwd (OSC 7) and remote home, for relative/`~` tokens.
|
|
8908
|
+
*/
|
|
8909
|
+
async function jumpToTerminalPath(alias, token, hints = {}) {
|
|
8910
|
+
if (alias === "" || token === "") return "missing";
|
|
8911
|
+
const bindings = state.workspaces.filter((item) => item.alias === alias);
|
|
8912
|
+
const roots = bindings.map((item) => item.remotePath).sort((left, right) => right.length - left.length);
|
|
8913
|
+
const candidates = resolutionCandidates(token, {
|
|
8914
|
+
...hints.home === void 0 ? {} : { home: hints.home },
|
|
8915
|
+
...hints.cwd === void 0 ? {} : { cwd: hints.cwd },
|
|
8916
|
+
roots
|
|
8917
|
+
});
|
|
8918
|
+
if (candidates.length === 0) {
|
|
8919
|
+
toast(t$1("term.pathOutside"), true);
|
|
8920
|
+
return "outside";
|
|
8921
|
+
}
|
|
8922
|
+
for (const candidate of candidates) {
|
|
8923
|
+
let entry;
|
|
8924
|
+
try {
|
|
8925
|
+
entry = await withDeadline$3(api.fileOp.stat(alias, candidate), clientDeadlineFor(fileReadTimeoutMs()), t$1("editor.readTimeout"));
|
|
8926
|
+
} catch {
|
|
8927
|
+
continue;
|
|
8928
|
+
}
|
|
8929
|
+
const dir = entry.isDir ? normalizeRemotePath(candidate) : parentDirectoryOf(candidate);
|
|
8930
|
+
const binding = bindings.find((item) => isWithinRoot(dir, item.remotePath));
|
|
8931
|
+
if (binding === void 0) {
|
|
8932
|
+
toast(t$1("term.pathOutside"), true);
|
|
8933
|
+
return "outside";
|
|
8934
|
+
}
|
|
8935
|
+
if (state.workspaceId !== binding.id && !selectWorkspaceAuto(binding.id)) {
|
|
8936
|
+
toast(t$1("term.pathBlocked"), true);
|
|
8937
|
+
return "blocked";
|
|
8938
|
+
}
|
|
8939
|
+
revealInExplorer(dir);
|
|
8940
|
+
return "revealed";
|
|
8941
|
+
}
|
|
8942
|
+
toast(t$1("term.pathMissing"), true);
|
|
8943
|
+
return "missing";
|
|
8944
|
+
}
|
|
8589
8945
|
/** Monotonic ticket for "open a terminal here" requests. */
|
|
8590
8946
|
let terminalSeq = 0;
|
|
8591
8947
|
/**
|
|
@@ -9228,14 +9584,25 @@ window.__ModuleLoader__.load({
|
|
|
9228
9584
|
*/
|
|
9229
9585
|
let revealRetry;
|
|
9230
9586
|
/**
|
|
9231
|
-
* Bring the editor into view.
|
|
9232
|
-
*
|
|
9233
|
-
*
|
|
9234
|
-
*
|
|
9235
|
-
*
|
|
9587
|
+
* Bring the editor into view.
|
|
9588
|
+
*
|
|
9589
|
+
* The docked surface (the default) is a FULL-COLUMN rail page, so opening a file
|
|
9590
|
+
* switches the column to the editor (the tree stays one click away on the rail)
|
|
9591
|
+
* — without this the click looks like a no-op. Closing its last file switches
|
|
9592
|
+
* back to the directory (see `closeTab`).
|
|
9593
|
+
*
|
|
9594
|
+
* On the 'center' surface the shell renders only the selected conversation
|
|
9595
|
+
* view, so a file opened from the sidebar must also select that tab. When the
|
|
9596
|
+
* tab cannot be found (another host build, or the shell's markup changed) the
|
|
9597
|
+
* user is told where the file opened instead of being left guessing.
|
|
9236
9598
|
*/
|
|
9237
9599
|
function revealEditor() {
|
|
9238
|
-
|
|
9600
|
+
const surface = effectiveEditorSurface(state.editorSurface, state.floatOpen);
|
|
9601
|
+
if (surface === "float") return;
|
|
9602
|
+
if (surface === "sidebar") {
|
|
9603
|
+
if (state.view !== "editor") setView("editor");
|
|
9604
|
+
return;
|
|
9605
|
+
}
|
|
9239
9606
|
const label = t$1("view.editor");
|
|
9240
9607
|
if (revealRetry !== void 0) {
|
|
9241
9608
|
clearTimeout(revealRetry);
|
|
@@ -9457,13 +9824,18 @@ window.__ModuleLoader__.load({
|
|
|
9457
9824
|
* Whether the plugin's own rich editor is the place a remote file click should
|
|
9458
9825
|
* land (the click interceptor's gate, see `remote-file-open.ts`).
|
|
9459
9826
|
*
|
|
9460
|
-
*
|
|
9461
|
-
*
|
|
9462
|
-
* the
|
|
9463
|
-
*
|
|
9827
|
+
* True while at least one SEAT exists that can render our editor in this page
|
|
9828
|
+
* (see `editor-capability.ts`): the docked sidebar pane is the default seat and
|
|
9829
|
+
* the conversation-view tab is the optional second one. "Registered" rather than
|
|
9830
|
+
* "currently mounted" on purpose — the panels are lazy/keep-alive, so a fresh
|
|
9831
|
+
* page has no mounted pane until the rail visits it, and asking for a mount
|
|
9832
|
+
* would send the first click to the host's native preview, which cannot resolve
|
|
9833
|
+
* a remote path at all. A host where no seat registers falls back to that native
|
|
9834
|
+
* preview, which is the only thing it can do. Unknown bindings are still
|
|
9835
|
+
* answered by `openRemoteFileInBinding` returning false.
|
|
9464
9836
|
*/
|
|
9465
9837
|
function isEditorTakeoverActive() {
|
|
9466
|
-
return
|
|
9838
|
+
return editorSeatCount() > 0;
|
|
9467
9839
|
}
|
|
9468
9840
|
/** Open (or focus) a working-tree diff of one repository path. */
|
|
9469
9841
|
function openDiff(rel, staged, untracked = false) {
|
|
@@ -9599,6 +9971,10 @@ window.__ModuleLoader__.load({
|
|
|
9599
9971
|
tabs: next,
|
|
9600
9972
|
activeTabId: state.activeTabId === id ? next[Math.min(index, next.length - 1)]?.id ?? next[next.length - 1]?.id : state.activeTabId
|
|
9601
9973
|
});
|
|
9974
|
+
if (next.length === 0) {
|
|
9975
|
+
if (state.editorSurface === "center") setEditorSurface("sidebar");
|
|
9976
|
+
if (state.view === "editor") setView("explorer");
|
|
9977
|
+
}
|
|
9602
9978
|
}
|
|
9603
9979
|
function updateTab(id, next) {
|
|
9604
9980
|
patchTab(id, next);
|
|
@@ -9891,6 +10267,39 @@ window.__ModuleLoader__.load({
|
|
|
9891
10267
|
patch$1({ editorSurface: surface });
|
|
9892
10268
|
}
|
|
9893
10269
|
/**
|
|
10270
|
+
* Move the editor into the conversation-view tab (full width).
|
|
10271
|
+
*
|
|
10272
|
+
* The live buffer is captured BEFORE the surface flips: the flip unmounts the
|
|
10273
|
+
* mount that owns it (see `captureLiveBuffer`'s header), and without that
|
|
10274
|
+
* handoff the edits typed since the load would disappear. The host tab is then
|
|
10275
|
+
* selected so the user actually sees where the editor went.
|
|
10276
|
+
*/
|
|
10277
|
+
function openEditorInCenter() {
|
|
10278
|
+
if (state.editorSurface === "center") {
|
|
10279
|
+
revealEditor();
|
|
10280
|
+
return;
|
|
10281
|
+
}
|
|
10282
|
+
captureLiveBuffer();
|
|
10283
|
+
patch$1({ editorSurface: "center" });
|
|
10284
|
+
revealEditor();
|
|
10285
|
+
}
|
|
10286
|
+
/**
|
|
10287
|
+
* Dock the editor back into the sidebar (the reverse of `openEditorInCenter`).
|
|
10288
|
+
*
|
|
10289
|
+
* The docked pane is the default seat and owns the whole sidebar column, so
|
|
10290
|
+
* `revealEditor` switches the rail to the editor page (from whatever view was
|
|
10291
|
+
* showing) and the tree stays one click away.
|
|
10292
|
+
*/
|
|
10293
|
+
function dockEditorSidebar() {
|
|
10294
|
+
if (state.editorSurface === "sidebar") {
|
|
10295
|
+
revealEditor();
|
|
10296
|
+
return;
|
|
10297
|
+
}
|
|
10298
|
+
captureLiveBuffer();
|
|
10299
|
+
patch$1({ editorSurface: "sidebar" });
|
|
10300
|
+
revealEditor();
|
|
10301
|
+
}
|
|
10302
|
+
/**
|
|
9894
10303
|
* Record that the host's frame-wide overlay slot actually rendered the
|
|
9895
10304
|
* floating window host (see `FloatingEditorWindow`).
|
|
9896
10305
|
*
|
|
@@ -19963,7 +20372,7 @@ window.__ModuleLoader__.load({
|
|
|
19963
20372
|
"&light": "." + baseLightID,
|
|
19964
20373
|
"&dark": "." + baseDarkID
|
|
19965
20374
|
};
|
|
19966
|
-
function buildTheme
|
|
20375
|
+
function buildTheme(main, spec, scopes) {
|
|
19967
20376
|
return new StyleModule(spec, { finish(sel) {
|
|
19968
20377
|
return /&/.test(sel) ? sel.replace(/&\w*/, (m) => {
|
|
19969
20378
|
if (m == "&") return main;
|
|
@@ -19972,7 +20381,7 @@ window.__ModuleLoader__.load({
|
|
|
19972
20381
|
}) : main + " " + sel;
|
|
19973
20382
|
} });
|
|
19974
20383
|
}
|
|
19975
|
-
const baseTheme$1$1 = /*@__PURE__*/ buildTheme
|
|
20384
|
+
const baseTheme$1$1 = /*@__PURE__*/ buildTheme("." + baseThemeID, {
|
|
19976
20385
|
"&": {
|
|
19977
20386
|
position: "relative !important",
|
|
19978
20387
|
boxSizing: "border-box",
|
|
@@ -21613,7 +22022,7 @@ window.__ModuleLoader__.load({
|
|
|
21613
22022
|
*/
|
|
21614
22023
|
static theme(spec, options) {
|
|
21615
22024
|
let prefix = StyleModule.newName();
|
|
21616
|
-
let result = [theme.of(prefix), styleModule.of(buildTheme
|
|
22025
|
+
let result = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];
|
|
21617
22026
|
if (options && options.dark) result.push(darkTheme.of(true));
|
|
21618
22027
|
return result;
|
|
21619
22028
|
}
|
|
@@ -21625,7 +22034,7 @@ window.__ModuleLoader__.load({
|
|
|
21625
22034
|
target editors with a dark or light theme.
|
|
21626
22035
|
*/
|
|
21627
22036
|
static baseTheme(spec) {
|
|
21628
|
-
return Prec.lowest(styleModule.of(buildTheme
|
|
22037
|
+
return Prec.lowest(styleModule.of(buildTheme("." + baseThemeID, spec, lightDarkIDs)));
|
|
21629
22038
|
}
|
|
21630
22039
|
/**
|
|
21631
22040
|
Retrieve an editor view instance from the view's DOM
|
|
@@ -43339,6 +43748,18 @@ window.__ModuleLoader__.load({
|
|
|
43339
43748
|
});
|
|
43340
43749
|
}
|
|
43341
43750
|
//#endregion
|
|
43751
|
+
//#region src/client/vsc/editor-caret.ts
|
|
43752
|
+
/** The caret reading of one editor state. */
|
|
43753
|
+
function caretOf(state) {
|
|
43754
|
+
const main = state.selection.main;
|
|
43755
|
+
const line = state.doc.lineAt(main.head);
|
|
43756
|
+
return {
|
|
43757
|
+
line: line.number,
|
|
43758
|
+
column: main.head - line.from + 1,
|
|
43759
|
+
selected: Math.max(0, main.to - main.from)
|
|
43760
|
+
};
|
|
43761
|
+
}
|
|
43762
|
+
//#endregion
|
|
43342
43763
|
//#region src/client/vsc/editor-langs.ts
|
|
43343
43764
|
/**
|
|
43344
43765
|
* File extension → CodeMirror grammar.
|
|
@@ -43430,6 +43851,24 @@ window.__ModuleLoader__.load({
|
|
|
43430
43851
|
default: return [];
|
|
43431
43852
|
}
|
|
43432
43853
|
}
|
|
43854
|
+
/**
|
|
43855
|
+
* Guess the indentation style from the file body (status-bar hint only).
|
|
43856
|
+
*
|
|
43857
|
+
* Only the first stretch of lines that really starts with whitespace is
|
|
43858
|
+
* inspected: the goal is a quick hint, not a formatter. `undefined` means "no
|
|
43859
|
+
* indented line in the head", and the status bar then omits the item instead of
|
|
43860
|
+
* inventing a default.
|
|
43861
|
+
*/
|
|
43862
|
+
function detectIndentLabel(text) {
|
|
43863
|
+
const lines = text.split("\n", 200);
|
|
43864
|
+
for (const line of lines) {
|
|
43865
|
+
if (line.trim() === "") continue;
|
|
43866
|
+
if (line.startsWith(" ")) return "Tab";
|
|
43867
|
+
const spaces = /^ +/.exec(line);
|
|
43868
|
+
if (spaces === null) continue;
|
|
43869
|
+
return `Spaces: ${Math.min(8, spaces[0].length)}`;
|
|
43870
|
+
}
|
|
43871
|
+
}
|
|
43433
43872
|
//#endregion
|
|
43434
43873
|
//#region src/client/vsc/tokenize.ts
|
|
43435
43874
|
const C_KEYWORDS = `alignas alignof asm auto break case catch class concept const consteval constexpr constinit const_cast continue co_await co_return co_yield
|
|
@@ -45179,6 +45618,16 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
45179
45618
|
*/
|
|
45180
45619
|
const readOnlyCompartment = new Compartment();
|
|
45181
45620
|
/**
|
|
45621
|
+
* Compartment holding the word-wrap flag.
|
|
45622
|
+
*
|
|
45623
|
+
* Same reasoning as the read-only one: the preference is changed from the
|
|
45624
|
+
* editor's own toolbar / status bar while the buffer is mounted, and remounting
|
|
45625
|
+
* to flip it would throw away the undo history and the caret. `undefined` (a
|
|
45626
|
+
* caller that never passed the prop, e.g. a diff pane) keeps the historical
|
|
45627
|
+
* behaviour of wrapping.
|
|
45628
|
+
*/
|
|
45629
|
+
const wrapCompartment = new Compartment();
|
|
45630
|
+
/**
|
|
45182
45631
|
* Compartment holding the session-change marks.
|
|
45183
45632
|
*
|
|
45184
45633
|
* 初始为空:只有调用方真的传了 `changeSet` 才把整套扩展(行背景 + gutter)装进
|
|
@@ -45463,6 +45912,17 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
45463
45912
|
if (view === void 0) return;
|
|
45464
45913
|
view.dispatch({ effects: readOnlyCompartment.reconfigure(EditorState.readOnly.of(props.readOnly === true)) });
|
|
45465
45914
|
}, [props.readOnly]);
|
|
45915
|
+
/**
|
|
45916
|
+
* Word wrap follows the shared editor preference, live.
|
|
45917
|
+
*
|
|
45918
|
+
* A reconfigure (not a remount) so flipping the toolbar / status-bar toggle
|
|
45919
|
+
* keeps the undo history and the caret exactly where they were.
|
|
45920
|
+
*/
|
|
45921
|
+
(0, react.useEffect)(() => {
|
|
45922
|
+
const view = viewRef.current;
|
|
45923
|
+
if (view === void 0) return;
|
|
45924
|
+
view.dispatch({ effects: wrapCompartment.reconfigure(props.wrap === false ? [] : EditorView.lineWrapping) });
|
|
45925
|
+
}, [props.wrap]);
|
|
45466
45926
|
(0, react.useEffect)(() => {
|
|
45467
45927
|
if (props.visible === false) return;
|
|
45468
45928
|
viewRef.current?.requestMeasure();
|
|
@@ -45545,7 +46005,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
45545
46005
|
fallbackCompartment.of([]),
|
|
45546
46006
|
revealLineField,
|
|
45547
46007
|
changeMarksCompartment.of([]),
|
|
45548
|
-
EditorView.lineWrapping,
|
|
46008
|
+
wrapCompartment.of(propsRef.current.wrap === false ? [] : EditorView.lineWrapping),
|
|
45549
46009
|
readOnlyCompartment.of(EditorState.readOnly.of(propsRef.current.readOnly === true)),
|
|
45550
46010
|
...langFor(propsRef.current.path),
|
|
45551
46011
|
EditorView.updateListener.of((update) => {
|
|
@@ -45603,6 +46063,8 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
45603
46063
|
EditorView.updateListener.of((update) => {
|
|
45604
46064
|
if (!update.selectionSet) return;
|
|
45605
46065
|
if (findOpenRef.current) setFindTick((tick) => tick + 1);
|
|
46066
|
+
const caretHandler = propsRef.current.onCaretChange;
|
|
46067
|
+
if (caretHandler !== void 0) caretHandler(caretOf(update.state));
|
|
45606
46068
|
const handler = propsRef.current.onViewState;
|
|
45607
46069
|
const tabId = propsRef.current.tabId;
|
|
45608
46070
|
if (handler === void 0 || tabId === void 0) return;
|
|
@@ -45637,6 +46099,8 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
45637
46099
|
}
|
|
45638
46100
|
}
|
|
45639
46101
|
setView(view);
|
|
46102
|
+
const initialCaret = propsRef.current.onCaretChange;
|
|
46103
|
+
if (initialCaret !== void 0) initialCaret(caretOf(view.state));
|
|
45640
46104
|
/**
|
|
45641
46105
|
* Come back to where this file was left.
|
|
45642
46106
|
*
|
|
@@ -45784,7 +46248,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
45784
46248
|
const primary = host.querySelectorAll("[class*=\"rvs-ck-\"]").length;
|
|
45785
46249
|
const fallback = host.querySelectorAll("span[class^=\"rvs-t-\"]").length;
|
|
45786
46250
|
const count = primary > 0 ? primary : fallback;
|
|
45787
|
-
console.info(`[dsh-remote-vs] build
|
|
46251
|
+
console.info(`[dsh-remote-vs] build 1123-1627 · ${source} · colored tokens: ${count} (${propsRef.current.path})`);
|
|
45788
46252
|
propsRef.current.onTokens?.(count);
|
|
45789
46253
|
};
|
|
45790
46254
|
const armFallback = () => {
|
|
@@ -47503,15 +47967,442 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
47503
47967
|
};
|
|
47504
47968
|
}
|
|
47505
47969
|
//#endregion
|
|
47970
|
+
//#region src/client/vsc/breadcrumb.tsx
|
|
47971
|
+
/**
|
|
47972
|
+
* Breadcrumb above the editor in the full-width (conversation view) variant.
|
|
47973
|
+
*
|
|
47974
|
+
* Every path segment is clickable and opens a VS Code-style sibling picker: a
|
|
47975
|
+
* directory segment lists itself, the file segment lists its parent directory,
|
|
47976
|
+
* so "open the file next to this one" costs one click instead of a trip to the
|
|
47977
|
+
* tree (whose expansion state lives in another view and cannot be expressed in
|
|
47978
|
+
* a URL).
|
|
47979
|
+
*
|
|
47980
|
+
* Read-only: it only calls `fileOp.list` on the remote. The remote path is the
|
|
47981
|
+
* Host's own business — no second validation layer here.
|
|
47982
|
+
*/
|
|
47983
|
+
/** Split an absolute POSIX path into segments (empty path = empty list). */
|
|
47984
|
+
function pathSegments(path) {
|
|
47985
|
+
return path.replace(/\\/g, "/").split("/").filter((part) => part !== "");
|
|
47986
|
+
}
|
|
47987
|
+
/** Root display name: the binding's name, else the last segment of the root. */
|
|
47988
|
+
function rootLabel(root, rootName, fallback) {
|
|
47989
|
+
if (rootName !== "") return rootName;
|
|
47990
|
+
const parts = pathSegments(root);
|
|
47991
|
+
return parts[parts.length - 1] ?? fallback;
|
|
47992
|
+
}
|
|
47993
|
+
/** Translate one key, falling back to the inline copy when the dictionary lacks it. */
|
|
47994
|
+
function tr$1(t, key, fallback) {
|
|
47995
|
+
const value = t(key);
|
|
47996
|
+
return value === void 0 || value === "" || value === key ? fallback : value;
|
|
47997
|
+
}
|
|
47998
|
+
/** Breadcrumb: path segments + sibling dropdown. */
|
|
47999
|
+
function Breadcrumb(props) {
|
|
48000
|
+
const navRef = (0, react.useRef)(null);
|
|
48001
|
+
const [menu, setMenu] = (0, react.useState)(void 0);
|
|
48002
|
+
const [entries, setEntries] = (0, react.useState)([]);
|
|
48003
|
+
const [loading, setLoading] = (0, react.useState)(false);
|
|
48004
|
+
const [error, setError] = (0, react.useState)(void 0);
|
|
48005
|
+
/** Load token: two quick segment clicks must only let the last answer land. */
|
|
48006
|
+
const loadSeq = (0, react.useRef)(0);
|
|
48007
|
+
const t = props.t;
|
|
48008
|
+
const root = props.root.replace(/\/+$/, "");
|
|
48009
|
+
/**
|
|
48010
|
+
* A path OUTSIDE the workspace root (a repo sitting next to the binding, a
|
|
48011
|
+
* diff path that left the tree) cannot be split into root-relative crumbs:
|
|
48012
|
+
* doing it anyway would build `/root/home/...` and the sibling picker would
|
|
48013
|
+
* list the wrong directory. Fall back to the plain path line.
|
|
48014
|
+
*/
|
|
48015
|
+
const underRoot = root !== "" && (props.path === root || props.path.startsWith(`${root}/`));
|
|
48016
|
+
const segments = (0, react.useMemo)(() => {
|
|
48017
|
+
const full = props.path.replace(/\/+$/, "");
|
|
48018
|
+
if (root !== "" && full.startsWith(`${root}/`)) return pathSegments(full.slice(root.length + 1));
|
|
48019
|
+
return pathSegments(full);
|
|
48020
|
+
}, [props.path, root]);
|
|
48021
|
+
const crumbs = (0, react.useMemo)(() => {
|
|
48022
|
+
const list = [{
|
|
48023
|
+
label: rootLabel(root, props.rootName, tr$1(t, "editor.crumbRoot", "工作区")),
|
|
48024
|
+
path: root
|
|
48025
|
+
}];
|
|
48026
|
+
for (const [index, segment] of segments.entries()) list.push({
|
|
48027
|
+
label: segment,
|
|
48028
|
+
path: `${root}/${segments.slice(0, index + 1).join("/")}`
|
|
48029
|
+
});
|
|
48030
|
+
return list;
|
|
48031
|
+
}, [
|
|
48032
|
+
root,
|
|
48033
|
+
props.rootName,
|
|
48034
|
+
segments,
|
|
48035
|
+
t
|
|
48036
|
+
]);
|
|
48037
|
+
/** List one directory and show the menu; `left` keeps the current position. */
|
|
48038
|
+
const openMenu = (dir, left) => {
|
|
48039
|
+
setMenu({
|
|
48040
|
+
dir,
|
|
48041
|
+
left
|
|
48042
|
+
});
|
|
48043
|
+
setLoading(true);
|
|
48044
|
+
setError(void 0);
|
|
48045
|
+
loadSeq.current += 1;
|
|
48046
|
+
const token = loadSeq.current;
|
|
48047
|
+
(async () => {
|
|
48048
|
+
try {
|
|
48049
|
+
const listed = await api.fileOp.list(props.alias, dir);
|
|
48050
|
+
if (loadSeq.current !== token) return;
|
|
48051
|
+
const sorted = [...listed].sort((a, b) => {
|
|
48052
|
+
const aDir = a.isDir ? 0 : 1;
|
|
48053
|
+
const bDir = b.isDir ? 0 : 1;
|
|
48054
|
+
if (aDir !== bDir) return aDir - bDir;
|
|
48055
|
+
return a.name.localeCompare(b.name);
|
|
48056
|
+
});
|
|
48057
|
+
setEntries(sorted);
|
|
48058
|
+
} catch (caught) {
|
|
48059
|
+
if (loadSeq.current !== token) return;
|
|
48060
|
+
setEntries([]);
|
|
48061
|
+
setError(caught instanceof Error ? caught.message : String(caught));
|
|
48062
|
+
} finally {
|
|
48063
|
+
if (loadSeq.current === token) setLoading(false);
|
|
48064
|
+
}
|
|
48065
|
+
})();
|
|
48066
|
+
};
|
|
48067
|
+
(0, react.useEffect)(() => {
|
|
48068
|
+
if (menu === void 0) return;
|
|
48069
|
+
const onMouseDown = (event) => {
|
|
48070
|
+
const nav = navRef.current;
|
|
48071
|
+
if (nav !== null && event.target instanceof Node && nav.contains(event.target)) return;
|
|
48072
|
+
setMenu(void 0);
|
|
48073
|
+
};
|
|
48074
|
+
const onKeyDown = (event) => {
|
|
48075
|
+
if (event.isComposing) return;
|
|
48076
|
+
if (event.key === "Escape") setMenu(void 0);
|
|
48077
|
+
};
|
|
48078
|
+
document.addEventListener("mousedown", onMouseDown, true);
|
|
48079
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
48080
|
+
return () => {
|
|
48081
|
+
document.removeEventListener("mousedown", onMouseDown, true);
|
|
48082
|
+
document.removeEventListener("keydown", onKeyDown, true);
|
|
48083
|
+
};
|
|
48084
|
+
}, [menu]);
|
|
48085
|
+
(0, react.useEffect)(() => {
|
|
48086
|
+
setMenu(void 0);
|
|
48087
|
+
}, [props.path]);
|
|
48088
|
+
if (!underRoot) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
48089
|
+
className: "rvs-breadcrumb",
|
|
48090
|
+
"aria-label": tr$1(t, "editor.crumbLabel", "文件路径"),
|
|
48091
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48092
|
+
className: "rvs-einfo-path",
|
|
48093
|
+
title: props.path,
|
|
48094
|
+
children: props.path
|
|
48095
|
+
})
|
|
48096
|
+
});
|
|
48097
|
+
/** Click a segment: a directory lists itself; the file lists its parent. */
|
|
48098
|
+
const clickCrumb = (crumb, index, event) => {
|
|
48099
|
+
const dir = index === crumbs.length - 1 ? crumb.path.slice(0, Math.max(0, crumb.path.lastIndexOf("/"))) : crumb.path;
|
|
48100
|
+
openMenu(dir === "" ? "/" : dir, Math.max(0, event.currentTarget.offsetLeft));
|
|
48101
|
+
};
|
|
48102
|
+
const parentDirOf = (dir) => {
|
|
48103
|
+
if (dir === "" || dir === root || dir === "/") return void 0;
|
|
48104
|
+
const parts = pathSegments(dir);
|
|
48105
|
+
parts.pop();
|
|
48106
|
+
return parts.length === 0 ? void 0 : `/${parts.join("/")}`;
|
|
48107
|
+
};
|
|
48108
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", {
|
|
48109
|
+
className: "rvs-breadcrumb",
|
|
48110
|
+
ref: navRef,
|
|
48111
|
+
"aria-label": tr$1(t, "editor.crumbLabel", "文件路径"),
|
|
48112
|
+
children: [crumbs.map((crumb, index) => {
|
|
48113
|
+
const isFile = index === crumbs.length - 1;
|
|
48114
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
48115
|
+
className: "rvs-crumb-wrap",
|
|
48116
|
+
children: [index > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48117
|
+
className: "rvs-crumb-sep",
|
|
48118
|
+
"aria-hidden": "true",
|
|
48119
|
+
children: "›"
|
|
48120
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
48121
|
+
type: "button",
|
|
48122
|
+
className: `rvs-crumb${isFile ? " rvs-crumb-file" : ""}`,
|
|
48123
|
+
title: isFile ? props.path : crumb.path,
|
|
48124
|
+
"aria-haspopup": "menu",
|
|
48125
|
+
onClick: (event) => clickCrumb(crumb, index, event),
|
|
48126
|
+
children: crumb.label
|
|
48127
|
+
})]
|
|
48128
|
+
}, `${crumb.path}:${index}`);
|
|
48129
|
+
}), menu !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48130
|
+
className: "rvs-crumb-menu",
|
|
48131
|
+
role: "menu",
|
|
48132
|
+
style: { left: menu.left },
|
|
48133
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48134
|
+
className: "rvs-crumb-menu-head",
|
|
48135
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
48136
|
+
type: "button",
|
|
48137
|
+
className: "rvs-crumb-menu-up",
|
|
48138
|
+
title: tr$1(t, "editor.crumbUp", "上一级"),
|
|
48139
|
+
disabled: parentDirOf(menu.dir) === void 0,
|
|
48140
|
+
onClick: () => {
|
|
48141
|
+
const parent = parentDirOf(menu.dir);
|
|
48142
|
+
if (parent === void 0) return;
|
|
48143
|
+
openMenu(parent, menu.left);
|
|
48144
|
+
},
|
|
48145
|
+
children: "↑"
|
|
48146
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48147
|
+
className: "rvs-crumb-menu-path",
|
|
48148
|
+
title: menu.dir,
|
|
48149
|
+
children: menu.dir
|
|
48150
|
+
})]
|
|
48151
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48152
|
+
className: "rvs-crumb-menu-list",
|
|
48153
|
+
children: [
|
|
48154
|
+
loading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48155
|
+
className: "rvs-crumb-menu-note",
|
|
48156
|
+
children: tr$1(t, "common.loading", "加载中…")
|
|
48157
|
+
}),
|
|
48158
|
+
!loading && error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48159
|
+
className: "rvs-crumb-menu-note rvs-status-error",
|
|
48160
|
+
children: error
|
|
48161
|
+
}),
|
|
48162
|
+
!loading && error === void 0 && entries.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48163
|
+
className: "rvs-crumb-menu-note",
|
|
48164
|
+
children: tr$1(t, "editor.crumbEmpty", "空目录")
|
|
48165
|
+
}),
|
|
48166
|
+
!loading && error === void 0 && entries.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
48167
|
+
type: "button",
|
|
48168
|
+
role: "menuitem",
|
|
48169
|
+
className: `rvs-crumb-menu-item${entry.isDir ? " rvs-dir" : ""}`,
|
|
48170
|
+
title: entry.path,
|
|
48171
|
+
onClick: () => {
|
|
48172
|
+
if (entry.isDir) {
|
|
48173
|
+
openMenu(entry.path, menu.left);
|
|
48174
|
+
return;
|
|
48175
|
+
}
|
|
48176
|
+
props.onOpen(entry.path);
|
|
48177
|
+
setMenu(void 0);
|
|
48178
|
+
},
|
|
48179
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48180
|
+
className: "rvs-crumb-menu-glyph",
|
|
48181
|
+
"aria-hidden": "true",
|
|
48182
|
+
children: entry.isDir ? "▸" : "·"
|
|
48183
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48184
|
+
className: "rvs-crumb-menu-name",
|
|
48185
|
+
children: entry.name
|
|
48186
|
+
})]
|
|
48187
|
+
}, entry.path))
|
|
48188
|
+
]
|
|
48189
|
+
})]
|
|
48190
|
+
})]
|
|
48191
|
+
});
|
|
48192
|
+
}
|
|
48193
|
+
//#endregion
|
|
48194
|
+
//#region src/client/vsc/image-preview.tsx
|
|
48195
|
+
/**
|
|
48196
|
+
* Inline image preview for the editor body.
|
|
48197
|
+
*
|
|
48198
|
+
* A remote image has no text to edit, so the editor shows the picture instead
|
|
48199
|
+
* of the "binary file" notice. Presentation only: the base64 payload comes from
|
|
48200
|
+
* the tab's read (the same SFTP read every other preview uses), and this
|
|
48201
|
+
* component owns nothing but the fit / actual-size toggle and the load-failure
|
|
48202
|
+
* state.
|
|
48203
|
+
*
|
|
48204
|
+
* Why an `<img>` with a `data:` URL and not an object URL: the payload already
|
|
48205
|
+
* arrived base64 from the file route, so there is nothing extra to fetch — and
|
|
48206
|
+
* nothing to revoke when the tab closes.
|
|
48207
|
+
*/
|
|
48208
|
+
/** Human size for the meta line. */
|
|
48209
|
+
function imageSizeText(bytes) {
|
|
48210
|
+
if (!Number.isFinite(bytes) || bytes <= 0) return "0 B";
|
|
48211
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
48212
|
+
if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;
|
|
48213
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
48214
|
+
}
|
|
48215
|
+
/** Translate one key, falling back to the inline copy when the dictionary lacks it. */
|
|
48216
|
+
function tr(t, key, fallback) {
|
|
48217
|
+
const value = t?.(key);
|
|
48218
|
+
return value === void 0 || value === "" || value === key ? fallback : value;
|
|
48219
|
+
}
|
|
48220
|
+
/**
|
|
48221
|
+
* The preview body: the image, a click-to-toggle zoom, and a meta line.
|
|
48222
|
+
*
|
|
48223
|
+
* `fit` scales the picture down to the pane (the common case: look at it);
|
|
48224
|
+
* `actual` shows it at natural size inside a scrollable pane (inspect pixels).
|
|
48225
|
+
*/
|
|
48226
|
+
function ImagePreview(props) {
|
|
48227
|
+
const [actual, setActual] = (0, react.useState)(false);
|
|
48228
|
+
const [failed, setFailed] = (0, react.useState)(false);
|
|
48229
|
+
const [natural, setNatural] = (0, react.useState)(void 0);
|
|
48230
|
+
const hint = tr(props.t, "editor.imageHint", "点击切换适应窗口 / 原始大小");
|
|
48231
|
+
const meta = [imageSizeText(props.size), natural === void 0 ? "" : `${natural.width} × ${natural.height}`].filter((part) => part !== "").join(" · ");
|
|
48232
|
+
if (props.truncated === true) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48233
|
+
className: "rvs-editor-notice",
|
|
48234
|
+
children: [
|
|
48235
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48236
|
+
className: "rvs-editor-notice-title",
|
|
48237
|
+
children: tr(props.t, "editor.imageTooLargeTitle", "图片过大")
|
|
48238
|
+
}),
|
|
48239
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: props.path }),
|
|
48240
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: tr(props.t, "editor.imageTooLargeHint", "大小 {size} KiB,超出读取上限,不提供预览。").replace("{size}", String(Math.max(1, Math.round(props.size / 1024)))) })
|
|
48241
|
+
]
|
|
48242
|
+
});
|
|
48243
|
+
if (failed) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48244
|
+
className: "rvs-image-preview rvs-image-preview-failed",
|
|
48245
|
+
children: [
|
|
48246
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48247
|
+
className: "rvs-editor-notice-title",
|
|
48248
|
+
children: tr(props.t, "editor.imageFailed", "图片读取失败。")
|
|
48249
|
+
}),
|
|
48250
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: props.path }),
|
|
48251
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: tr(props.t, "editor.imageFailedHint", "文件可能已损坏,或不是受支持的图片格式。") })
|
|
48252
|
+
]
|
|
48253
|
+
});
|
|
48254
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48255
|
+
className: `rvs-image-preview${actual ? " rvs-image-actual" : ""}`,
|
|
48256
|
+
title: `${props.path}\n${hint}`,
|
|
48257
|
+
role: "img",
|
|
48258
|
+
"aria-label": props.path,
|
|
48259
|
+
onClick: () => setActual((value) => !value),
|
|
48260
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
48261
|
+
className: "rvs-image-preview-img",
|
|
48262
|
+
src: props.src,
|
|
48263
|
+
alt: props.path,
|
|
48264
|
+
draggable: false,
|
|
48265
|
+
onDragStart: (event) => event.preventDefault(),
|
|
48266
|
+
onLoad: (event) => {
|
|
48267
|
+
setNatural({
|
|
48268
|
+
width: event.currentTarget.naturalWidth,
|
|
48269
|
+
height: event.currentTarget.naturalHeight
|
|
48270
|
+
});
|
|
48271
|
+
},
|
|
48272
|
+
onError: () => setFailed(true)
|
|
48273
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48274
|
+
className: "rvs-image-preview-meta",
|
|
48275
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: meta }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48276
|
+
className: "rvs-image-preview-hint",
|
|
48277
|
+
children: actual ? tr(props.t, "editor.imageFitHint", "点击适应窗口") : hint
|
|
48278
|
+
})]
|
|
48279
|
+
})]
|
|
48280
|
+
});
|
|
48281
|
+
}
|
|
48282
|
+
//#endregion
|
|
48283
|
+
//#region src/client/vsc/editor-settings.ts
|
|
48284
|
+
/** localStorage key: ONE JSON object, so the two fields cannot drift apart. */
|
|
48285
|
+
const EDITOR_SETTINGS_KEY = "dsh-remote-vs.editor.settings";
|
|
48286
|
+
/** Defaults used before anything was stored (matches the theme's 13px fallback). */
|
|
48287
|
+
const DEFAULT_EDITOR_SETTINGS = {
|
|
48288
|
+
wrap: false,
|
|
48289
|
+
fontSize: 13
|
|
48290
|
+
};
|
|
48291
|
+
/** Clamp any input to a legal font size; non-numbers answer undefined. */
|
|
48292
|
+
function parseFontSize(value) {
|
|
48293
|
+
const numeric = typeof value === "number" ? value : typeof value === "string" && value.trim() !== "" ? Number(value) : NaN;
|
|
48294
|
+
if (!Number.isFinite(numeric)) return void 0;
|
|
48295
|
+
const snapped = Math.round(numeric * 2) / 2;
|
|
48296
|
+
return Math.min(28, Math.max(9, snapped));
|
|
48297
|
+
}
|
|
48298
|
+
/** One zoom step (-1 = smaller, +1 = bigger), already clamped. */
|
|
48299
|
+
function stepFontSize(size, direction) {
|
|
48300
|
+
const current = parseFontSize(size) ?? DEFAULT_EDITOR_SETTINGS.fontSize;
|
|
48301
|
+
return parseFontSize(current + direction * 1) ?? current;
|
|
48302
|
+
}
|
|
48303
|
+
/**
|
|
48304
|
+
* Parse the persisted JSON.
|
|
48305
|
+
*
|
|
48306
|
+
* Anything damaged (not JSON, not an object, wrong field types) falls back to
|
|
48307
|
+
* the defaults: this data only affects presentation, and a dirty localStorage
|
|
48308
|
+
* entry must never keep the page from starting.
|
|
48309
|
+
*/
|
|
48310
|
+
function parseEditorSettings(raw) {
|
|
48311
|
+
if (typeof raw !== "string" || raw === "") return DEFAULT_EDITOR_SETTINGS;
|
|
48312
|
+
let parsed;
|
|
48313
|
+
try {
|
|
48314
|
+
parsed = JSON.parse(raw);
|
|
48315
|
+
} catch {
|
|
48316
|
+
return DEFAULT_EDITOR_SETTINGS;
|
|
48317
|
+
}
|
|
48318
|
+
if (typeof parsed !== "object" || parsed === null) return DEFAULT_EDITOR_SETTINGS;
|
|
48319
|
+
const record = parsed;
|
|
48320
|
+
const fontSize = parseFontSize(record.fontSize) ?? DEFAULT_EDITOR_SETTINGS.fontSize;
|
|
48321
|
+
return {
|
|
48322
|
+
wrap: typeof record.wrap === "boolean" ? record.wrap : DEFAULT_EDITOR_SETTINGS.wrap,
|
|
48323
|
+
fontSize
|
|
48324
|
+
};
|
|
48325
|
+
}
|
|
48326
|
+
/** Serialize only the known fields (never whatever else the caller passed). */
|
|
48327
|
+
function serializeEditorSettings(settings) {
|
|
48328
|
+
return JSON.stringify({
|
|
48329
|
+
wrap: settings.wrap,
|
|
48330
|
+
fontSize: settings.fontSize
|
|
48331
|
+
});
|
|
48332
|
+
}
|
|
48333
|
+
const listeners$3 = /* @__PURE__ */ new Set();
|
|
48334
|
+
/** Lazy current value; undefined = localStorage not read yet. */
|
|
48335
|
+
let current$1;
|
|
48336
|
+
function readFromStorage$1() {
|
|
48337
|
+
try {
|
|
48338
|
+
return parseEditorSettings(localStorage.getItem(EDITOR_SETTINGS_KEY));
|
|
48339
|
+
} catch {
|
|
48340
|
+
return DEFAULT_EDITOR_SETTINGS;
|
|
48341
|
+
}
|
|
48342
|
+
}
|
|
48343
|
+
function persist$1(settings) {
|
|
48344
|
+
try {
|
|
48345
|
+
localStorage.setItem(EDITOR_SETTINGS_KEY, serializeEditorSettings(settings));
|
|
48346
|
+
} catch {}
|
|
48347
|
+
}
|
|
48348
|
+
function emit$1() {
|
|
48349
|
+
for (const listener of [...listeners$3]) try {
|
|
48350
|
+
listener();
|
|
48351
|
+
} catch {}
|
|
48352
|
+
}
|
|
48353
|
+
/** Current snapshot (identity-stable while unchanged, safe for useSyncExternalStore). */
|
|
48354
|
+
function editorSettingsSnapshot() {
|
|
48355
|
+
if (current$1 === void 0) current$1 = readFromStorage$1();
|
|
48356
|
+
return current$1;
|
|
48357
|
+
}
|
|
48358
|
+
/** Subscribe to preference changes; returns the unsubscribe. */
|
|
48359
|
+
function subscribeEditorSettings(listener) {
|
|
48360
|
+
listeners$3.add(listener);
|
|
48361
|
+
return () => {
|
|
48362
|
+
listeners$3.delete(listener);
|
|
48363
|
+
};
|
|
48364
|
+
}
|
|
48365
|
+
/**
|
|
48366
|
+
* Change one preference and persist it.
|
|
48367
|
+
*
|
|
48368
|
+
* Illegal values (out-of-range size) are clamped BEFORE the "did it change"
|
|
48369
|
+
* comparison: without that, every click on a "+" already at the cap would
|
|
48370
|
+
* re-render all three surfaces for nothing.
|
|
48371
|
+
*/
|
|
48372
|
+
function updateEditorSettings(patch) {
|
|
48373
|
+
const before = editorSettingsSnapshot();
|
|
48374
|
+
const fontSize = patch.fontSize === void 0 ? before.fontSize : parseFontSize(patch.fontSize) ?? before.fontSize;
|
|
48375
|
+
const wrap = patch.wrap === void 0 ? before.wrap : patch.wrap;
|
|
48376
|
+
if (fontSize === before.fontSize && wrap === before.wrap) return;
|
|
48377
|
+
const next = {
|
|
48378
|
+
wrap,
|
|
48379
|
+
fontSize
|
|
48380
|
+
};
|
|
48381
|
+
current$1 = next;
|
|
48382
|
+
persist$1(next);
|
|
48383
|
+
emit$1();
|
|
48384
|
+
}
|
|
48385
|
+
//#endregion
|
|
47506
48386
|
//#region src/client/EditorPane.tsx
|
|
47507
48387
|
/**
|
|
47508
48388
|
* The editor area: one tab strip for code files, previews and diffs, an info
|
|
47509
|
-
* row, and the
|
|
47510
|
-
*
|
|
47511
|
-
* The
|
|
47512
|
-
*
|
|
47513
|
-
* every
|
|
47514
|
-
*
|
|
48389
|
+
* row, the body, and (in the full-width conversation-view variant) a status bar.
|
|
48390
|
+
*
|
|
48391
|
+
* The chrome follows the local sidebar plugin's editor (same tab strip, info
|
|
48392
|
+
* row, empty states, status bar, image preview and editor background tokens),
|
|
48393
|
+
* while every remote-only capability stays exactly where it was: the remote
|
|
48394
|
+
* read/write routes, the save-conflict banner and its on-demand difference, the
|
|
48395
|
+
* diff tabs, markdown/HTML previews, session change marks and the offline
|
|
48396
|
+
* read-only degradation.
|
|
48397
|
+
*
|
|
48398
|
+
* Three variants share this component, chosen from the store's effective
|
|
48399
|
+
* surface — never from a prop, so a surface can never mount two live buffers:
|
|
48400
|
+
* - `sidebar`: the docked pane — a FULL-COLUMN rail page and the default seat
|
|
48401
|
+
* (opening a file switches the rail to it; closing the last file switches
|
|
48402
|
+
* back to the directory);
|
|
48403
|
+
* - `center`: the conversation-view tab next to 对话 / 轨迹 (optional, full
|
|
48404
|
+
* width, breadcrumb + status bar);
|
|
48405
|
+
* - `float`: the frame-wide floating window (its own font zoom applies).
|
|
47515
48406
|
*/
|
|
47516
48407
|
/** How many hunks of a conflict diff are rendered before the rest is summarised. */
|
|
47517
48408
|
const CONFLICT_DIFF_HUNKS = 20;
|
|
@@ -47578,7 +48469,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
47578
48469
|
}
|
|
47579
48470
|
/** Tab icon: diffs, images and text files each get their own glyph. */
|
|
47580
48471
|
function tabIcon(tab) {
|
|
47581
|
-
if (tab.kind === "diff") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconDiff, { size:
|
|
48472
|
+
if (tab.kind === "diff") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconDiff, { size: 11 });
|
|
47582
48473
|
if (tab.image) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "▣" });
|
|
47583
48474
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "▪" });
|
|
47584
48475
|
}
|
|
@@ -47629,9 +48520,126 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
47629
48520
|
for (const key of dropped) delete next[key];
|
|
47630
48521
|
return next;
|
|
47631
48522
|
}
|
|
48523
|
+
/**
|
|
48524
|
+
* Cache key of one image PREVIEW: the path PLUS the tab's reload nonce.
|
|
48525
|
+
*
|
|
48526
|
+
* The base64 payload is a snapshot of one read. Keying by path alone kept
|
|
48527
|
+
* painting the old bytes after a reload (and after a reconnect's background
|
|
48528
|
+
* re-read of an inactive tab, which has no cache-clearing effect running); the
|
|
48529
|
+
* nonce changes with every successful re-read, so a stale entry is simply never
|
|
48530
|
+
* looked up again and ages out of the bounded cache.
|
|
48531
|
+
*/
|
|
48532
|
+
function imageCacheKey(tab) {
|
|
48533
|
+
return `${tab.fullPath}@${tab.reloadNonce ?? 0}`;
|
|
48534
|
+
}
|
|
48535
|
+
/** React binding for the shared editor view preferences. */
|
|
48536
|
+
function useEditorSettings() {
|
|
48537
|
+
return (0, react.useSyncExternalStore)(subscribeEditorSettings, editorSettingsSnapshot, editorSettingsSnapshot);
|
|
48538
|
+
}
|
|
48539
|
+
/** One status-bar entry. */
|
|
48540
|
+
function StatusItem(props) {
|
|
48541
|
+
const className = `rvs-status-item${props.error === true ? " rvs-status-error" : ""}`;
|
|
48542
|
+
if (props.onClick === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48543
|
+
className,
|
|
48544
|
+
title: props.title,
|
|
48545
|
+
children: props.children
|
|
48546
|
+
});
|
|
48547
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
48548
|
+
type: "button",
|
|
48549
|
+
className: `${className} rvs-status-btn`,
|
|
48550
|
+
title: props.title,
|
|
48551
|
+
onClick: props.onClick,
|
|
48552
|
+
children: props.children
|
|
48553
|
+
});
|
|
48554
|
+
}
|
|
48555
|
+
/**
|
|
48556
|
+
* Bottom status bar (full-width variant only, like the sidebar plugin).
|
|
48557
|
+
*
|
|
48558
|
+
* Left is "where am I" (language, line:column, selection size, indent); right is
|
|
48559
|
+
* "how is it shown" (wrap, font size, save state) plus the file encoding. Wrap
|
|
48560
|
+
* and font size are CLICKABLE on purpose: those are the two display switches a
|
|
48561
|
+
* reader changes often, and making them hunt through a menu would be worse.
|
|
48562
|
+
*/
|
|
48563
|
+
function StatusBar(props) {
|
|
48564
|
+
const caret = props.caret;
|
|
48565
|
+
const t = props.t;
|
|
48566
|
+
const saveLabel = props.loading ? t("common.loading") : props.saving ? t("editor.statusSaving") : props.dirty ? t("editor.unsaved") : t("editor.statusClean");
|
|
48567
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48568
|
+
className: "rvs-statusbar",
|
|
48569
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48570
|
+
className: "rvs-status-left",
|
|
48571
|
+
children: props.diff ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48572
|
+
title: t("editor.diffTitle"),
|
|
48573
|
+
children: t("editor.diffTitle")
|
|
48574
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48575
|
+
title: t("editor.diffReadOnlyTitle"),
|
|
48576
|
+
children: t("editor.statusReadOnly")
|
|
48577
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
48578
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48579
|
+
title: t("editor.statusLanguage"),
|
|
48580
|
+
children: props.language
|
|
48581
|
+
}),
|
|
48582
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48583
|
+
title: t("editor.statusPosition"),
|
|
48584
|
+
children: t("editor.statusPositionValue").replace("{line}", String(caret?.line ?? 1)).replace("{column}", String(caret?.column ?? 1))
|
|
48585
|
+
}),
|
|
48586
|
+
caret !== void 0 && caret.selected > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48587
|
+
title: t("editor.statusSelected"),
|
|
48588
|
+
children: t("editor.statusSelectedValue").replace("{count}", String(caret.selected))
|
|
48589
|
+
}),
|
|
48590
|
+
props.indent !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48591
|
+
title: t("editor.statusIndent"),
|
|
48592
|
+
children: props.indent
|
|
48593
|
+
})
|
|
48594
|
+
] })
|
|
48595
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48596
|
+
className: "rvs-status-right",
|
|
48597
|
+
children: [
|
|
48598
|
+
props.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48599
|
+
title: props.error,
|
|
48600
|
+
error: true,
|
|
48601
|
+
children: t("editor.statusError")
|
|
48602
|
+
}),
|
|
48603
|
+
props.diff ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
48604
|
+
props.readOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48605
|
+
title: t("editor.statusReadOnlyTitle"),
|
|
48606
|
+
children: t("editor.statusReadOnly")
|
|
48607
|
+
}),
|
|
48608
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48609
|
+
title: t("editor.statusWrapToggle"),
|
|
48610
|
+
onClick: () => updateEditorSettings({ wrap: !props.wrap }),
|
|
48611
|
+
children: props.wrap ? t("editor.statusWrapOn") : t("editor.statusWrapOff")
|
|
48612
|
+
}),
|
|
48613
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48614
|
+
title: t("editor.statusFont"),
|
|
48615
|
+
children: `${props.fontSize}px`
|
|
48616
|
+
}),
|
|
48617
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48618
|
+
title: t("editor.statusSaved"),
|
|
48619
|
+
children: saveLabel
|
|
48620
|
+
})
|
|
48621
|
+
] }),
|
|
48622
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusItem, {
|
|
48623
|
+
title: t("editor.statusEncoding"),
|
|
48624
|
+
children: "UTF-8"
|
|
48625
|
+
})
|
|
48626
|
+
]
|
|
48627
|
+
})]
|
|
48628
|
+
});
|
|
48629
|
+
}
|
|
47632
48630
|
function EditorPane(props) {
|
|
47633
48631
|
const store = useExplorer();
|
|
47634
48632
|
const { t, tabs, activeTab, alias } = store;
|
|
48633
|
+
const settings = useEditorSettings();
|
|
48634
|
+
/**
|
|
48635
|
+
* Which chrome this mount renders. Derived from the store's EFFECTIVE surface
|
|
48636
|
+
* (float wins over the base mount), never from a prop: the same component is
|
|
48637
|
+
* mounted by the sidebar, the conversation view and the floating window, and
|
|
48638
|
+
* exactly one of them may own the live buffer.
|
|
48639
|
+
*/
|
|
48640
|
+
const variant = store.editorSurface === "center" ? "center" : store.editorSurface === "float" ? "float" : "sidebar";
|
|
48641
|
+
const center = variant === "center";
|
|
48642
|
+
const fontStyle = variant === "float" ? void 0 : { "--rvs-editor-font-size": `${settings.fontSize}px` };
|
|
47635
48643
|
const changeHunks = activeTab?.changeSet?.hunks ?? [];
|
|
47636
48644
|
const chat = useRemoteChatTarget(store.ctx);
|
|
47637
48645
|
const viewedAliasPath = store.workspace !== void 0 ? store.aliasPaths[store.workspace.id] : void 0;
|
|
@@ -47649,6 +48657,11 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
47649
48657
|
(0, react.useEffect)(() => {
|
|
47650
48658
|
setTokenCount(void 0);
|
|
47651
48659
|
}, [activeTab?.id]);
|
|
48660
|
+
/** Caret readout for the status bar; reset when the file changes. */
|
|
48661
|
+
const [caret, setCaret] = (0, react.useState)(void 0);
|
|
48662
|
+
(0, react.useEffect)(() => {
|
|
48663
|
+
setCaret(void 0);
|
|
48664
|
+
}, [activeTab?.id]);
|
|
47652
48665
|
/**
|
|
47653
48666
|
* The "see the difference" payload of a refused save.
|
|
47654
48667
|
*
|
|
@@ -47661,19 +48674,21 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
47661
48674
|
const tab = activeTab;
|
|
47662
48675
|
if (props.visible === false) return;
|
|
47663
48676
|
if (tab === void 0 || !tab.image || alias === "") return;
|
|
47664
|
-
if (
|
|
48677
|
+
if (tab.truncated) return;
|
|
48678
|
+
const key = imageCacheKey(tab);
|
|
48679
|
+
if (images[key] !== void 0 || imageError[key] !== void 0) return;
|
|
47665
48680
|
let cancelled = false;
|
|
47666
48681
|
(async () => {
|
|
47667
48682
|
try {
|
|
47668
48683
|
const read = await api.fileOp.read(alias, tab.fullPath);
|
|
47669
48684
|
if (cancelled) return;
|
|
47670
48685
|
if (read.base64 === void 0) {
|
|
47671
|
-
setImageError((prev) => rememberRecent(prev,
|
|
48686
|
+
setImageError((prev) => rememberRecent(prev, key, t("editor.imageFailed")));
|
|
47672
48687
|
return;
|
|
47673
48688
|
}
|
|
47674
|
-
setImages((prev) => rememberRecent(prev,
|
|
48689
|
+
setImages((prev) => rememberRecent(prev, key, `data:${mimeFor(tab.fullPath)};base64,${read.base64}`));
|
|
47675
48690
|
} catch (error) {
|
|
47676
|
-
if (!cancelled) setImageError((prev) => rememberRecent(prev,
|
|
48691
|
+
if (!cancelled) setImageError((prev) => rememberRecent(prev, key, error instanceof Error ? error.message : String(error)));
|
|
47677
48692
|
}
|
|
47678
48693
|
})();
|
|
47679
48694
|
return () => {
|
|
@@ -47693,8 +48708,8 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
47693
48708
|
* instead of parking them until the page is reloaded.
|
|
47694
48709
|
*/
|
|
47695
48710
|
(0, react.useEffect)(() => {
|
|
47696
|
-
setImages((prev) => dropOversized(prev, activeTab
|
|
47697
|
-
}, [activeTab?.fullPath]);
|
|
48711
|
+
setImages((prev) => dropOversized(prev, activeTab === void 0 ? void 0 : imageCacheKey(activeTab)));
|
|
48712
|
+
}, [activeTab?.fullPath, activeTab?.reloadNonce]);
|
|
47698
48713
|
const closeWithGuard = async (tab) => {
|
|
47699
48714
|
if (tab.dirty) {
|
|
47700
48715
|
if (!await confirmDialog({
|
|
@@ -47745,7 +48760,20 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
47745
48760
|
if (activeTab === void 0 || !activeTab.markdown || !activeTab.preview) return null;
|
|
47746
48761
|
return renderMarkdown(activeTab.text);
|
|
47747
48762
|
}, [activeTab]);
|
|
48763
|
+
/**
|
|
48764
|
+
* The status bar's indent hint, derived from the loaded text.
|
|
48765
|
+
*
|
|
48766
|
+
* Memoised on the tab: the status bar re-renders on every caret move, and
|
|
48767
|
+
* scanning 200 lines per arrow key would be free in theory and wasteful in
|
|
48768
|
+
* practice.
|
|
48769
|
+
*/
|
|
48770
|
+
const indentLabel = (0, react.useMemo)(() => {
|
|
48771
|
+
if (activeTab === void 0 || activeTab.kind !== "file" || activeTab.binary) return void 0;
|
|
48772
|
+
return detectIndentLabel(activeTab.text);
|
|
48773
|
+
}, [activeTab]);
|
|
47748
48774
|
const editorRef = (0, react.useRef)(null);
|
|
48775
|
+
/** Editor body container: anchors the Ctrl+wheel zoom listener. */
|
|
48776
|
+
const bodyRef = (0, react.useRef)(null);
|
|
47749
48777
|
/**
|
|
47750
48778
|
* Scroll + caret per tab, so re-selecting a tab returns to where it was.
|
|
47751
48779
|
*
|
|
@@ -47823,6 +48851,27 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
47823
48851
|
if (!editorMounted || activeTab === void 0) return;
|
|
47824
48852
|
return registerLiveEditor(activeTab.id, () => editorRef.current);
|
|
47825
48853
|
}, [editorMounted, activeTab?.id]);
|
|
48854
|
+
/**
|
|
48855
|
+
* Ctrl/Cmd + wheel changes the editor font size (same feel as the floating
|
|
48856
|
+
* window's zoom).
|
|
48857
|
+
*
|
|
48858
|
+
* A native listener, not React's `onWheel`: React attaches its wheel handler
|
|
48859
|
+
* as passive at the root, so `preventDefault()` is ignored and the page
|
|
48860
|
+
* zooms instead. Scoped to the editor body, so the tree/terminal keep their
|
|
48861
|
+
* own gestures.
|
|
48862
|
+
*/
|
|
48863
|
+
(0, react.useEffect)(() => {
|
|
48864
|
+
const element = bodyRef.current;
|
|
48865
|
+
if (element === null) return;
|
|
48866
|
+
const onWheel = (event) => {
|
|
48867
|
+
if (!(event.ctrlKey || event.metaKey)) return;
|
|
48868
|
+
event.preventDefault();
|
|
48869
|
+
const direction = event.deltaY < 0 ? 1 : -1;
|
|
48870
|
+
updateEditorSettings({ fontSize: stepFontSize(editorSettingsSnapshot().fontSize, direction) });
|
|
48871
|
+
};
|
|
48872
|
+
element.addEventListener("wheel", onWheel, { passive: false });
|
|
48873
|
+
return () => element.removeEventListener("wheel", onWheel);
|
|
48874
|
+
}, [tabs.length]);
|
|
47826
48875
|
const saveActive = async () => {
|
|
47827
48876
|
const tab = activeTab;
|
|
47828
48877
|
if (tab === void 0) return;
|
|
@@ -47934,358 +48983,523 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
47934
48983
|
};
|
|
47935
48984
|
});
|
|
47936
48985
|
}, [props.visible]);
|
|
47937
|
-
if (tabs.length === 0)
|
|
47938
|
-
|
|
47939
|
-
|
|
47940
|
-
|
|
47941
|
-
|
|
47942
|
-
style: {
|
|
47943
|
-
marginTop: 8,
|
|
47944
|
-
fontSize: 11
|
|
47945
|
-
},
|
|
48986
|
+
if (tabs.length === 0) {
|
|
48987
|
+
if (center) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48988
|
+
className: "rvs-pane grow rvs-edge",
|
|
48989
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48990
|
+
className: "rvs-editor-empty",
|
|
47946
48991
|
children: [
|
|
47947
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
47948
|
-
className: "rvs-
|
|
47949
|
-
|
|
48992
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48993
|
+
className: "rvs-editor-empty-glyph",
|
|
48994
|
+
"aria-hidden": "true",
|
|
48995
|
+
children: "✎"
|
|
47950
48996
|
}),
|
|
47951
|
-
|
|
47952
|
-
|
|
47953
|
-
|
|
47954
|
-
children: "S"
|
|
48997
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48998
|
+
className: "rvs-editor-empty-title",
|
|
48999
|
+
children: t("editor.centerEmptyTitle")
|
|
47955
49000
|
}),
|
|
47956
|
-
|
|
47957
|
-
|
|
49001
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49002
|
+
className: "rvs-editor-empty-hint",
|
|
49003
|
+
children: t("editor.centerEmptyHint")
|
|
49004
|
+
}),
|
|
49005
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49006
|
+
className: "rvs-editor-empty-hint",
|
|
49007
|
+
style: { opacity: .7 },
|
|
49008
|
+
children: t("editor.emptyShortcuts")
|
|
49009
|
+
})
|
|
47958
49010
|
]
|
|
47959
|
-
})
|
|
47960
|
-
})
|
|
47961
|
-
|
|
49011
|
+
})
|
|
49012
|
+
});
|
|
49013
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49014
|
+
className: "rvs-pane grow rvs-edge",
|
|
49015
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49016
|
+
className: "rvs-empty",
|
|
49017
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49018
|
+
className: "rvs-empty-title",
|
|
49019
|
+
children: t("editor.dockEmptyTitle")
|
|
49020
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49021
|
+
className: "rvs-empty-hint",
|
|
49022
|
+
children: t("editor.dockEmptyHint")
|
|
49023
|
+
})]
|
|
49024
|
+
})
|
|
49025
|
+
});
|
|
49026
|
+
}
|
|
49027
|
+
const isDiff = activeTab?.kind === "diff";
|
|
49028
|
+
/**
|
|
49029
|
+
* Whether the "switch to content editing" action makes sense for this diff.
|
|
49030
|
+
*
|
|
49031
|
+
* A commit drill-down compares historical blobs; opening TODAY's file from it
|
|
49032
|
+
* would read as editing the commit. A deletion has no content to edit (the
|
|
49033
|
+
* read would just fail), and a binary diff has nothing an editor can show.
|
|
49034
|
+
*/
|
|
49035
|
+
const canSwitchToEdit = activeTab !== void 0 && activeTab.kind === "diff" && activeTab.ref === void 0 && activeTab.diff !== void 0 && !activeTab.diff.unsupported && !(activeTab.diff.newText === "" && activeTab.diff.oldText !== "");
|
|
49036
|
+
const displayPath = activeTab?.fullPath ?? "";
|
|
49037
|
+
const language = isDiff ? "Diff" : activeTab?.image === true ? "Image" : langLabel(langFromPath(activeTab?.rel ?? ""));
|
|
49038
|
+
const activeImageKey = activeTab === void 0 ? void 0 : imageCacheKey(activeTab);
|
|
49039
|
+
const imageSrc = activeTab !== void 0 && activeTab.image && activeImageKey !== void 0 ? images[activeImageKey] : void 0;
|
|
49040
|
+
const imageFailure = activeTab !== void 0 && activeTab.image && activeImageKey !== void 0 ? imageError[activeImageKey] : void 0;
|
|
47962
49041
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
47963
49042
|
className: "rvs-pane grow rvs-edge",
|
|
49043
|
+
style: fontStyle,
|
|
47964
49044
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
47965
49045
|
className: "rvs-etabs",
|
|
47966
49046
|
role: "tablist",
|
|
47967
|
-
|
|
47968
|
-
|
|
47969
|
-
|
|
47970
|
-
|
|
47971
|
-
|
|
47972
|
-
|
|
47973
|
-
|
|
47974
|
-
|
|
47975
|
-
|
|
47976
|
-
|
|
49047
|
+
"aria-label": t("editor.tabsLabel"),
|
|
49048
|
+
children: tabs.map((tab) => {
|
|
49049
|
+
const active = tab.id === store.activeTabId;
|
|
49050
|
+
const tabIsDiff = tab.kind === "diff";
|
|
49051
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49052
|
+
role: "tab",
|
|
49053
|
+
tabIndex: 0,
|
|
49054
|
+
"aria-selected": active,
|
|
49055
|
+
className: `rvs-etab${active ? " active" : ""}${tabIsDiff ? " rvs-etab-diff" : ""}`,
|
|
49056
|
+
title: tabIsDiff ? `${tab.rel}${t("editor.diffSuffix")}` : tab.fullPath,
|
|
49057
|
+
onClick: () => store.activateTab(tab.id),
|
|
49058
|
+
onAuxClick: (event) => {
|
|
49059
|
+
if (event.button !== 1) return;
|
|
49060
|
+
event.preventDefault();
|
|
47977
49061
|
closeWithGuard(tab);
|
|
47978
|
-
}
|
|
47979
|
-
},
|
|
47980
|
-
children: [
|
|
47981
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
47982
|
-
className: "rvs-node-icon",
|
|
47983
|
-
style: {
|
|
47984
|
-
width: 14,
|
|
47985
|
-
height: 14
|
|
47986
|
-
},
|
|
47987
|
-
children: tabIcon(tab)
|
|
47988
|
-
}),
|
|
47989
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
47990
|
-
className: "rvs-etab-name",
|
|
47991
|
-
children: [baseName(tab.rel), tab.kind === "diff" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
47992
|
-
style: { opacity: .6 },
|
|
47993
|
-
children: " · diff"
|
|
47994
|
-
})]
|
|
47995
|
-
}),
|
|
47996
|
-
tab.dirty && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
47997
|
-
className: "rvs-etab-dot",
|
|
47998
|
-
title: t("editor.unsaved"),
|
|
47999
|
-
children: "●"
|
|
48000
|
-
}),
|
|
48001
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48002
|
-
className: "rvs-etab-close",
|
|
48003
|
-
role: "presentation",
|
|
48004
|
-
title: t("common.close"),
|
|
48005
|
-
onClick: (e) => {
|
|
48006
|
-
e.stopPropagation();
|
|
48007
|
-
closeWithGuard(tab);
|
|
48008
|
-
},
|
|
48009
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconClose, { size: 11 })
|
|
48010
|
-
})
|
|
48011
|
-
]
|
|
48012
|
-
}, tab.id))
|
|
48013
|
-
}), activeTab !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48014
|
-
className: "rvs-einfo",
|
|
48015
|
-
children: [
|
|
48016
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48017
|
-
className: "rvs-einfo-path",
|
|
48018
|
-
title: activeTab.fullPath,
|
|
48019
|
-
children: activeTab.fullPath
|
|
48020
|
-
}),
|
|
48021
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "rvs-einfo-spacer" }),
|
|
48022
|
-
activeTab.kind === "file" && (activeTab.markdown || activeTab.html) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Segmented, {
|
|
48023
|
-
value: activeTab.preview ? "preview" : "source",
|
|
48024
|
-
onChange: (next) => store.updateTab(activeTab.id, { preview: next === "preview" }),
|
|
48025
|
-
options: [{
|
|
48026
|
-
id: "preview",
|
|
48027
|
-
label: t("editor.preview")
|
|
48028
|
-
}, {
|
|
48029
|
-
id: "source",
|
|
48030
|
-
label: t("editor.source")
|
|
48031
|
-
}]
|
|
48032
|
-
}),
|
|
48033
|
-
activeTab.kind === "diff" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
48034
|
-
style: { color: "var(--rvs-fg3)" },
|
|
48035
|
-
children: [activeTab.staged && activeTab.ref === void 0 ? t("scm.stagedReadonly") : "", activeTab.ref !== void 0 ? `${t("scm.commitDiff")} ${activeTab.ref.slice(0, 7)}` : ""]
|
|
48036
|
-
}),
|
|
48037
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48038
|
-
style: { color: "var(--rvs-fg3)" },
|
|
48039
|
-
children: langLabel(langFromPath(activeTab.rel))
|
|
48040
|
-
}),
|
|
48041
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConnectionStatusChip, { compact: true }),
|
|
48042
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48043
|
-
className: "rvs-build",
|
|
48044
|
-
title: `dsh-remote-vs build 1121-1013`,
|
|
48045
|
-
children: "1121-1013"
|
|
48046
|
-
}),
|
|
48047
|
-
tokenCount !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
48048
|
-
className: "rvs-build",
|
|
48049
|
-
title: t("editor.tokenCount"),
|
|
48050
|
-
children: ["tok ", tokenCount]
|
|
48051
|
-
}),
|
|
48052
|
-
activeTab.kind === "file" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
48053
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48054
|
-
className: `rvs-status ${tabStatusClass(activeTab)}`,
|
|
48055
|
-
children: t(tabStatusKey(activeTab))
|
|
48056
|
-
}),
|
|
48057
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
48058
|
-
title: t("editor.reloadFile"),
|
|
48059
|
-
onClick: () => {
|
|
48060
|
-
reloadWithGuard(activeTab);
|
|
48061
|
-
},
|
|
48062
|
-
disabled: offline || activeTab.loading,
|
|
48063
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconRefresh, { size: 13 })
|
|
48064
|
-
}),
|
|
48065
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
48066
|
-
title: `${t("editor.save")} (Ctrl+S)`,
|
|
48067
|
-
onClick: () => {
|
|
48068
|
-
saveActive();
|
|
48069
|
-
},
|
|
48070
|
-
disabled: offline || activeTab.loading || activeTab.binary || activeTab.truncated || !activeTab.dirty,
|
|
48071
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSave, { size: 13 })
|
|
48072
|
-
})
|
|
48073
|
-
] }),
|
|
48074
|
-
activeTab.kind === "diff" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
48075
|
-
title: t("scm.reloadDiff"),
|
|
48076
|
-
onClick: () => {
|
|
48077
|
-
reloadWithGuard(activeTab);
|
|
48078
49062
|
},
|
|
48079
|
-
|
|
48080
|
-
|
|
48081
|
-
|
|
48082
|
-
|
|
48083
|
-
|
|
48084
|
-
|
|
48085
|
-
|
|
48086
|
-
|
|
48087
|
-
|
|
48088
|
-
|
|
48089
|
-
|
|
48090
|
-
|
|
48091
|
-
|
|
48092
|
-
|
|
48093
|
-
|
|
48094
|
-
|
|
48095
|
-
|
|
48096
|
-
|
|
48097
|
-
|
|
48098
|
-
|
|
48099
|
-
|
|
48100
|
-
|
|
48101
|
-
|
|
48102
|
-
|
|
48103
|
-
|
|
49063
|
+
onKeyDown: (event) => {
|
|
49064
|
+
if (event.nativeEvent.isComposing) return;
|
|
49065
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
49066
|
+
event.preventDefault();
|
|
49067
|
+
store.activateTab(tab.id);
|
|
49068
|
+
}
|
|
49069
|
+
},
|
|
49070
|
+
children: [
|
|
49071
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49072
|
+
className: "rvs-etab-glyph",
|
|
49073
|
+
children: tabIcon(tab)
|
|
49074
|
+
}),
|
|
49075
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
49076
|
+
className: "rvs-etab-name",
|
|
49077
|
+
children: [baseName(tab.rel), tabIsDiff && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49078
|
+
style: { opacity: .6 },
|
|
49079
|
+
children: t("editor.diffSuffix")
|
|
49080
|
+
})]
|
|
49081
|
+
}),
|
|
49082
|
+
tab.dirty && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49083
|
+
className: "rvs-etab-dot",
|
|
49084
|
+
title: t("editor.unsaved")
|
|
49085
|
+
}),
|
|
49086
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
49087
|
+
type: "button",
|
|
49088
|
+
className: "rvs-etab-close",
|
|
49089
|
+
title: t("common.close"),
|
|
49090
|
+
"aria-label": t("common.close"),
|
|
49091
|
+
onClick: (event) => {
|
|
49092
|
+
event.stopPropagation();
|
|
49093
|
+
closeWithGuard(tab);
|
|
49094
|
+
},
|
|
49095
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconClose, { size: 11 })
|
|
49096
|
+
})
|
|
49097
|
+
]
|
|
49098
|
+
}, tab.id);
|
|
49099
|
+
})
|
|
49100
|
+
}), activeTab !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
49101
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49102
|
+
className: "rvs-einfo",
|
|
49103
|
+
children: [center && activeTab.kind === "file" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Breadcrumb, {
|
|
49104
|
+
t,
|
|
49105
|
+
alias,
|
|
49106
|
+
root: store.root,
|
|
49107
|
+
rootName: store.workspace?.name ?? "",
|
|
49108
|
+
path: displayPath,
|
|
49109
|
+
onOpen: (fullPath) => {
|
|
49110
|
+
store.openFile(fullPath);
|
|
49111
|
+
}
|
|
49112
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49113
|
+
className: "rvs-einfo-path",
|
|
49114
|
+
title: displayPath,
|
|
49115
|
+
children: displayPath
|
|
49116
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
49117
|
+
className: "rvs-einfo-actions",
|
|
49118
|
+
children: [
|
|
49119
|
+
activeTab.kind === "file" && (activeTab.markdown || activeTab.html) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Segmented, {
|
|
49120
|
+
value: activeTab.preview ? "preview" : "source",
|
|
49121
|
+
onChange: (next) => store.updateTab(activeTab.id, { preview: next === "preview" }),
|
|
49122
|
+
options: [{
|
|
49123
|
+
id: "preview",
|
|
49124
|
+
label: t("editor.preview")
|
|
49125
|
+
}, {
|
|
49126
|
+
id: "source",
|
|
49127
|
+
label: t("editor.source")
|
|
49128
|
+
}]
|
|
49129
|
+
}),
|
|
49130
|
+
activeTab.kind === "diff" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
49131
|
+
style: { color: "var(--rvs-fg3)" },
|
|
49132
|
+
children: [activeTab.staged && activeTab.ref === void 0 ? t("scm.stagedReadonly") : "", activeTab.ref !== void 0 ? `${t("scm.commitDiff")} ${activeTab.ref.slice(0, 7)}` : ""]
|
|
49133
|
+
}),
|
|
49134
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49135
|
+
style: { color: "var(--rvs-fg3)" },
|
|
49136
|
+
children: language
|
|
49137
|
+
}),
|
|
49138
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConnectionStatusChip, { compact: true }),
|
|
49139
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49140
|
+
className: "rvs-build",
|
|
49141
|
+
title: `dsh-remote-vs build 1123-1627`,
|
|
49142
|
+
children: "1123-1627"
|
|
49143
|
+
}),
|
|
49144
|
+
tokenCount !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
49145
|
+
className: "rvs-build",
|
|
49146
|
+
title: t("editor.tokenCount"),
|
|
49147
|
+
children: ["tok ", tokenCount]
|
|
49148
|
+
}),
|
|
49149
|
+
activeTab.kind === "file" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
49150
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49151
|
+
className: `rvs-status ${tabStatusClass(activeTab)}`,
|
|
49152
|
+
children: t(tabStatusKey(activeTab))
|
|
48104
49153
|
}),
|
|
48105
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
49154
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49155
|
+
title: t("editor.reloadFile"),
|
|
48106
49156
|
onClick: () => {
|
|
48107
49157
|
reloadWithGuard(activeTab);
|
|
48108
49158
|
},
|
|
48109
|
-
disabled: offline,
|
|
48110
|
-
children:
|
|
48111
|
-
}),
|
|
48112
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Btn, {
|
|
48113
|
-
kind: "danger",
|
|
48114
|
-
onClick: () => {
|
|
48115
|
-
overwriteConflict(activeTab);
|
|
48116
|
-
},
|
|
48117
|
-
disabled: offline,
|
|
48118
|
-
children: t("editor.conflictOverwrite")
|
|
49159
|
+
disabled: offline || activeTab.loading,
|
|
49160
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconRefresh, { size: 13 })
|
|
48119
49161
|
}),
|
|
48120
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
49162
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49163
|
+
title: `${t("editor.save")} (Ctrl+S)`,
|
|
48121
49164
|
onClick: () => {
|
|
48122
|
-
|
|
48123
|
-
setConflictDiff(void 0);
|
|
49165
|
+
saveActive();
|
|
48124
49166
|
},
|
|
48125
|
-
|
|
49167
|
+
disabled: offline || activeTab.loading || activeTab.binary || activeTab.truncated || !activeTab.dirty,
|
|
49168
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSave, { size: 13 })
|
|
48126
49169
|
})
|
|
48127
|
-
]
|
|
48128
|
-
|
|
48129
|
-
|
|
48130
|
-
|
|
48131
|
-
|
|
48132
|
-
|
|
48133
|
-
|
|
48134
|
-
|
|
48135
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
48136
|
-
|
|
48137
|
-
|
|
49170
|
+
] }),
|
|
49171
|
+
activeTab.kind === "diff" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49172
|
+
title: t("scm.reloadDiff"),
|
|
49173
|
+
onClick: () => {
|
|
49174
|
+
reloadWithGuard(activeTab);
|
|
49175
|
+
},
|
|
49176
|
+
disabled: offline,
|
|
49177
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconRefresh, { size: 13 })
|
|
49178
|
+
}), canSwitchToEdit && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49179
|
+
title: t("editor.switchToEdit"),
|
|
49180
|
+
onClick: () => {
|
|
49181
|
+
store.openFile(activeTab.fullPath);
|
|
49182
|
+
},
|
|
49183
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCode, { size: 13 })
|
|
49184
|
+
})] }),
|
|
49185
|
+
activeTab.kind === "file" && !activeTab.image && !activeTab.binary && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49186
|
+
title: t("editor.wrap"),
|
|
49187
|
+
onClick: () => updateEditorSettings({ wrap: !settings.wrap }),
|
|
49188
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconWrap, { size: 13 })
|
|
48138
49189
|
}),
|
|
48139
|
-
|
|
48140
|
-
className: "rvs-
|
|
48141
|
-
|
|
48142
|
-
className: "rvs-conflict-hunk-head",
|
|
48143
|
-
children: `@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`
|
|
48144
|
-
}), hunk.lines.map((line, lineIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48145
|
-
className: `rvs-conflict-row${line.startsWith("+") ? " add" : ""}${line.startsWith("-") ? " del" : ""}`,
|
|
48146
|
-
children: line
|
|
48147
|
-
}, `line-${lineIndex}`))]
|
|
48148
|
-
}, `hunk-${hunkIndex}`)),
|
|
48149
|
-
conflictDiff.hunks.length > CONFLICT_DIFF_HUNKS && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48150
|
-
className: "rvs-conflict-more",
|
|
48151
|
-
children: t("editor.conflictMoreHunks").replace("{count}", String(conflictDiff.hunks.length - CONFLICT_DIFF_HUNKS))
|
|
48152
|
-
})
|
|
48153
|
-
]
|
|
48154
|
-
}),
|
|
48155
|
-
activeTab.kind === "file" && changeHunks.length > 0 && activeTab.changeStale !== true && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48156
|
-
className: "rvs-change-nav",
|
|
48157
|
-
role: "group",
|
|
48158
|
-
"aria-label": t("changes.navLabel"),
|
|
48159
|
-
children: [
|
|
48160
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
48161
|
-
className: "rvs-change-nav-count",
|
|
48162
|
-
title: t("changes.navLabel"),
|
|
48163
|
-
children: [
|
|
48164
|
-
Math.min((activeTab.activeHunk ?? 0) + 1, changeHunks.length),
|
|
48165
|
-
"/",
|
|
48166
|
-
changeHunks.length
|
|
48167
|
-
]
|
|
49190
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49191
|
+
className: "rvs-einfo-actions-divider",
|
|
49192
|
+
"aria-hidden": "true"
|
|
48168
49193
|
}),
|
|
48169
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
48170
|
-
|
|
48171
|
-
|
|
48172
|
-
|
|
48173
|
-
|
|
49194
|
+
variant !== "float" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49195
|
+
title: t("editor.fontSmaller"),
|
|
49196
|
+
onClick: () => updateEditorSettings({ fontSize: stepFontSize(settings.fontSize, -1) }),
|
|
49197
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49198
|
+
className: "rvs-font-glyph",
|
|
49199
|
+
children: "A−"
|
|
49200
|
+
})
|
|
49201
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49202
|
+
title: t("editor.fontLarger"),
|
|
49203
|
+
onClick: () => updateEditorSettings({ fontSize: stepFontSize(settings.fontSize, 1) }),
|
|
49204
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49205
|
+
className: "rvs-font-glyph",
|
|
49206
|
+
children: "A+"
|
|
49207
|
+
})
|
|
49208
|
+
})] }),
|
|
49209
|
+
variant !== "float" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49210
|
+
title: t("float.title"),
|
|
48174
49211
|
onClick: () => {
|
|
48175
|
-
|
|
49212
|
+
store.openFloatingEditor();
|
|
48176
49213
|
},
|
|
48177
|
-
children:
|
|
49214
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFloat, { size: 13 })
|
|
48178
49215
|
}),
|
|
48179
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
48180
|
-
|
|
48181
|
-
className: "rvs-change-nav-btn",
|
|
48182
|
-
title: t("changes.next"),
|
|
48183
|
-
"aria-label": t("changes.next"),
|
|
49216
|
+
variant === "center" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49217
|
+
title: t("editor.dockToSidebar"),
|
|
48184
49218
|
onClick: () => {
|
|
48185
|
-
|
|
49219
|
+
store.dockEditorSidebar();
|
|
48186
49220
|
},
|
|
48187
|
-
children:
|
|
48188
|
-
})
|
|
48189
|
-
|
|
48190
|
-
|
|
48191
|
-
|
|
48192
|
-
|
|
48193
|
-
|
|
48194
|
-
|
|
48195
|
-
" ",
|
|
48196
|
-
t("common.loading")
|
|
49221
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCollapse, { size: 13 })
|
|
49222
|
+
}) : variant === "sidebar" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49223
|
+
title: t("editor.openInCenter"),
|
|
49224
|
+
onClick: () => {
|
|
49225
|
+
store.openEditorInCenter();
|
|
49226
|
+
},
|
|
49227
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconExpand, { size: 13 })
|
|
49228
|
+
}) : null
|
|
48197
49229
|
]
|
|
48198
|
-
})
|
|
48199
|
-
|
|
48200
|
-
|
|
48201
|
-
|
|
48202
|
-
|
|
48203
|
-
|
|
48204
|
-
|
|
48205
|
-
|
|
48206
|
-
|
|
48207
|
-
|
|
48208
|
-
|
|
48209
|
-
|
|
48210
|
-
|
|
48211
|
-
|
|
48212
|
-
|
|
48213
|
-
|
|
48214
|
-
|
|
48215
|
-
|
|
48216
|
-
|
|
48217
|
-
|
|
48218
|
-
|
|
48219
|
-
|
|
48220
|
-
|
|
48221
|
-
|
|
48222
|
-
|
|
48223
|
-
|
|
49230
|
+
})]
|
|
49231
|
+
}),
|
|
49232
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49233
|
+
className: "rvs-body",
|
|
49234
|
+
ref: bodyRef,
|
|
49235
|
+
children: [
|
|
49236
|
+
(activeTab.kind === "file" || activeTab.kind === "diff") && activeTab.conflict !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49237
|
+
className: "rvs-banner warn rvs-conflict",
|
|
49238
|
+
role: "alert",
|
|
49239
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49240
|
+
className: "rvs-conflict-text",
|
|
49241
|
+
children: [
|
|
49242
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("editor.conflictTitle") }),
|
|
49243
|
+
" ",
|
|
49244
|
+
conflictVersion(t, activeTab.conflict)
|
|
49245
|
+
]
|
|
49246
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49247
|
+
className: "rvs-conflict-actions",
|
|
49248
|
+
children: [
|
|
49249
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Btn, {
|
|
49250
|
+
onClick: () => {
|
|
49251
|
+
showConflictDiff(activeTab);
|
|
49252
|
+
},
|
|
49253
|
+
children: t("editor.conflictDiff")
|
|
49254
|
+
}),
|
|
49255
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Btn, {
|
|
49256
|
+
onClick: () => {
|
|
49257
|
+
reloadWithGuard(activeTab);
|
|
49258
|
+
},
|
|
49259
|
+
disabled: offline,
|
|
49260
|
+
children: t("editor.conflictReload")
|
|
49261
|
+
}),
|
|
49262
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Btn, {
|
|
49263
|
+
kind: "danger",
|
|
49264
|
+
onClick: () => {
|
|
49265
|
+
overwriteConflict(activeTab);
|
|
49266
|
+
},
|
|
49267
|
+
disabled: offline,
|
|
49268
|
+
children: t("editor.conflictOverwrite")
|
|
49269
|
+
}),
|
|
49270
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Btn, {
|
|
49271
|
+
onClick: () => {
|
|
49272
|
+
store.dismissConflict(activeTab.id);
|
|
49273
|
+
setConflictDiff(void 0);
|
|
49274
|
+
},
|
|
49275
|
+
children: t("common.close")
|
|
49276
|
+
})
|
|
49277
|
+
]
|
|
49278
|
+
})]
|
|
48224
49279
|
}),
|
|
48225
|
-
|
|
49280
|
+
conflictDiff !== void 0 && activeTab.conflict !== void 0 && conflictDiff.tabId === activeTab.id && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49281
|
+
className: "rvs-conflict-diff",
|
|
49282
|
+
role: "region",
|
|
49283
|
+
"aria-label": t("editor.conflictDiff"),
|
|
49284
|
+
children: [
|
|
49285
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49286
|
+
className: "rvs-conflict-diff-head",
|
|
49287
|
+
children: [conflictDiffNote(t, conflictDiff), conflictDiff.remoteMtime !== null && ` · ${new Date(conflictDiff.remoteMtime).toLocaleString()}`]
|
|
49288
|
+
}),
|
|
49289
|
+
conflictDiff.hunks.slice(0, CONFLICT_DIFF_HUNKS).map((hunk, hunkIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49290
|
+
className: "rvs-conflict-hunk",
|
|
49291
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49292
|
+
className: "rvs-conflict-hunk-head",
|
|
49293
|
+
children: `@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`
|
|
49294
|
+
}), hunk.lines.map((line, lineIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49295
|
+
className: `rvs-conflict-row${line.startsWith("+") ? " add" : ""}${line.startsWith("-") ? " del" : ""}`,
|
|
49296
|
+
children: line
|
|
49297
|
+
}, `line-${lineIndex}`))]
|
|
49298
|
+
}, `hunk-${hunkIndex}`)),
|
|
49299
|
+
conflictDiff.hunks.length > CONFLICT_DIFF_HUNKS && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49300
|
+
className: "rvs-conflict-more",
|
|
49301
|
+
children: t("editor.conflictMoreHunks").replace("{count}", String(conflictDiff.hunks.length - CONFLICT_DIFF_HUNKS))
|
|
49302
|
+
})
|
|
49303
|
+
]
|
|
49304
|
+
}),
|
|
49305
|
+
activeTab.kind === "file" && changeHunks.length > 0 && activeTab.changeStale !== true && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49306
|
+
className: "rvs-change-nav",
|
|
49307
|
+
role: "group",
|
|
49308
|
+
"aria-label": t("changes.navLabel"),
|
|
49309
|
+
children: [
|
|
49310
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
49311
|
+
className: "rvs-change-nav-count",
|
|
49312
|
+
title: t("changes.navLabel"),
|
|
49313
|
+
children: [
|
|
49314
|
+
Math.min((activeTab.activeHunk ?? 0) + 1, changeHunks.length),
|
|
49315
|
+
"/",
|
|
49316
|
+
changeHunks.length
|
|
49317
|
+
]
|
|
49318
|
+
}),
|
|
49319
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
49320
|
+
type: "button",
|
|
49321
|
+
className: "rvs-change-nav-btn",
|
|
49322
|
+
title: t("changes.prev"),
|
|
49323
|
+
"aria-label": t("changes.prev"),
|
|
49324
|
+
onClick: () => {
|
|
49325
|
+
gotoChange(activeTab.id, -1);
|
|
49326
|
+
},
|
|
49327
|
+
children: "↑"
|
|
49328
|
+
}),
|
|
49329
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
49330
|
+
type: "button",
|
|
49331
|
+
className: "rvs-change-nav-btn",
|
|
49332
|
+
title: t("changes.next"),
|
|
49333
|
+
"aria-label": t("changes.next"),
|
|
49334
|
+
onClick: () => {
|
|
49335
|
+
gotoChange(activeTab.id, 1);
|
|
49336
|
+
},
|
|
49337
|
+
children: "↓"
|
|
49338
|
+
})
|
|
49339
|
+
]
|
|
49340
|
+
}),
|
|
49341
|
+
activeTab.loading && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48226
49342
|
className: "rvs-empty",
|
|
48227
|
-
children:
|
|
49343
|
+
children: [
|
|
49344
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MiniSpinner, {}),
|
|
49345
|
+
" ",
|
|
49346
|
+
t("common.loading")
|
|
49347
|
+
]
|
|
48228
49348
|
}),
|
|
48229
|
-
|
|
48230
|
-
|
|
48231
|
-
|
|
48232
|
-
title: activeTab.rel,
|
|
48233
|
-
sandbox: "allow-same-origin",
|
|
48234
|
-
srcDoc: htmlDoc
|
|
49349
|
+
offline && activeTab.error === void 0 && activeTab.loading === false && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49350
|
+
className: "rvs-banner warn",
|
|
49351
|
+
children: [t("connection.editorReadOnly"), activeTab.kind === "file" && activeTab.dirty && ` ${t("connection.editorDirty")}`]
|
|
48235
49352
|
}),
|
|
48236
|
-
!activeTab.
|
|
48237
|
-
className:
|
|
48238
|
-
children:
|
|
48239
|
-
|
|
48240
|
-
|
|
48241
|
-
|
|
48242
|
-
|
|
48243
|
-
|
|
48244
|
-
|
|
48245
|
-
|
|
48246
|
-
|
|
48247
|
-
|
|
48248
|
-
|
|
48249
|
-
|
|
48250
|
-
|
|
48251
|
-
|
|
48252
|
-
|
|
48253
|
-
|
|
48254
|
-
|
|
48255
|
-
|
|
48256
|
-
|
|
48257
|
-
|
|
48258
|
-
|
|
48259
|
-
|
|
48260
|
-
|
|
48261
|
-
|
|
48262
|
-
|
|
48263
|
-
|
|
48264
|
-
|
|
48265
|
-
|
|
48266
|
-
|
|
48267
|
-
|
|
48268
|
-
|
|
48269
|
-
|
|
48270
|
-
|
|
48271
|
-
|
|
48272
|
-
|
|
48273
|
-
|
|
48274
|
-
|
|
48275
|
-
|
|
48276
|
-
|
|
48277
|
-
|
|
48278
|
-
|
|
48279
|
-
|
|
48280
|
-
|
|
48281
|
-
|
|
49353
|
+
!activeTab.loading && activeTab.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49354
|
+
className: "rvs-banner error",
|
|
49355
|
+
children: offline && isConnectionFailure(activeTab.error) ? t("connection.readFailed") : activeTab.error
|
|
49356
|
+
}),
|
|
49357
|
+
!activeTab.loading && activeTab.error === void 0 && activeTab.kind === "diff" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DiffView, {
|
|
49358
|
+
tab: activeTab,
|
|
49359
|
+
visible: props.visible,
|
|
49360
|
+
offline: offline === true
|
|
49361
|
+
}),
|
|
49362
|
+
!activeTab.loading && activeTab.error === void 0 && activeTab.kind === "file" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
49363
|
+
activeTab.image && (imageSrc !== void 0 || activeTab.truncated) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImagePreview, {
|
|
49364
|
+
src: imageSrc ?? "",
|
|
49365
|
+
path: activeTab.rel,
|
|
49366
|
+
size: activeTab.remoteSize ?? 0,
|
|
49367
|
+
...activeTab.truncated ? { truncated: true } : {},
|
|
49368
|
+
t
|
|
49369
|
+
}),
|
|
49370
|
+
activeTab.image && imageSrc === void 0 && !activeTab.truncated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49371
|
+
className: "rvs-editor-notice",
|
|
49372
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: imageFailure ?? t("common.loading") })
|
|
49373
|
+
}),
|
|
49374
|
+
!activeTab.image && activeTab.binary && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49375
|
+
className: "rvs-editor-notice",
|
|
49376
|
+
children: [
|
|
49377
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49378
|
+
className: "rvs-editor-notice-title",
|
|
49379
|
+
children: t("editor.binaryTitle")
|
|
49380
|
+
}),
|
|
49381
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: activeTab.rel }),
|
|
49382
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: t("editor.binary") })
|
|
49383
|
+
]
|
|
49384
|
+
}),
|
|
49385
|
+
!activeTab.image && !activeTab.binary && activeTab.markdown && activeTab.preview && markdownPreview,
|
|
49386
|
+
!activeTab.image && !activeTab.binary && activeTab.html && activeTab.preview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
|
|
49387
|
+
className: "rvs-html-frame",
|
|
49388
|
+
title: activeTab.rel,
|
|
49389
|
+
sandbox: "allow-same-origin",
|
|
49390
|
+
srcDoc: htmlDoc
|
|
49391
|
+
}),
|
|
49392
|
+
!activeTab.image && !activeTab.binary && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49393
|
+
className: `rvs-editor-host${activeTab.preview && (activeTab.markdown || activeTab.html) ? " rvs-hidden" : ""}`,
|
|
49394
|
+
children: [activeTab.truncated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49395
|
+
className: "rvs-banner warn",
|
|
49396
|
+
children: t("editor.truncated")
|
|
49397
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CodeEditor, {
|
|
49398
|
+
ref: editorRef,
|
|
49399
|
+
initial: activeTab.text,
|
|
49400
|
+
savedText: activeTab.baseline,
|
|
49401
|
+
path: activeTab.fullPath,
|
|
49402
|
+
tabId: activeTab.id,
|
|
49403
|
+
readOnly: activeTab.truncated || offline,
|
|
49404
|
+
visible: props.visible,
|
|
49405
|
+
wrap: settings.wrap,
|
|
49406
|
+
ctx: store.ctx,
|
|
49407
|
+
sessionId: chat.sessionId,
|
|
49408
|
+
remoteRoot: store.repoRoot ?? store.root,
|
|
49409
|
+
chatEnabled,
|
|
49410
|
+
addLabel: t("files.addToConversation"),
|
|
49411
|
+
...activeTab.line === void 0 ? {} : { revealLine: activeTab.line },
|
|
49412
|
+
...activeTab.lineNonce === void 0 ? {} : { revealNonce: activeTab.lineNonce },
|
|
49413
|
+
...activeTab.changeSet === void 0 ? {} : { changeSet: activeTab.changeSet },
|
|
49414
|
+
...activeTab.revealHunkLine === void 0 ? {} : { revealHunkLine: activeTab.revealHunkLine },
|
|
49415
|
+
...activeTab.revealHunkNonce === void 0 ? {} : { revealHunkNonce: activeTab.revealHunkNonce },
|
|
49416
|
+
...editorViewStateOf(activeTab.id) === void 0 ? {} : { viewState: editorViewStateOf(activeTab.id) },
|
|
49417
|
+
onTokens: setTokenCount,
|
|
49418
|
+
onCaretChange: setCaret,
|
|
49419
|
+
onViewState: rememberViewState,
|
|
49420
|
+
onStepHunk: (dir) => {
|
|
49421
|
+
gotoChange(activeTab.id, dir);
|
|
49422
|
+
},
|
|
49423
|
+
onChangeStale: () => {
|
|
49424
|
+
markChangeStale(activeTab.id);
|
|
49425
|
+
},
|
|
49426
|
+
onUndoChange: (mark) => {
|
|
49427
|
+
undoChange(activeTab.id, mark);
|
|
49428
|
+
},
|
|
49429
|
+
undoLabel: (mark) => undoActionLabel(t, mark.kind),
|
|
49430
|
+
onSave: () => {
|
|
49431
|
+
saveActive();
|
|
49432
|
+
},
|
|
49433
|
+
onDirty: (dirty) => store.updateTab(activeTab.id, { dirty }),
|
|
49434
|
+
onBuffer: (tabId, text) => store.updateTab(tabId, { text })
|
|
49435
|
+
}, editorKey(activeTab))]
|
|
49436
|
+
})
|
|
49437
|
+
] })
|
|
49438
|
+
]
|
|
49439
|
+
}),
|
|
49440
|
+
center && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusBar, {
|
|
49441
|
+
t,
|
|
49442
|
+
diff: isDiff,
|
|
49443
|
+
caret,
|
|
49444
|
+
language,
|
|
49445
|
+
indent: indentLabel,
|
|
49446
|
+
wrap: settings.wrap,
|
|
49447
|
+
fontSize: settings.fontSize,
|
|
49448
|
+
readOnly: activeTab.kind === "file" && (activeTab.binary || activeTab.truncated || offline),
|
|
49449
|
+
dirty: activeTab.dirty,
|
|
49450
|
+
loading: activeTab.loading,
|
|
49451
|
+
saving: activeTab.saving,
|
|
49452
|
+
error: activeTab.error
|
|
49453
|
+
})
|
|
49454
|
+
] })]
|
|
48282
49455
|
});
|
|
48283
49456
|
}
|
|
48284
49457
|
//#endregion
|
|
48285
49458
|
//#region src/client/FloatingPlaceholder.tsx
|
|
48286
|
-
function FloatingEditorPlaceholder() {
|
|
49459
|
+
function FloatingEditorPlaceholder(props) {
|
|
48287
49460
|
const store = useExplorer();
|
|
48288
49461
|
const t = store.t;
|
|
49462
|
+
const mode = props.mode ?? "float";
|
|
49463
|
+
if (mode === "center") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49464
|
+
className: "rvs-float-placeholder",
|
|
49465
|
+
children: [
|
|
49466
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49467
|
+
className: "rvs-float-placeholder-title",
|
|
49468
|
+
children: t("float.centerElsewhere")
|
|
49469
|
+
}),
|
|
49470
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49471
|
+
className: "rvs-float-placeholder-text",
|
|
49472
|
+
children: t("float.centerElsewhereHint")
|
|
49473
|
+
}),
|
|
49474
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Btn, {
|
|
49475
|
+
kind: "primary",
|
|
49476
|
+
onClick: () => {
|
|
49477
|
+
store.dockEditorSidebar();
|
|
49478
|
+
},
|
|
49479
|
+
children: t("editor.dockToSidebar")
|
|
49480
|
+
})
|
|
49481
|
+
]
|
|
49482
|
+
});
|
|
49483
|
+
if (mode === "sidebar") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49484
|
+
className: "rvs-float-placeholder",
|
|
49485
|
+
children: [
|
|
49486
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49487
|
+
className: "rvs-float-placeholder-title",
|
|
49488
|
+
children: t("float.dockedElsewhere")
|
|
49489
|
+
}),
|
|
49490
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49491
|
+
className: "rvs-float-placeholder-text",
|
|
49492
|
+
children: t("float.dockedElsewhereHint")
|
|
49493
|
+
}),
|
|
49494
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Btn, {
|
|
49495
|
+
kind: "primary",
|
|
49496
|
+
onClick: () => {
|
|
49497
|
+
store.openEditorInCenter();
|
|
49498
|
+
},
|
|
49499
|
+
children: t("float.openHere")
|
|
49500
|
+
})
|
|
49501
|
+
]
|
|
49502
|
+
});
|
|
48289
49503
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48290
49504
|
className: "rvs-float-placeholder",
|
|
48291
49505
|
children: [
|
|
@@ -48620,11 +49834,11 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
48620
49834
|
return Math.min(100, Math.round(task.loaded / task.total * 100));
|
|
48621
49835
|
}
|
|
48622
49836
|
let tasks = [];
|
|
48623
|
-
const listeners$
|
|
49837
|
+
const listeners$2 = /* @__PURE__ */ new Set();
|
|
48624
49838
|
const controllers = /* @__PURE__ */ new Map();
|
|
48625
49839
|
let sequence = 0;
|
|
48626
49840
|
const notify = () => {
|
|
48627
|
-
for (const listener of [...listeners$
|
|
49841
|
+
for (const listener of [...listeners$2]) listener();
|
|
48628
49842
|
};
|
|
48629
49843
|
const patch = (id, next) => {
|
|
48630
49844
|
tasks = tasks.map((task) => task.id === id ? {
|
|
@@ -48636,9 +49850,9 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
48636
49850
|
/** Store surface: `useSyncExternalStore(subscribe, getSnapshot, getSnapshot)`. */
|
|
48637
49851
|
const downloadsStore = {
|
|
48638
49852
|
subscribe(listener) {
|
|
48639
|
-
listeners$
|
|
49853
|
+
listeners$2.add(listener);
|
|
48640
49854
|
return () => {
|
|
48641
|
-
listeners$
|
|
49855
|
+
listeners$2.delete(listener);
|
|
48642
49856
|
};
|
|
48643
49857
|
},
|
|
48644
49858
|
getSnapshot() {
|
|
@@ -71763,6 +72977,22 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
71763
72977
|
if (!meta && ctrl && !shift && isLetter(input, "c")) return "copy-interrupt";
|
|
71764
72978
|
}
|
|
71765
72979
|
/**
|
|
72980
|
+
* Map ONE keyboard event to a terminal clipboard command.
|
|
72981
|
+
*
|
|
72982
|
+
* xterm calls its custom key handler for keydown, keyup AND keypress. Only the
|
|
72983
|
+
* keydown PRESS is a command: handling keyup too ran every chord twice, which is
|
|
72984
|
+
* what made Shift+Insert paste the clipboard twice (reported 2026-11-23) — two
|
|
72985
|
+
* Clipboard-API reads and two input frames for one gesture, with no native paste
|
|
72986
|
+
* event involved.
|
|
72987
|
+
*
|
|
72988
|
+
* Pure, so the gate can pin the "keyup is not a command" rule directly instead
|
|
72989
|
+
* of matching source text.
|
|
72990
|
+
*/
|
|
72991
|
+
function terminalKeyCommand(input) {
|
|
72992
|
+
if (input.type !== "keydown") return void 0;
|
|
72993
|
+
return clipboardChordFor(input);
|
|
72994
|
+
}
|
|
72995
|
+
/**
|
|
71766
72996
|
* Watches one Ctrl+V press: the browser's native paste wins when its event arrives,
|
|
71767
72997
|
* otherwise the Clipboard API inserts the text after {@link PASTE_FALLBACK_MS}.
|
|
71768
72998
|
*
|
|
@@ -71825,11 +73055,251 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
71825
73055
|
return data.slice(6, data.length - 6);
|
|
71826
73056
|
}
|
|
71827
73057
|
//#endregion
|
|
73058
|
+
//#region src/client/vsc/terminal-theme.ts
|
|
73059
|
+
/** The dark scheme palette. */
|
|
73060
|
+
const DARK_TERMINAL_THEME = {
|
|
73061
|
+
background: "#0e0e13",
|
|
73062
|
+
foreground: "#e8e8e8",
|
|
73063
|
+
cursor: "#e8e8e8",
|
|
73064
|
+
selectionBackground: "#264f78",
|
|
73065
|
+
selectionInactiveBackground: "#333c48",
|
|
73066
|
+
black: "#000000",
|
|
73067
|
+
red: "#cd3131",
|
|
73068
|
+
green: "#0dbc79",
|
|
73069
|
+
yellow: "#e5e910",
|
|
73070
|
+
blue: "#2472c8",
|
|
73071
|
+
magenta: "#bc3fbc",
|
|
73072
|
+
cyan: "#11a8cd",
|
|
73073
|
+
white: "#e5e5e5",
|
|
73074
|
+
brightBlack: "#7a7a7a",
|
|
73075
|
+
brightRed: "#f14c4c",
|
|
73076
|
+
brightGreen: "#23d18b",
|
|
73077
|
+
brightYellow: "#f5f543",
|
|
73078
|
+
brightBlue: "#3b8eea",
|
|
73079
|
+
brightMagenta: "#d670d6",
|
|
73080
|
+
brightCyan: "#29b8db",
|
|
73081
|
+
brightWhite: "#ffffff"
|
|
73082
|
+
};
|
|
73083
|
+
/** The light scheme palette. */
|
|
73084
|
+
const LIGHT_TERMINAL_THEME = {
|
|
73085
|
+
background: "#ffffff",
|
|
73086
|
+
foreground: "#1a1a1a",
|
|
73087
|
+
cursor: "#1a1a1a",
|
|
73088
|
+
selectionBackground: "#add6ff",
|
|
73089
|
+
selectionInactiveBackground: "#d7e7f5",
|
|
73090
|
+
black: "#000000",
|
|
73091
|
+
red: "#cd3131",
|
|
73092
|
+
green: "#00bc67",
|
|
73093
|
+
yellow: "#949800",
|
|
73094
|
+
blue: "#0451a5",
|
|
73095
|
+
magenta: "#bc05bc",
|
|
73096
|
+
cyan: "#0598bc",
|
|
73097
|
+
white: "#555555",
|
|
73098
|
+
brightBlack: "#666666",
|
|
73099
|
+
brightRed: "#f14c4c",
|
|
73100
|
+
brightGreen: "#23d18b",
|
|
73101
|
+
brightYellow: "#f5f543",
|
|
73102
|
+
brightBlue: "#3b8eea",
|
|
73103
|
+
brightMagenta: "#d670d6",
|
|
73104
|
+
brightCyan: "#29b8db",
|
|
73105
|
+
brightWhite: "#ffffff"
|
|
73106
|
+
};
|
|
73107
|
+
/** The palette for one scheme. */
|
|
73108
|
+
function terminalTheme(dark) {
|
|
73109
|
+
return dark ? DARK_TERMINAL_THEME : LIGHT_TERMINAL_THEME;
|
|
73110
|
+
}
|
|
73111
|
+
//#endregion
|
|
73112
|
+
//#region src/client/terminal-input.ts
|
|
73113
|
+
/**
|
|
73114
|
+
* One registry for "type this into that terminal's command line".
|
|
73115
|
+
*
|
|
73116
|
+
* The snippet panel lives in the terminal's HEADER while the xterm instance is
|
|
73117
|
+
* owned by a child component, so the panel needs an imperative handle without
|
|
73118
|
+
* lifting xterm state into React (a re-render per keystroke would be absurd).
|
|
73119
|
+
* Each mounted `XTerm` registers a paste function under its tab id and removes
|
|
73120
|
+
* it on unmount; the panel asks for the ACTIVE tab.
|
|
73121
|
+
*
|
|
73122
|
+
* Deliberately NOT exported as a React hook: callers are event handlers inside
|
|
73123
|
+
* a portal, not render code.
|
|
73124
|
+
*/
|
|
73125
|
+
/** Registered terminals: tab id → "paste this text, do not press Enter". */
|
|
73126
|
+
const pasters = /* @__PURE__ */ new Map();
|
|
73127
|
+
/** Register one mounted terminal; returns the unregister. */
|
|
73128
|
+
function registerTerminalPaste(tabId, paste) {
|
|
73129
|
+
pasters.set(tabId, paste);
|
|
73130
|
+
return () => {
|
|
73131
|
+
if (pasters.get(tabId) === paste) pasters.delete(tabId);
|
|
73132
|
+
};
|
|
73133
|
+
}
|
|
73134
|
+
/**
|
|
73135
|
+
* Insert one command into the given terminal without sending it.
|
|
73136
|
+
*
|
|
73137
|
+
* @returns false when that tab has no mounted terminal any more (a closed tab, a
|
|
73138
|
+
* panel that is not rendered) — the caller says so instead of pretending.
|
|
73139
|
+
*/
|
|
73140
|
+
function pasteIntoTerminal(tabId, text) {
|
|
73141
|
+
if (tabId === void 0 || text === "") return false;
|
|
73142
|
+
const paste = pasters.get(tabId);
|
|
73143
|
+
if (paste === void 0) return false;
|
|
73144
|
+
paste(text);
|
|
73145
|
+
return true;
|
|
73146
|
+
}
|
|
73147
|
+
/** Create one ordered, coalescing writer. */
|
|
73148
|
+
function createTerminalWriter(deps) {
|
|
73149
|
+
const schedule = deps.schedule ?? ((run) => setTimeout(run, 0));
|
|
73150
|
+
const maxChunk = deps.maxChunkChars ?? 262144;
|
|
73151
|
+
/** Queued chunks, in arrival order (joined only at flush time). */
|
|
73152
|
+
let queue = [];
|
|
73153
|
+
let queuedChars = 0;
|
|
73154
|
+
let scheduled = false;
|
|
73155
|
+
const take = (limit) => {
|
|
73156
|
+
let taken = "";
|
|
73157
|
+
while (queue.length > 0) {
|
|
73158
|
+
const head = queue[0];
|
|
73159
|
+
if (taken !== "" && taken.length + head.length > limit) break;
|
|
73160
|
+
queue.shift();
|
|
73161
|
+
queuedChars -= head.length;
|
|
73162
|
+
taken += head;
|
|
73163
|
+
if (taken.length >= limit) break;
|
|
73164
|
+
}
|
|
73165
|
+
return taken;
|
|
73166
|
+
};
|
|
73167
|
+
const flush = () => {
|
|
73168
|
+
scheduled = false;
|
|
73169
|
+
if (queue.length === 0) return;
|
|
73170
|
+
const chunk = take(maxChunk);
|
|
73171
|
+
if (chunk === "") return;
|
|
73172
|
+
deps.write(chunk);
|
|
73173
|
+
if (queue.length > 0) scheduleFlush();
|
|
73174
|
+
};
|
|
73175
|
+
const scheduleFlush = () => {
|
|
73176
|
+
if (scheduled) return;
|
|
73177
|
+
scheduled = true;
|
|
73178
|
+
schedule(flush);
|
|
73179
|
+
};
|
|
73180
|
+
return {
|
|
73181
|
+
push: (text) => {
|
|
73182
|
+
if (text === "") return;
|
|
73183
|
+
queue.push(text);
|
|
73184
|
+
queuedChars += text.length;
|
|
73185
|
+
if (queuedChars >= maxChunk) flush();
|
|
73186
|
+
else scheduleFlush();
|
|
73187
|
+
},
|
|
73188
|
+
flush: () => {
|
|
73189
|
+
flush();
|
|
73190
|
+
},
|
|
73191
|
+
pendingChars: () => queuedChars
|
|
73192
|
+
};
|
|
73193
|
+
}
|
|
73194
|
+
//#endregion
|
|
73195
|
+
//#region src/client/vsc/terminal-line.ts
|
|
73196
|
+
/**
|
|
73197
|
+
* Track what the user has typed on the CURRENT terminal line (pure).
|
|
73198
|
+
*
|
|
73199
|
+
* Why this exists: `Ctrl+B` should save the command the user is about to run as
|
|
73200
|
+
* a snippet, pre-filled. The PTY protocol has no "current line" query, and asking
|
|
73201
|
+
* the shell would mean typing into it — so the client reconstructs the line from
|
|
73202
|
+
* the same `onData` stream it forwards: printable characters append, backspace
|
|
73203
|
+
* removes, Enter/Ctrl+C/Ctrl+U clear, escape sequences (arrows, F-keys, history
|
|
73204
|
+
* recall) are ignored.
|
|
73205
|
+
*
|
|
73206
|
+
* The result is a BEST-EFFORT draft, not a shell parser: after cursor movement or
|
|
73207
|
+
* history recall it can differ from the real line. That is acceptable because it
|
|
73208
|
+
* only pre-fills an editable form — nothing is executed, and the user can fix it.
|
|
73209
|
+
*/
|
|
73210
|
+
/** Longest line worth remembering (a snippet's command is capped separately). */
|
|
73211
|
+
const TERMINAL_LINE_MAX = 4e3;
|
|
73212
|
+
/**
|
|
73213
|
+
* Apply one chunk of terminal INPUT to the current line.
|
|
73214
|
+
*
|
|
73215
|
+
* @param line - the line reconstructed so far.
|
|
73216
|
+
* @param data - the chunk as handed to the PTY (bracketed-paste markers already
|
|
73217
|
+
* stripped by the caller).
|
|
73218
|
+
* @returns the new line.
|
|
73219
|
+
*/
|
|
73220
|
+
function applyTerminalInput(line, data) {
|
|
73221
|
+
if (data === "") return line;
|
|
73222
|
+
let next = line;
|
|
73223
|
+
/**
|
|
73224
|
+
* Escape-sequence state: xterm hands whole control sequences (arrows, F-keys,
|
|
73225
|
+
* history, mouse reports), and none of their bytes may become text.
|
|
73226
|
+
*
|
|
73227
|
+
* - `esc` just saw ESC: look at the introducer;
|
|
73228
|
+
* - `csi` ESC `[` — consume until a final byte (0x40..0x7e);
|
|
73229
|
+
* - `ss3` ESC `O` — consume exactly one more byte;
|
|
73230
|
+
* - `osc` ESC `]` — consume until BEL or ESC `\`.
|
|
73231
|
+
*/
|
|
73232
|
+
let escape = "none";
|
|
73233
|
+
for (const character of data) {
|
|
73234
|
+
const code = character.codePointAt(0) ?? 0;
|
|
73235
|
+
if (escape !== "none") {
|
|
73236
|
+
if (escape === "esc") {
|
|
73237
|
+
if (character === "[") escape = "csi";
|
|
73238
|
+
else if (character === "O") escape = "ss3";
|
|
73239
|
+
else if (character === "]") escape = "osc";
|
|
73240
|
+
else escape = "none";
|
|
73241
|
+
continue;
|
|
73242
|
+
}
|
|
73243
|
+
if (escape === "csi") {
|
|
73244
|
+
if (code >= 64 && code <= 126) escape = "none";
|
|
73245
|
+
continue;
|
|
73246
|
+
}
|
|
73247
|
+
if (escape === "ss3") {
|
|
73248
|
+
escape = "none";
|
|
73249
|
+
continue;
|
|
73250
|
+
}
|
|
73251
|
+
if (escape === "osc") {
|
|
73252
|
+
if (code === 7) escape = "none";
|
|
73253
|
+
else if (character === "\x1B") escape = "osc-esc";
|
|
73254
|
+
continue;
|
|
73255
|
+
}
|
|
73256
|
+
escape = character === "\\" ? "none" : "osc";
|
|
73257
|
+
continue;
|
|
73258
|
+
}
|
|
73259
|
+
if (character === "\r" || character === "\n") {
|
|
73260
|
+
next = "";
|
|
73261
|
+
continue;
|
|
73262
|
+
}
|
|
73263
|
+
if (character === "" || character === "\b") {
|
|
73264
|
+
next = next.slice(0, next.length - Math.min(next.length, codePointLengthAtEnd(next)));
|
|
73265
|
+
continue;
|
|
73266
|
+
}
|
|
73267
|
+
if (character === "" || character === "" || character === "") {
|
|
73268
|
+
next = "";
|
|
73269
|
+
continue;
|
|
73270
|
+
}
|
|
73271
|
+
if (character === "\x1B") {
|
|
73272
|
+
escape = "esc";
|
|
73273
|
+
continue;
|
|
73274
|
+
}
|
|
73275
|
+
if (code < 32) continue;
|
|
73276
|
+
next += character;
|
|
73277
|
+
if (next.length > 4e3) next = next.slice(next.length - TERMINAL_LINE_MAX);
|
|
73278
|
+
}
|
|
73279
|
+
return next;
|
|
73280
|
+
}
|
|
73281
|
+
/** UTF-16 length of the last code point in `value` (1 or 2). */
|
|
73282
|
+
function codePointLengthAtEnd(value) {
|
|
73283
|
+
const last = value.charCodeAt(value.length - 1);
|
|
73284
|
+
return last >= 56320 && last <= 57343 ? 2 : 1;
|
|
73285
|
+
}
|
|
73286
|
+
//#endregion
|
|
71828
73287
|
//#region src/client/XTerm.tsx
|
|
73288
|
+
/**
|
|
73289
|
+
* Send one frame; `false` means it was NOT handed to the socket.
|
|
73290
|
+
*
|
|
73291
|
+
* The caller that tracks "the PTY already knows this size" depends on that
|
|
73292
|
+
* answer (see `pushSize`): recording a size that never left is how a terminal
|
|
73293
|
+
* used to sit at the URL's 80x24 for the rest of its life.
|
|
73294
|
+
*/
|
|
71829
73295
|
function send(ws, frame) {
|
|
71830
73296
|
if (ws.readyState === WebSocket.OPEN) try {
|
|
71831
73297
|
ws.send(JSON.stringify(frame));
|
|
71832
|
-
|
|
73298
|
+
return true;
|
|
73299
|
+
} catch {
|
|
73300
|
+
return false;
|
|
73301
|
+
}
|
|
73302
|
+
return false;
|
|
71833
73303
|
}
|
|
71834
73304
|
/** Clipboard write with a legacy execCommand fallback (non-secure contexts). */
|
|
71835
73305
|
async function copyText(text) {
|
|
@@ -71860,50 +73330,6 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
71860
73330
|
return;
|
|
71861
73331
|
}
|
|
71862
73332
|
}
|
|
71863
|
-
/** Opaque high-readability palette (opaque: the contrast engine cannot reason about transparency). */
|
|
71864
|
-
function buildTheme(dark) {
|
|
71865
|
-
return dark ? {
|
|
71866
|
-
background: "#0e0e13",
|
|
71867
|
-
foreground: "#e8e8e8",
|
|
71868
|
-
cursor: "#e8e8e8",
|
|
71869
|
-
black: "#000000",
|
|
71870
|
-
red: "#cd3131",
|
|
71871
|
-
green: "#0dbc79",
|
|
71872
|
-
yellow: "#e5e910",
|
|
71873
|
-
blue: "#2472c8",
|
|
71874
|
-
magenta: "#bc3fbc",
|
|
71875
|
-
cyan: "#11a8cd",
|
|
71876
|
-
white: "#e5e5e5",
|
|
71877
|
-
brightBlack: "#7a7a7a",
|
|
71878
|
-
brightRed: "#f14c4c",
|
|
71879
|
-
brightGreen: "#23d18b",
|
|
71880
|
-
brightYellow: "#f5f543",
|
|
71881
|
-
brightBlue: "#3b8eea",
|
|
71882
|
-
brightMagenta: "#d670d6",
|
|
71883
|
-
brightCyan: "#29b8db",
|
|
71884
|
-
brightWhite: "#ffffff"
|
|
71885
|
-
} : {
|
|
71886
|
-
background: "#ffffff",
|
|
71887
|
-
foreground: "#1a1a1a",
|
|
71888
|
-
cursor: "#1a1a1a",
|
|
71889
|
-
black: "#000000",
|
|
71890
|
-
red: "#cd3131",
|
|
71891
|
-
green: "#00bc67",
|
|
71892
|
-
yellow: "#949800",
|
|
71893
|
-
blue: "#0451a5",
|
|
71894
|
-
magenta: "#bc05bc",
|
|
71895
|
-
cyan: "#0598bc",
|
|
71896
|
-
white: "#555555",
|
|
71897
|
-
brightBlack: "#666666",
|
|
71898
|
-
brightRed: "#f14c4c",
|
|
71899
|
-
brightGreen: "#23d18b",
|
|
71900
|
-
brightYellow: "#f5f543",
|
|
71901
|
-
brightBlue: "#3b8eea",
|
|
71902
|
-
brightMagenta: "#d670d6",
|
|
71903
|
-
brightCyan: "#29b8db",
|
|
71904
|
-
brightWhite: "#ffffff"
|
|
71905
|
-
};
|
|
71906
|
-
}
|
|
71907
73333
|
function XTerm(props) {
|
|
71908
73334
|
const hostRef = (0, react.useRef)(null);
|
|
71909
73335
|
const propsRef = (0, react.useRef)(props);
|
|
@@ -71926,19 +73352,99 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
71926
73352
|
fontSize: 13,
|
|
71927
73353
|
fontFamily: propsRef.current.fontFamily ?? "var(--ds-font-family-code, ui-monospace, monospace)",
|
|
71928
73354
|
minimumContrastRatio: 7,
|
|
71929
|
-
theme:
|
|
73355
|
+
theme: terminalTheme(isDarkScheme())
|
|
71930
73356
|
});
|
|
71931
73357
|
const unflip = subscribeColorScheme(() => {
|
|
71932
73358
|
try {
|
|
71933
|
-
term.options.theme =
|
|
73359
|
+
term.options.theme = terminalTheme(isDarkScheme());
|
|
71934
73360
|
} catch {}
|
|
71935
73361
|
});
|
|
71936
73362
|
const fit = new import_addon_fit.FitAddon();
|
|
71937
73363
|
term.loadAddon(fit);
|
|
71938
73364
|
term.open(host);
|
|
71939
73365
|
fit.fit();
|
|
73366
|
+
/**
|
|
73367
|
+
* The shell's working directory, when it reports it.
|
|
73368
|
+
*
|
|
73369
|
+
* OSC 7 (`ESC ] 7 ; file://host/path BEL`) is the standard, prompt-hook-driven
|
|
73370
|
+
* way shells announce `pwd`; bash/zsh print it when their profile enables it.
|
|
73371
|
+
* It is the only trustworthy anchor for a RELATIVE path printed by a command:
|
|
73372
|
+
* without it the click falls back to the workspace roots (see
|
|
73373
|
+
* `jumpToTerminalPath`). Silent when absent — nothing to report.
|
|
73374
|
+
*/
|
|
73375
|
+
let cwd;
|
|
73376
|
+
const osc7 = term.parser.registerOscHandler(7, (data) => {
|
|
73377
|
+
const match = /^file:\/\/[^/]*(\/.*)$/.exec(data);
|
|
73378
|
+
if (match?.[1] !== void 0 && match[1] !== "") try {
|
|
73379
|
+
cwd = decodeURIComponent(match[1]);
|
|
73380
|
+
} catch {
|
|
73381
|
+
cwd = match[1];
|
|
73382
|
+
}
|
|
73383
|
+
return true;
|
|
73384
|
+
});
|
|
73385
|
+
const linkRegistration = term.registerLinkProvider({ provideLinks: (lineNumber, callback) => {
|
|
73386
|
+
if (propsRef.current.onPathClick === void 0) {
|
|
73387
|
+
callback(void 0);
|
|
73388
|
+
return;
|
|
73389
|
+
}
|
|
73390
|
+
const line = term.buffer.active.getLine(lineNumber - 1);
|
|
73391
|
+
if (line === void 0) {
|
|
73392
|
+
callback(void 0);
|
|
73393
|
+
return;
|
|
73394
|
+
}
|
|
73395
|
+
const tokens = findTerminalPathTokens(line.translateToString(true));
|
|
73396
|
+
if (tokens.length === 0) {
|
|
73397
|
+
callback(void 0);
|
|
73398
|
+
return;
|
|
73399
|
+
}
|
|
73400
|
+
callback(tokens.map((token) => ({
|
|
73401
|
+
range: {
|
|
73402
|
+
start: {
|
|
73403
|
+
x: token.start + 1,
|
|
73404
|
+
y: lineNumber
|
|
73405
|
+
},
|
|
73406
|
+
end: {
|
|
73407
|
+
x: token.end + 1,
|
|
73408
|
+
y: lineNumber
|
|
73409
|
+
}
|
|
73410
|
+
},
|
|
73411
|
+
text: token.path,
|
|
73412
|
+
activate: (event, linkText) => {
|
|
73413
|
+
if (!event.ctrlKey && !event.metaKey) return;
|
|
73414
|
+
propsRef.current.onPathClick?.(linkText, {
|
|
73415
|
+
...cwd === void 0 ? {} : { cwd },
|
|
73416
|
+
...propsRef.current.home === void 0 ? {} : { home: propsRef.current.home }
|
|
73417
|
+
});
|
|
73418
|
+
}
|
|
73419
|
+
})));
|
|
73420
|
+
} });
|
|
73421
|
+
/**
|
|
73422
|
+
* The snippet panel's handle on THIS terminal: insert a command at the prompt
|
|
73423
|
+
* without pressing Enter (see `terminal-input.ts`).
|
|
73424
|
+
*
|
|
73425
|
+
* `term.paste` is the honest primitive — it goes through xterm's own bracketed
|
|
73426
|
+
* paste handling and the normal input path, so the shell sees typed text and
|
|
73427
|
+
* still decides when to run it.
|
|
73428
|
+
*/
|
|
73429
|
+
const unregisterPaste = registerTerminalPaste(propsRef.current.tabId, (text) => {
|
|
73430
|
+
try {
|
|
73431
|
+
term.paste(text);
|
|
73432
|
+
term.focus();
|
|
73433
|
+
} catch {}
|
|
73434
|
+
});
|
|
71940
73435
|
const ws = new WebSocket(propsRef.current.wsUrl);
|
|
71941
73436
|
let opened = false;
|
|
73437
|
+
/**
|
|
73438
|
+
* True once the HOST said `ready` for this socket.
|
|
73439
|
+
*
|
|
73440
|
+
* Frames sent before that are lost, not queued: the host only attaches its
|
|
73441
|
+
* message listener after the shell exists (a cold dial takes seconds), so a
|
|
73442
|
+
* `resize` sent on the WebSocket `open` event never reached the PTY — and
|
|
73443
|
+
* because the client had already recorded the size, the later push (once the
|
|
73444
|
+
* host was listening) was deduped away. The shell then stayed at the URL's
|
|
73445
|
+
* 80x24 for its whole life. Sizes are only sent after `ready`.
|
|
73446
|
+
*/
|
|
73447
|
+
let hostReady = false;
|
|
71942
73448
|
/** The seeded line is typed at most once per mount (a reconnect re-mounts). */
|
|
71943
73449
|
let seeded = false;
|
|
71944
73450
|
let exitReported = false;
|
|
@@ -71947,16 +73453,30 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
71947
73453
|
exitReported = true;
|
|
71948
73454
|
propsRef.current.onExit(code, message);
|
|
71949
73455
|
};
|
|
73456
|
+
/**
|
|
73457
|
+
* Size last pushed to the PTY (`0` = nothing sent yet, so the first push
|
|
73458
|
+
* always goes). Declared BEFORE `pushSize` reads it: a `let` declared below
|
|
73459
|
+
* would be in its temporal dead zone on the first call.
|
|
73460
|
+
*/
|
|
73461
|
+
let lastSize = {
|
|
73462
|
+
cols: 0,
|
|
73463
|
+
rows: 0
|
|
73464
|
+
};
|
|
71950
73465
|
const pushSize = () => {
|
|
71951
73466
|
if (host.clientWidth < 20 || host.clientHeight < 20) return;
|
|
71952
73467
|
try {
|
|
71953
73468
|
fit.fit();
|
|
71954
73469
|
} catch {}
|
|
71955
|
-
|
|
73470
|
+
if (!hostReady) return;
|
|
73471
|
+
if (term.cols === lastSize.cols && term.rows === lastSize.rows) return;
|
|
73472
|
+
if (send(ws, {
|
|
71956
73473
|
t: "resize",
|
|
71957
73474
|
cols: term.cols,
|
|
71958
73475
|
rows: term.rows
|
|
71959
|
-
})
|
|
73476
|
+
})) lastSize = {
|
|
73477
|
+
cols: term.cols,
|
|
73478
|
+
rows: term.rows
|
|
73479
|
+
};
|
|
71960
73480
|
};
|
|
71961
73481
|
liveRef.current = { refit: () => {
|
|
71962
73482
|
pushSize();
|
|
@@ -71973,9 +73493,20 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
71973
73493
|
* characters — far under that cap either way, and far above a keystroke.
|
|
71974
73494
|
*/
|
|
71975
73495
|
const INPUT_CHUNK_CHARS = 64 * 1024;
|
|
73496
|
+
/**
|
|
73497
|
+
* Best-effort reconstruction of the line the user is typing, for Ctrl+B.
|
|
73498
|
+
*
|
|
73499
|
+
* Fed from the SAME `onData` stream that goes to the PTY (see
|
|
73500
|
+
* `vsc/terminal-line.ts`): printable text appends, backspace removes,
|
|
73501
|
+
* Enter/Ctrl+C/Ctrl+U clear, escape sequences are ignored. Used only to
|
|
73502
|
+
* pre-fill the snippet form, so an inexact line (history recall, cursor
|
|
73503
|
+
* movement) costs nothing.
|
|
73504
|
+
*/
|
|
73505
|
+
let inputLine = "";
|
|
71976
73506
|
const sendInput = (rawData) => {
|
|
71977
73507
|
const data = stripBracketedPasteMarkers(rawData);
|
|
71978
73508
|
if (data === "") return;
|
|
73509
|
+
inputLine = applyTerminalInput(inputLine, data);
|
|
71979
73510
|
if (data.length <= INPUT_CHUNK_CHARS) {
|
|
71980
73511
|
send(ws, {
|
|
71981
73512
|
t: "in",
|
|
@@ -72000,6 +73531,22 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
72000
73531
|
});
|
|
72001
73532
|
};
|
|
72002
73533
|
term.onData(sendInput);
|
|
73534
|
+
/**
|
|
73535
|
+
* Output writer (see `vsc/terminal-writer.ts` for the full reasoning).
|
|
73536
|
+
*
|
|
73537
|
+
* Frames are appended to ONE ordered buffer and handed to xterm on a timer,
|
|
73538
|
+
* instead of one `term.write` per frame — and, importantly, NOT chained on
|
|
73539
|
+
* the xterm write callback. That callback waits for parse+render, which a
|
|
73540
|
+
* throttled/occluded window can delay indefinitely; the echo of what the user
|
|
73541
|
+
* types then sat in this queue with no echo on screen until the callback
|
|
73542
|
+
* finally fired. Nothing here waits for a write to finish.
|
|
73543
|
+
*/
|
|
73544
|
+
const writer = createTerminalWriter({ write: (text) => {
|
|
73545
|
+
term.write(text);
|
|
73546
|
+
} });
|
|
73547
|
+
const writeOut = (text) => {
|
|
73548
|
+
writer.push(text);
|
|
73549
|
+
};
|
|
72003
73550
|
ws.addEventListener("open", () => {
|
|
72004
73551
|
opened = true;
|
|
72005
73552
|
pushSize();
|
|
@@ -72012,6 +73559,8 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
72012
73559
|
return;
|
|
72013
73560
|
}
|
|
72014
73561
|
if (frame.t === "ready") {
|
|
73562
|
+
hostReady = true;
|
|
73563
|
+
pushSize();
|
|
72015
73564
|
propsRef.current.onReady(frame.id);
|
|
72016
73565
|
const seed = propsRef.current.initialInput;
|
|
72017
73566
|
if (!seeded && seed !== void 0 && seed !== "") {
|
|
@@ -72021,14 +73570,14 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
72021
73570
|
d: `${seed}\n`
|
|
72022
73571
|
});
|
|
72023
73572
|
}
|
|
72024
|
-
} else if (frame.t === "out")
|
|
73573
|
+
} else if (frame.t === "out") writeOut(frame.d);
|
|
72025
73574
|
else if (frame.t === "exit") {
|
|
72026
73575
|
reportExit(frame.code);
|
|
72027
73576
|
try {
|
|
72028
73577
|
ws.close();
|
|
72029
73578
|
} catch {}
|
|
72030
73579
|
} else if (frame.t === "error") {
|
|
72031
|
-
|
|
73580
|
+
writeOut(`\r\n[dsh-remote] ${frame.message}\r\n`);
|
|
72032
73581
|
reportExit(null, frame.message);
|
|
72033
73582
|
}
|
|
72034
73583
|
});
|
|
@@ -72100,14 +73649,34 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
72100
73649
|
};
|
|
72101
73650
|
host.addEventListener("paste", onPasteEvent, true);
|
|
72102
73651
|
term.attachCustomKeyEventHandler((e) => {
|
|
72103
|
-
const chord =
|
|
73652
|
+
const chord = terminalKeyCommand({
|
|
73653
|
+
type: e.type,
|
|
72104
73654
|
key: e.key,
|
|
72105
73655
|
ctrl: e.ctrlKey,
|
|
72106
73656
|
shift: e.shiftKey,
|
|
72107
73657
|
alt: e.altKey,
|
|
72108
73658
|
meta: e.metaKey
|
|
72109
73659
|
});
|
|
72110
|
-
if (chord === void 0)
|
|
73660
|
+
if (chord === void 0) {
|
|
73661
|
+
/**
|
|
73662
|
+
* Ctrl/Cmd+B opens "add snippet".
|
|
73663
|
+
*
|
|
73664
|
+
* Note the trade-off: in a plain readline, ^B is backward-char. The
|
|
73665
|
+
* shortcut is a user requirement, and it is only claimed while the panel
|
|
73666
|
+
* is wired (`onQuickAddSnippet` present) — the terminal's own Ctrl+F etc.
|
|
73667
|
+
* stay untouched because they go through xterm's keymap, not here.
|
|
73668
|
+
*/
|
|
73669
|
+
if (e.type === "keydown" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey && (e.key === "b" || e.key === "B") && propsRef.current.onQuickAddSnippet !== void 0) {
|
|
73670
|
+
e.preventDefault();
|
|
73671
|
+
const selection = term.getSelection();
|
|
73672
|
+
propsRef.current.onQuickAddSnippet({
|
|
73673
|
+
...selection !== "" ? { selection } : {},
|
|
73674
|
+
...inputLine !== "" ? { line: inputLine } : {}
|
|
73675
|
+
});
|
|
73676
|
+
return false;
|
|
73677
|
+
}
|
|
73678
|
+
return true;
|
|
73679
|
+
}
|
|
72111
73680
|
if (chord === "copy-interrupt") {
|
|
72112
73681
|
if (!term.hasSelection()) return true;
|
|
72113
73682
|
e.preventDefault();
|
|
@@ -72164,6 +73733,9 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
72164
73733
|
return () => {
|
|
72165
73734
|
liveRef.current = void 0;
|
|
72166
73735
|
unflip();
|
|
73736
|
+
unregisterPaste();
|
|
73737
|
+
linkRegistration.dispose();
|
|
73738
|
+
osc7.dispose();
|
|
72167
73739
|
window.clearTimeout(timer);
|
|
72168
73740
|
window.removeEventListener("resize", onWindowResize);
|
|
72169
73741
|
host.removeEventListener("paste", onPasteEvent, true);
|
|
@@ -72189,6 +73761,552 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
72189
73761
|
})] });
|
|
72190
73762
|
}
|
|
72191
73763
|
//#endregion
|
|
73764
|
+
//#region src/client/terminal-snippets.ts
|
|
73765
|
+
/** localStorage key (one JSON array, so the list cannot half-update). */
|
|
73766
|
+
const SNIPPETS_KEY = "dsh-remote-vs.term.snippets";
|
|
73767
|
+
const SNIPPET_COMMAND_MAX = 4e3;
|
|
73768
|
+
/** A fresh identity for one snippet. */
|
|
73769
|
+
function createSnippetId() {
|
|
73770
|
+
return `s${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`;
|
|
73771
|
+
}
|
|
73772
|
+
/**
|
|
73773
|
+
* Normalize one user-entered snippet; `undefined` when it is unusable.
|
|
73774
|
+
*
|
|
73775
|
+
* Both fields are required (an unnamed command is unfindable, an empty command
|
|
73776
|
+
* does nothing) and both are trimmed — a leading/trailing newline in a pasted
|
|
73777
|
+
* command would otherwise send an empty line and RUN the command, which is
|
|
73778
|
+
* exactly what this feature promises not to do.
|
|
73779
|
+
*/
|
|
73780
|
+
function sanitizeSnippetInput(input) {
|
|
73781
|
+
const name = (input.name ?? "").trim().slice(0, 80);
|
|
73782
|
+
const command = (input.command ?? "").trim().slice(0, SNIPPET_COMMAND_MAX);
|
|
73783
|
+
if (name === "" || command === "") return void 0;
|
|
73784
|
+
return {
|
|
73785
|
+
name,
|
|
73786
|
+
command
|
|
73787
|
+
};
|
|
73788
|
+
}
|
|
73789
|
+
/** Parse the persisted JSON; anything malformed is dropped, never repaired silently. */
|
|
73790
|
+
function parseSnippets(raw) {
|
|
73791
|
+
if (typeof raw !== "string" || raw === "") return [];
|
|
73792
|
+
let parsed;
|
|
73793
|
+
try {
|
|
73794
|
+
parsed = JSON.parse(raw);
|
|
73795
|
+
} catch {
|
|
73796
|
+
return [];
|
|
73797
|
+
}
|
|
73798
|
+
if (!Array.isArray(parsed)) return [];
|
|
73799
|
+
const list = [];
|
|
73800
|
+
const seen = /* @__PURE__ */ new Set();
|
|
73801
|
+
for (const item of parsed) {
|
|
73802
|
+
if (typeof item !== "object" || item === null) continue;
|
|
73803
|
+
const record = item;
|
|
73804
|
+
const sanitized = sanitizeSnippetInput({
|
|
73805
|
+
name: typeof record.name === "string" ? record.name : "",
|
|
73806
|
+
command: typeof record.command === "string" ? record.command : ""
|
|
73807
|
+
});
|
|
73808
|
+
if (sanitized === void 0) continue;
|
|
73809
|
+
let id = typeof record.id === "string" && record.id !== "" ? record.id : createSnippetId();
|
|
73810
|
+
if (seen.has(id)) id = createSnippetId();
|
|
73811
|
+
seen.add(id);
|
|
73812
|
+
list.push({
|
|
73813
|
+
id,
|
|
73814
|
+
...sanitized
|
|
73815
|
+
});
|
|
73816
|
+
if (list.length >= 200) break;
|
|
73817
|
+
}
|
|
73818
|
+
return list;
|
|
73819
|
+
}
|
|
73820
|
+
/** Serialize only the known fields. */
|
|
73821
|
+
function serializeSnippets(list) {
|
|
73822
|
+
return JSON.stringify(list.map((item) => ({
|
|
73823
|
+
id: item.id,
|
|
73824
|
+
name: item.name,
|
|
73825
|
+
command: item.command
|
|
73826
|
+
})));
|
|
73827
|
+
}
|
|
73828
|
+
/** Append one snippet (newest last); returns the SAME array when it is invalid. */
|
|
73829
|
+
function addSnippet(list, input, id = createSnippetId()) {
|
|
73830
|
+
const sanitized = sanitizeSnippetInput(input);
|
|
73831
|
+
if (sanitized === void 0) return list;
|
|
73832
|
+
if (list.some((item) => item.id === id)) id = createSnippetId();
|
|
73833
|
+
const next = [...list, {
|
|
73834
|
+
id,
|
|
73835
|
+
...sanitized
|
|
73836
|
+
}];
|
|
73837
|
+
return next.length > 200 ? next.slice(next.length - 200) : next;
|
|
73838
|
+
}
|
|
73839
|
+
/** Replace one snippet's fields; an invalid edit leaves the list untouched. */
|
|
73840
|
+
function updateSnippet(list, id, input) {
|
|
73841
|
+
const index = list.findIndex((item) => item.id === id);
|
|
73842
|
+
if (index < 0) return list;
|
|
73843
|
+
const sanitized = sanitizeSnippetInput(input);
|
|
73844
|
+
if (sanitized === void 0) return list;
|
|
73845
|
+
const current = list[index];
|
|
73846
|
+
if (current.name === sanitized.name && current.command === sanitized.command) return list;
|
|
73847
|
+
const next = [...list];
|
|
73848
|
+
next[index] = {
|
|
73849
|
+
id,
|
|
73850
|
+
...sanitized
|
|
73851
|
+
};
|
|
73852
|
+
return next;
|
|
73853
|
+
}
|
|
73854
|
+
/** Drop one snippet. */
|
|
73855
|
+
function removeSnippet(list, id) {
|
|
73856
|
+
const next = list.filter((item) => item.id !== id);
|
|
73857
|
+
return next.length === list.length ? list : next;
|
|
73858
|
+
}
|
|
73859
|
+
/**
|
|
73860
|
+
* Move one snippet to another index (drag & drop), clamping both ends.
|
|
73861
|
+
*
|
|
73862
|
+
* Returning the SAME list for a no-op keeps the store's "did it change" test
|
|
73863
|
+
* cheap and stops a drag that lands on its own row from re-rendering everything.
|
|
73864
|
+
*/
|
|
73865
|
+
function moveSnippet(list, from, to) {
|
|
73866
|
+
if (list.length < 2) return list;
|
|
73867
|
+
const source = Math.max(0, Math.min(list.length - 1, from));
|
|
73868
|
+
const target = Math.max(0, Math.min(list.length - 1, to));
|
|
73869
|
+
if (source === target) return list;
|
|
73870
|
+
const next = [...list];
|
|
73871
|
+
const [moved] = next.splice(source, 1);
|
|
73872
|
+
if (moved === void 0) return list;
|
|
73873
|
+
next.splice(target, 0, moved);
|
|
73874
|
+
return next;
|
|
73875
|
+
}
|
|
73876
|
+
const listeners$1 = /* @__PURE__ */ new Set();
|
|
73877
|
+
/** Lazy current list; undefined = localStorage not read yet. */
|
|
73878
|
+
let current;
|
|
73879
|
+
function readFromStorage() {
|
|
73880
|
+
try {
|
|
73881
|
+
return parseSnippets(localStorage.getItem(SNIPPETS_KEY));
|
|
73882
|
+
} catch {
|
|
73883
|
+
return [];
|
|
73884
|
+
}
|
|
73885
|
+
}
|
|
73886
|
+
function persist(list) {
|
|
73887
|
+
try {
|
|
73888
|
+
localStorage.setItem(SNIPPETS_KEY, serializeSnippets(list));
|
|
73889
|
+
} catch {}
|
|
73890
|
+
}
|
|
73891
|
+
function emit() {
|
|
73892
|
+
for (const listener of [...listeners$1]) try {
|
|
73893
|
+
listener();
|
|
73894
|
+
} catch {}
|
|
73895
|
+
}
|
|
73896
|
+
/** Current list (identity-stable while unchanged, safe for useSyncExternalStore). */
|
|
73897
|
+
function snippetsSnapshot() {
|
|
73898
|
+
if (current === void 0) current = readFromStorage();
|
|
73899
|
+
return current;
|
|
73900
|
+
}
|
|
73901
|
+
/** Subscribe to snippet changes; returns the unsubscribe. */
|
|
73902
|
+
function subscribeSnippets(listener) {
|
|
73903
|
+
listeners$1.add(listener);
|
|
73904
|
+
return () => {
|
|
73905
|
+
listeners$1.delete(listener);
|
|
73906
|
+
};
|
|
73907
|
+
}
|
|
73908
|
+
/**
|
|
73909
|
+
* Apply one pure transition and persist it when it really changed.
|
|
73910
|
+
*
|
|
73911
|
+
* The updater must be pure and return either the same array (no change → no
|
|
73912
|
+
* notification, no write) or a new one; every CRUD helper above already does.
|
|
73913
|
+
*/
|
|
73914
|
+
function updateSnippets(updater) {
|
|
73915
|
+
const before = snippetsSnapshot();
|
|
73916
|
+
const next = updater(before);
|
|
73917
|
+
if (next === before) return;
|
|
73918
|
+
current = next;
|
|
73919
|
+
persist(next);
|
|
73920
|
+
emit();
|
|
73921
|
+
}
|
|
73922
|
+
//#endregion
|
|
73923
|
+
//#region src/client/TerminalSnippets.tsx
|
|
73924
|
+
/**
|
|
73925
|
+
* The "常用指令" panel above the terminal: a personal library of NAME + COMMAND
|
|
73926
|
+
* pairs that paste into the active terminal's command line WITHOUT pressing
|
|
73927
|
+
* Enter (misclick safety: the user still reviews and runs it).
|
|
73928
|
+
*
|
|
73929
|
+
* Why it is a popover rather than a dock: the terminal needs the whole column
|
|
73930
|
+
* for output; the list is opened deliberately, used once, and dismissed. The
|
|
73931
|
+
* panel is portaled with fixed coordinates so the terminal's own scroller and
|
|
73932
|
+
* the sidebar's `overflow: hidden` cannot clip it.
|
|
73933
|
+
*
|
|
73934
|
+
* Snapshot + subscribe come from `terminal-snippets.ts` (one list shared with the
|
|
73935
|
+
* Ctrl+B quick-add shortcut, which `XTerm` reports as a counter prop).
|
|
73936
|
+
*/
|
|
73937
|
+
/**
|
|
73938
|
+
* The panel.
|
|
73939
|
+
*
|
|
73940
|
+
* Kept in one component on purpose: the button, the popover, the form and their
|
|
73941
|
+
* shared focus/dismissal rules are one interaction, and splitting them would
|
|
73942
|
+
* need a context for four pieces of state.
|
|
73943
|
+
*/
|
|
73944
|
+
function TerminalSnippets(props) {
|
|
73945
|
+
const t = props.t;
|
|
73946
|
+
const items = (0, react.useSyncExternalStore)(subscribeSnippets, snippetsSnapshot, snippetsSnapshot);
|
|
73947
|
+
const [anchor, setAnchor] = (0, react.useState)(void 0);
|
|
73948
|
+
const [form, setForm] = (0, react.useState)(void 0);
|
|
73949
|
+
const [drag, setDrag] = (0, react.useState)(void 0);
|
|
73950
|
+
const [dropIndex, setDropIndex] = (0, react.useState)(void 0);
|
|
73951
|
+
const buttonRef = (0, react.useRef)(null);
|
|
73952
|
+
const panelRef = (0, react.useRef)(null);
|
|
73953
|
+
/** Latest `addRequest` already handled (the prop is a counter, not an event). */
|
|
73954
|
+
const handledAdd = (0, react.useRef)(props.addRequest);
|
|
73955
|
+
/** Open the panel under the button. */
|
|
73956
|
+
const openPanel = (0, react.useCallback)(() => {
|
|
73957
|
+
const rect = buttonRef.current?.getBoundingClientRect();
|
|
73958
|
+
if (rect === void 0 || rect === null) return;
|
|
73959
|
+
setAnchor({
|
|
73960
|
+
left: Math.max(4, rect.left),
|
|
73961
|
+
top: rect.bottom + 4,
|
|
73962
|
+
width: 300
|
|
73963
|
+
});
|
|
73964
|
+
}, []);
|
|
73965
|
+
const closePanel = (0, react.useCallback)(() => {
|
|
73966
|
+
setAnchor(void 0);
|
|
73967
|
+
setDrag(void 0);
|
|
73968
|
+
setDropIndex(void 0);
|
|
73969
|
+
}, []);
|
|
73970
|
+
(0, react.useEffect)(() => {
|
|
73971
|
+
if (props.addRequest === handledAdd.current) return;
|
|
73972
|
+
handledAdd.current = props.addRequest;
|
|
73973
|
+
openPanel();
|
|
73974
|
+
setForm({
|
|
73975
|
+
mode: "add",
|
|
73976
|
+
content: props.addContent
|
|
73977
|
+
});
|
|
73978
|
+
}, [
|
|
73979
|
+
props.addRequest,
|
|
73980
|
+
props.addContent,
|
|
73981
|
+
openPanel
|
|
73982
|
+
]);
|
|
73983
|
+
(0, react.useEffect)(() => {
|
|
73984
|
+
if (anchor === void 0) return;
|
|
73985
|
+
const onMouseDown = (event) => {
|
|
73986
|
+
const target = event.target;
|
|
73987
|
+
if (!(target instanceof Node)) return;
|
|
73988
|
+
if (panelRef.current?.contains(target) === true) return;
|
|
73989
|
+
if (buttonRef.current?.contains(target) === true) return;
|
|
73990
|
+
closePanel();
|
|
73991
|
+
};
|
|
73992
|
+
const onKeyDown = (event) => {
|
|
73993
|
+
if (event.isComposing) return;
|
|
73994
|
+
if (event.key === "Escape" && form === void 0) closePanel();
|
|
73995
|
+
};
|
|
73996
|
+
const onResize = () => closePanel();
|
|
73997
|
+
document.addEventListener("mousedown", onMouseDown, true);
|
|
73998
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
73999
|
+
window.addEventListener("resize", onResize);
|
|
74000
|
+
return () => {
|
|
74001
|
+
document.removeEventListener("mousedown", onMouseDown, true);
|
|
74002
|
+
document.removeEventListener("keydown", onKeyDown, true);
|
|
74003
|
+
window.removeEventListener("resize", onResize);
|
|
74004
|
+
};
|
|
74005
|
+
}, [
|
|
74006
|
+
anchor,
|
|
74007
|
+
form,
|
|
74008
|
+
closePanel
|
|
74009
|
+
]);
|
|
74010
|
+
/** Paste one command and get out of the way. */
|
|
74011
|
+
const insert = (snippet) => {
|
|
74012
|
+
if (!props.onInsert(snippet.command)) {
|
|
74013
|
+
window.setTimeout(() => {
|
|
74014
|
+
setForm(void 0);
|
|
74015
|
+
}, 0);
|
|
74016
|
+
return;
|
|
74017
|
+
}
|
|
74018
|
+
closePanel();
|
|
74019
|
+
};
|
|
74020
|
+
const requestDelete = (snippet) => {
|
|
74021
|
+
confirmDialog({
|
|
74022
|
+
title: t("term.snippetDeleteTitle"),
|
|
74023
|
+
text: snippet.name,
|
|
74024
|
+
danger: true,
|
|
74025
|
+
okText: t("term.snippetDelete")
|
|
74026
|
+
}).then((ok) => {
|
|
74027
|
+
if (ok) updateSnippets((list) => removeSnippet(list, snippet.id));
|
|
74028
|
+
});
|
|
74029
|
+
};
|
|
74030
|
+
/** Move one row by keyboard (Alt+Arrow) — the accessible twin of dragging. */
|
|
74031
|
+
const moveBy = (index, direction) => {
|
|
74032
|
+
updateSnippets((list) => moveSnippet(list, index, index + direction));
|
|
74033
|
+
};
|
|
74034
|
+
const panel = anchor === void 0 ? void 0 : (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
74035
|
+
ref: panelRef,
|
|
74036
|
+
className: "rvs-portal rvs-snips-panel",
|
|
74037
|
+
role: "dialog",
|
|
74038
|
+
"aria-label": t("term.snippets"),
|
|
74039
|
+
style: {
|
|
74040
|
+
left: `${anchor.left}px`,
|
|
74041
|
+
top: `${anchor.top}px`,
|
|
74042
|
+
width: `${anchor.width}px`
|
|
74043
|
+
},
|
|
74044
|
+
children: [
|
|
74045
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
74046
|
+
className: "rvs-snips-head",
|
|
74047
|
+
children: [
|
|
74048
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
74049
|
+
className: "rvs-snips-title",
|
|
74050
|
+
children: ["⚡ ", t("term.snippets")]
|
|
74051
|
+
}),
|
|
74052
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "rvs-snips-spacer" }),
|
|
74053
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
74054
|
+
type: "button",
|
|
74055
|
+
className: "rvs-snips-add",
|
|
74056
|
+
title: t("term.snippetAdd"),
|
|
74057
|
+
"aria-label": t("term.snippetAdd"),
|
|
74058
|
+
onClick: () => setForm({
|
|
74059
|
+
mode: "add",
|
|
74060
|
+
content: ""
|
|
74061
|
+
}),
|
|
74062
|
+
children: "+"
|
|
74063
|
+
})
|
|
74064
|
+
]
|
|
74065
|
+
}),
|
|
74066
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
74067
|
+
className: "rvs-snips-list",
|
|
74068
|
+
children: [items.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
74069
|
+
className: "rvs-snips-empty",
|
|
74070
|
+
children: t("term.snippetEmpty")
|
|
74071
|
+
}), items.map((snippet, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
74072
|
+
className: `rvs-snips-row${dropIndex === index && drag !== void 0 ? " drop" : ""}`,
|
|
74073
|
+
draggable: true,
|
|
74074
|
+
onDragStart: (event) => {
|
|
74075
|
+
setDrag({ from: index });
|
|
74076
|
+
event.dataTransfer.effectAllowed = "move";
|
|
74077
|
+
event.dataTransfer.setData("text/plain", String(index));
|
|
74078
|
+
},
|
|
74079
|
+
onDragOver: (event) => {
|
|
74080
|
+
if (drag === void 0) return;
|
|
74081
|
+
event.preventDefault();
|
|
74082
|
+
event.dataTransfer.dropEffect = "move";
|
|
74083
|
+
setDropIndex(index);
|
|
74084
|
+
},
|
|
74085
|
+
onDrop: (event) => {
|
|
74086
|
+
event.preventDefault();
|
|
74087
|
+
const from = Number(event.dataTransfer.getData("text/plain"));
|
|
74088
|
+
setDrag(void 0);
|
|
74089
|
+
setDropIndex(void 0);
|
|
74090
|
+
if (Number.isFinite(from)) updateSnippets((list) => moveSnippet(list, from, index));
|
|
74091
|
+
},
|
|
74092
|
+
onDragEnd: () => {
|
|
74093
|
+
setDrag(void 0);
|
|
74094
|
+
setDropIndex(void 0);
|
|
74095
|
+
},
|
|
74096
|
+
children: [
|
|
74097
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
74098
|
+
className: "rvs-snips-grip",
|
|
74099
|
+
title: t("term.snippetDragHint"),
|
|
74100
|
+
role: "button",
|
|
74101
|
+
"aria-label": t("term.snippetDragHint"),
|
|
74102
|
+
tabIndex: 0,
|
|
74103
|
+
onKeyDown: (event) => {
|
|
74104
|
+
if (event.altKey && event.key === "ArrowUp") {
|
|
74105
|
+
event.preventDefault();
|
|
74106
|
+
moveBy(index, -1);
|
|
74107
|
+
}
|
|
74108
|
+
if (event.altKey && event.key === "ArrowDown") {
|
|
74109
|
+
event.preventDefault();
|
|
74110
|
+
moveBy(index, 1);
|
|
74111
|
+
}
|
|
74112
|
+
},
|
|
74113
|
+
children: "⠿"
|
|
74114
|
+
}),
|
|
74115
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
74116
|
+
type: "button",
|
|
74117
|
+
className: "rvs-snips-insert",
|
|
74118
|
+
title: `${t("term.snippetInsertHint")}\n${snippet.command}`,
|
|
74119
|
+
onClick: () => insert(snippet),
|
|
74120
|
+
children: [
|
|
74121
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
74122
|
+
className: "rvs-snips-name",
|
|
74123
|
+
children: snippet.name
|
|
74124
|
+
}),
|
|
74125
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
74126
|
+
className: "rvs-snips-arrow",
|
|
74127
|
+
"aria-hidden": "true",
|
|
74128
|
+
children: "-->"
|
|
74129
|
+
}),
|
|
74130
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
74131
|
+
className: "rvs-snips-text",
|
|
74132
|
+
children: snippet.command
|
|
74133
|
+
})
|
|
74134
|
+
]
|
|
74135
|
+
}),
|
|
74136
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
74137
|
+
type: "button",
|
|
74138
|
+
className: "rvs-snips-icon",
|
|
74139
|
+
title: t("term.snippetEdit"),
|
|
74140
|
+
"aria-label": t("term.snippetEdit"),
|
|
74141
|
+
onClick: () => setForm({
|
|
74142
|
+
mode: "edit",
|
|
74143
|
+
snippet
|
|
74144
|
+
}),
|
|
74145
|
+
children: "✎"
|
|
74146
|
+
}),
|
|
74147
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
74148
|
+
type: "button",
|
|
74149
|
+
className: "rvs-snips-icon danger",
|
|
74150
|
+
title: t("term.snippetDelete"),
|
|
74151
|
+
"aria-label": t("term.snippetDelete"),
|
|
74152
|
+
onClick: () => requestDelete(snippet),
|
|
74153
|
+
children: "×"
|
|
74154
|
+
})
|
|
74155
|
+
]
|
|
74156
|
+
}, snippet.id))]
|
|
74157
|
+
}),
|
|
74158
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
74159
|
+
className: "rvs-snips-foot",
|
|
74160
|
+
children: t("term.snippetFootHint")
|
|
74161
|
+
})
|
|
74162
|
+
]
|
|
74163
|
+
}), document.body);
|
|
74164
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
74165
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
74166
|
+
ref: buttonRef,
|
|
74167
|
+
type: "button",
|
|
74168
|
+
className: "rvs-hbtn rvs-snips-btn",
|
|
74169
|
+
title: t("term.snippets"),
|
|
74170
|
+
"aria-label": t("term.snippets"),
|
|
74171
|
+
onClick: () => {
|
|
74172
|
+
if (anchor === void 0) openPanel();
|
|
74173
|
+
else closePanel();
|
|
74174
|
+
},
|
|
74175
|
+
children: [
|
|
74176
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
74177
|
+
"aria-hidden": "true",
|
|
74178
|
+
children: "⚡"
|
|
74179
|
+
}),
|
|
74180
|
+
" ",
|
|
74181
|
+
t("term.snippets")
|
|
74182
|
+
]
|
|
74183
|
+
}),
|
|
74184
|
+
panel,
|
|
74185
|
+
form !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SnippetForm, {
|
|
74186
|
+
t,
|
|
74187
|
+
mode: form.mode,
|
|
74188
|
+
...form.mode === "edit" ? { snippet: form.snippet } : { initialCommand: form.content },
|
|
74189
|
+
onCancel: () => setForm(void 0),
|
|
74190
|
+
onSubmit: (input) => {
|
|
74191
|
+
if (form.mode === "add") updateSnippets((list) => addSnippet(list, input));
|
|
74192
|
+
else updateSnippets((list) => updateSnippet(list, form.snippet.id, input));
|
|
74193
|
+
setForm(void 0);
|
|
74194
|
+
closePanel();
|
|
74195
|
+
}
|
|
74196
|
+
})
|
|
74197
|
+
] });
|
|
74198
|
+
}
|
|
74199
|
+
/** The add / edit form (name + command), portaled like the shared dialogs. */
|
|
74200
|
+
function SnippetForm(props) {
|
|
74201
|
+
const t = props.t;
|
|
74202
|
+
const [name, setName] = (0, react.useState)(props.snippet?.name ?? "");
|
|
74203
|
+
const [command, setCommand] = (0, react.useState)(props.snippet?.command ?? props.initialCommand ?? "");
|
|
74204
|
+
const [error, setError] = (0, react.useState)(void 0);
|
|
74205
|
+
const nameRef = (0, react.useRef)(null);
|
|
74206
|
+
const openerRef = (0, react.useRef)(document.activeElement);
|
|
74207
|
+
(0, react.useEffect)(() => {
|
|
74208
|
+
nameRef.current?.focus();
|
|
74209
|
+
nameRef.current?.select();
|
|
74210
|
+
return () => {
|
|
74211
|
+
const opener = openerRef.current;
|
|
74212
|
+
if (opener !== null && document.body.contains(opener)) opener.focus();
|
|
74213
|
+
};
|
|
74214
|
+
}, []);
|
|
74215
|
+
(0, react.useEffect)(() => {
|
|
74216
|
+
const onKey = (event) => {
|
|
74217
|
+
if (event.isComposing) return;
|
|
74218
|
+
if (event.key === "Escape") {
|
|
74219
|
+
event.preventDefault();
|
|
74220
|
+
props.onCancel();
|
|
74221
|
+
}
|
|
74222
|
+
};
|
|
74223
|
+
document.addEventListener("keydown", onKey, true);
|
|
74224
|
+
return () => document.removeEventListener("keydown", onKey, true);
|
|
74225
|
+
}, [props]);
|
|
74226
|
+
const submit = () => {
|
|
74227
|
+
if (name.trim() === "") {
|
|
74228
|
+
setError(t("term.snippetNameRequired"));
|
|
74229
|
+
return;
|
|
74230
|
+
}
|
|
74231
|
+
if (command.trim() === "") {
|
|
74232
|
+
setError(t("term.snippetCommandRequired"));
|
|
74233
|
+
return;
|
|
74234
|
+
}
|
|
74235
|
+
props.onSubmit({
|
|
74236
|
+
name,
|
|
74237
|
+
command
|
|
74238
|
+
});
|
|
74239
|
+
};
|
|
74240
|
+
return (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
74241
|
+
className: "rvs-portal rvs-modal-mask",
|
|
74242
|
+
onMouseDown: (event) => {
|
|
74243
|
+
if (event.target === event.currentTarget) props.onCancel();
|
|
74244
|
+
},
|
|
74245
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
74246
|
+
className: "rvs-modal-box",
|
|
74247
|
+
role: "dialog",
|
|
74248
|
+
"aria-modal": "true",
|
|
74249
|
+
"aria-label": props.mode === "add" ? t("term.snippetAdd") : t("term.snippetEdit"),
|
|
74250
|
+
children: [
|
|
74251
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
74252
|
+
className: "rvs-modal-title",
|
|
74253
|
+
children: props.mode === "add" ? t("term.snippetAdd") : t("term.snippetEdit")
|
|
74254
|
+
}),
|
|
74255
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
74256
|
+
className: "rvs-snips-field",
|
|
74257
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("term.snippetName") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
74258
|
+
ref: nameRef,
|
|
74259
|
+
value: name,
|
|
74260
|
+
placeholder: t("term.snippetNamePlaceholder"),
|
|
74261
|
+
onChange: (event) => {
|
|
74262
|
+
setName(event.target.value);
|
|
74263
|
+
setError(void 0);
|
|
74264
|
+
},
|
|
74265
|
+
onKeyDown: (event) => {
|
|
74266
|
+
if (event.key === "Enter" && !event.nativeEvent.isComposing) {
|
|
74267
|
+
event.preventDefault();
|
|
74268
|
+
submit();
|
|
74269
|
+
}
|
|
74270
|
+
}
|
|
74271
|
+
})]
|
|
74272
|
+
}),
|
|
74273
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
74274
|
+
className: "rvs-snips-field",
|
|
74275
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("term.snippetCommand") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
74276
|
+
className: "rvs-snips-command",
|
|
74277
|
+
value: command,
|
|
74278
|
+
placeholder: t("term.snippetCommandPlaceholder"),
|
|
74279
|
+
rows: 4,
|
|
74280
|
+
onChange: (event) => {
|
|
74281
|
+
setCommand(event.target.value);
|
|
74282
|
+
setError(void 0);
|
|
74283
|
+
}
|
|
74284
|
+
})]
|
|
74285
|
+
}),
|
|
74286
|
+
error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
74287
|
+
className: "rvs-snips-error",
|
|
74288
|
+
role: "alert",
|
|
74289
|
+
children: error
|
|
74290
|
+
}),
|
|
74291
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
74292
|
+
className: "rvs-modal-row",
|
|
74293
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
74294
|
+
type: "button",
|
|
74295
|
+
className: "rvs-modal-btn",
|
|
74296
|
+
onClick: props.onCancel,
|
|
74297
|
+
children: t("common.cancel")
|
|
74298
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
74299
|
+
type: "button",
|
|
74300
|
+
className: "rvs-modal-btn primary",
|
|
74301
|
+
onClick: submit,
|
|
74302
|
+
children: t("common.save")
|
|
74303
|
+
})]
|
|
74304
|
+
})
|
|
74305
|
+
]
|
|
74306
|
+
})
|
|
74307
|
+
}), document.body);
|
|
74308
|
+
}
|
|
74309
|
+
//#endregion
|
|
72192
74310
|
//#region src/client/TerminalView.tsx
|
|
72193
74311
|
/**
|
|
72194
74312
|
* Terminal view: a tab strip of independent remote shells under the host
|
|
@@ -72344,6 +74462,15 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
72344
74462
|
connected: true
|
|
72345
74463
|
})));
|
|
72346
74464
|
const [activeId, setActiveId] = (0, react.useState)(() => tabs[0]?.id);
|
|
74465
|
+
/**
|
|
74466
|
+
* The "quick add snippet" request from Ctrl+B: a counter (so the same draft
|
|
74467
|
+
* repeated still opens the form) plus the draft to pre-fill.
|
|
74468
|
+
*
|
|
74469
|
+
* A value rather than a callback prop: the shortcut lives in `XTerm` while the
|
|
74470
|
+
* form lives in the header, and this is the one value both sides can share
|
|
74471
|
+
* without lifting xterm state into React.
|
|
74472
|
+
*/
|
|
74473
|
+
const [snippetAdd, setSnippetAdd] = (0, react.useState)(void 0);
|
|
72347
74474
|
const effectiveAlias = alias !== "" && props.hosts.some((host) => host.alias === alias) ? alias : props.hosts[0]?.alias ?? "";
|
|
72348
74475
|
const wasOwner = (0, react.useRef)(false);
|
|
72349
74476
|
(0, react.useEffect)(() => {
|
|
@@ -72458,6 +74585,17 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
72458
74585
|
}));
|
|
72459
74586
|
}, [tabs]);
|
|
72460
74587
|
const active = tabs.find((tab) => tab.id === activeId) ?? tabs[0];
|
|
74588
|
+
/**
|
|
74589
|
+
* Remote home of a tab's host, for `~/path` tokens printed in its terminal.
|
|
74590
|
+
*
|
|
74591
|
+
* The SSH user is the only honest source (the PTY protocol carries no home):
|
|
74592
|
+
* root lives in `/root`, everyone else in `/home/<user>`.
|
|
74593
|
+
*/
|
|
74594
|
+
const homeFor = (hostAlias) => {
|
|
74595
|
+
const host = props.hosts.find((item) => item.alias === hostAlias);
|
|
74596
|
+
if (host === void 0) return void 0;
|
|
74597
|
+
return host.user === "root" ? "/root" : `/home/${host.user}`;
|
|
74598
|
+
};
|
|
72461
74599
|
const labelFor = (tab) => {
|
|
72462
74600
|
const siblings = tabs.filter((item) => item.alias === tab.alias);
|
|
72463
74601
|
const index = siblings.findIndex((item) => item.id === tab.id) + 1;
|
|
@@ -72475,6 +74613,16 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
72475
74613
|
className: "rvs-title",
|
|
72476
74614
|
children: t("tab.terminal")
|
|
72477
74615
|
}),
|
|
74616
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TerminalSnippets, {
|
|
74617
|
+
t,
|
|
74618
|
+
addRequest: snippetAdd?.id ?? 0,
|
|
74619
|
+
addContent: snippetAdd?.content ?? "",
|
|
74620
|
+
onInsert: (command) => {
|
|
74621
|
+
if (pasteIntoTerminal(active?.id, command)) return true;
|
|
74622
|
+
toast(t("term.snippetNoTerminal"), true);
|
|
74623
|
+
return false;
|
|
74624
|
+
}
|
|
74625
|
+
}),
|
|
72478
74626
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
72479
74627
|
className: "rvs-select",
|
|
72480
74628
|
value: effectiveAlias,
|
|
@@ -72569,6 +74717,18 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
72569
74717
|
}),
|
|
72570
74718
|
visible: props.visible && tab.id === active?.id,
|
|
72571
74719
|
t,
|
|
74720
|
+
tabId: tab.id,
|
|
74721
|
+
onQuickAddSnippet: (draft) => {
|
|
74722
|
+
const content = (draft.selection ?? draft.line ?? "").trim();
|
|
74723
|
+
setSnippetAdd((previous) => ({
|
|
74724
|
+
id: (previous?.id ?? 0) + 1,
|
|
74725
|
+
content
|
|
74726
|
+
}));
|
|
74727
|
+
},
|
|
74728
|
+
...homeFor(tab.alias) === void 0 ? {} : { home: homeFor(tab.alias) },
|
|
74729
|
+
onPathClick: (token, context) => {
|
|
74730
|
+
jumpToTerminalPath(tab.alias, token, context);
|
|
74731
|
+
},
|
|
72572
74732
|
...tab.initialCommand === void 0 ? {} : { initialInput: tab.initialCommand },
|
|
72573
74733
|
onReady: (id) => patchTab(tab.id, {
|
|
72574
74734
|
session: id,
|
|
@@ -73397,7 +75557,6 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
73397
75557
|
}
|
|
73398
75558
|
//#endregion
|
|
73399
75559
|
//#region src/client/RemoteRoot.tsx
|
|
73400
|
-
const SPLIT_KEY = "dsh-remote-vs.split";
|
|
73401
75560
|
const HIDDEN_KEY = "dsh-remote-vs.showHidden";
|
|
73402
75561
|
/**
|
|
73403
75562
|
* How often the client asks the Host for connection health. A local JSON call
|
|
@@ -73448,18 +75607,6 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
73448
75607
|
return false;
|
|
73449
75608
|
}
|
|
73450
75609
|
});
|
|
73451
|
-
const [split, setSplit] = (0, react.useState)(() => {
|
|
73452
|
-
try {
|
|
73453
|
-
const saved = Number(localStorage.getItem(SPLIT_KEY));
|
|
73454
|
-
return Number.isFinite(saved) && saved > .15 && saved < .9 ? saved : .45;
|
|
73455
|
-
} catch {
|
|
73456
|
-
return .45;
|
|
73457
|
-
}
|
|
73458
|
-
});
|
|
73459
|
-
const splitRef = (0, react.useRef)(split);
|
|
73460
|
-
const [dragging, setDragging] = (0, react.useState)(false);
|
|
73461
|
-
const dragRef = (0, react.useRef)(void 0);
|
|
73462
|
-
const columnRef = (0, react.useRef)(null);
|
|
73463
75610
|
/**
|
|
73464
75611
|
* Visibility is measured, not promised.
|
|
73465
75612
|
*
|
|
@@ -73669,69 +75816,11 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
73669
75816
|
store.workspaces,
|
|
73670
75817
|
store.aliasPaths
|
|
73671
75818
|
]);
|
|
73672
|
-
/**
|
|
73673
|
-
* The mount surface owns the editor, so a persisted `view === 'editor'` is
|
|
73674
|
-
* only reachable where the sidebar still holds the editor.
|
|
73675
|
-
*
|
|
73676
|
-
* `view` is restored from localStorage (where 'editor' is an allowed value)
|
|
73677
|
-
* and `editorSurface` starts as 'sidebar' before index.tsx flips it once the
|
|
73678
|
-
* conversation-view slot registers. A profile that last used the fallback
|
|
73679
|
-
* layout therefore came back with `view === 'editor'` while the rail button
|
|
73680
|
-
* that owns it was gone AND the centre tab mounted a second EditorPane on
|
|
73681
|
-
* the same store tab — two live buffers with independent undo state, the one
|
|
73682
|
-
* state this file declares must never happen.
|
|
73683
|
-
*
|
|
73684
|
-
* Only the CENTRE pixel surface triggers this redirect. While the editor
|
|
73685
|
-
* floats the sidebar keeps whatever view it had: the editor panel renders a
|
|
73686
|
-
* "docked elsewhere" placeholder (see panelFor), and on docking the user
|
|
73687
|
-
* lands back where they were.
|
|
73688
|
-
*/
|
|
73689
|
-
(0, react.useEffect)(() => {
|
|
73690
|
-
if (store.editorSurface === "center" && view === "editor") go("explorer");
|
|
73691
|
-
}, [
|
|
73692
|
-
store.editorSurface,
|
|
73693
|
-
view,
|
|
73694
|
-
go
|
|
73695
|
-
]);
|
|
73696
75819
|
(0, react.useEffect)(() => {
|
|
73697
75820
|
try {
|
|
73698
75821
|
localStorage.setItem(HIDDEN_KEY, showHidden ? "1" : "0");
|
|
73699
75822
|
} catch {}
|
|
73700
75823
|
}, [showHidden]);
|
|
73701
|
-
const onDividerDown = (e) => {
|
|
73702
|
-
if (e.button !== 0) return;
|
|
73703
|
-
e.preventDefault();
|
|
73704
|
-
try {
|
|
73705
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
73706
|
-
} catch {}
|
|
73707
|
-
dragRef.current = {
|
|
73708
|
-
startY: e.clientY,
|
|
73709
|
-
startRatio: splitRef.current
|
|
73710
|
-
};
|
|
73711
|
-
setDragging(true);
|
|
73712
|
-
};
|
|
73713
|
-
const onDividerMove = (e) => {
|
|
73714
|
-
const drag = dragRef.current;
|
|
73715
|
-
if (drag === void 0) return;
|
|
73716
|
-
if ((e.buttons & 1) === 0) {
|
|
73717
|
-
dragRef.current = void 0;
|
|
73718
|
-
setDragging(false);
|
|
73719
|
-
return;
|
|
73720
|
-
}
|
|
73721
|
-
const total = columnRef.current?.clientHeight ?? 0;
|
|
73722
|
-
if (total < 200) return;
|
|
73723
|
-
const next = Math.min(.88, Math.max(.12, drag.startRatio + (e.clientY - drag.startY) / total));
|
|
73724
|
-
splitRef.current = next;
|
|
73725
|
-
setSplit(next);
|
|
73726
|
-
};
|
|
73727
|
-
const onDividerEnd = () => {
|
|
73728
|
-
if (dragRef.current === void 0) return;
|
|
73729
|
-
dragRef.current = void 0;
|
|
73730
|
-
setDragging(false);
|
|
73731
|
-
try {
|
|
73732
|
-
localStorage.setItem(SPLIT_KEY, String(splitRef.current));
|
|
73733
|
-
} catch {}
|
|
73734
|
-
};
|
|
73735
75824
|
if (!store.ready) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
73736
75825
|
className: "rvs-root",
|
|
73737
75826
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -73745,7 +75834,6 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
73745
75834
|
})
|
|
73746
75835
|
});
|
|
73747
75836
|
const editorInSidebar = store.editorSurface === "sidebar";
|
|
73748
|
-
const showEditorWithView = editorInSidebar && (view === "explorer" || view === "search" || view === "scm" || view === "history") && store.tabs.length > 0;
|
|
73749
75837
|
/**
|
|
73750
75838
|
* One panel body. Every visited panel stays MOUNTED (hidden by CSS), which
|
|
73751
75839
|
* is what keeps the explorer's listings / expansion set — and the terminal's
|
|
@@ -73793,7 +75881,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
73793
75881
|
});
|
|
73794
75882
|
case "editor":
|
|
73795
75883
|
if (editorInSidebar) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditorPane, { visible: panelLive("editor") });
|
|
73796
|
-
return
|
|
75884
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingEditorPlaceholder, { mode: store.floatOpen ? "float" : "center" });
|
|
73797
75885
|
default: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RemoteExplorer, {
|
|
73798
75886
|
showHidden,
|
|
73799
75887
|
onToggleHidden: () => setShowHidden((v) => !v),
|
|
@@ -73801,12 +75889,11 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
73801
75889
|
});
|
|
73802
75890
|
}
|
|
73803
75891
|
};
|
|
73804
|
-
const editorInStack = editorInSidebar && !showEditorWithView;
|
|
73805
75892
|
const panel = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
73806
75893
|
className: "rvs-pane grow",
|
|
73807
75894
|
children: [...mounted].map((id) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
73808
75895
|
className: "rvs-viewslot",
|
|
73809
|
-
style: { display: view === id
|
|
75896
|
+
style: { display: view === id ? "flex" : "none" },
|
|
73810
75897
|
children: panelFor(id)
|
|
73811
75898
|
}, id))
|
|
73812
75899
|
});
|
|
@@ -73835,7 +75922,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
73835
75922
|
railButton("scm", t("tab.git"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconBranch, { size: 17 }), store.buckets.total),
|
|
73836
75923
|
railButton("history", t("tab.history"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconHistory, { size: 17 })),
|
|
73837
75924
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "rvs-rail-sep" }),
|
|
73838
|
-
|
|
75925
|
+
railButton("editor", store.activeTab?.rel.split("/").pop() ?? t("tab.editor"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconDiff, { size: 17 }), store.tabs.length),
|
|
73839
75926
|
railButton("terminal", t("tab.terminal"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconTerminal, { size: 17 })),
|
|
73840
75927
|
railButton("ports", t("tab.ports"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPlug, { size: 17 })),
|
|
73841
75928
|
railButton("monitor", t("tab.monitor"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconMonitor, { size: 17 })),
|
|
@@ -73844,7 +75931,6 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
73844
75931
|
}),
|
|
73845
75932
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
73846
75933
|
className: "rvs-column",
|
|
73847
|
-
ref: columnRef,
|
|
73848
75934
|
children: [
|
|
73849
75935
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
73850
75936
|
className: "rvs-globalbar",
|
|
@@ -73884,28 +75970,12 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
73884
75970
|
}),
|
|
73885
75971
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
73886
75972
|
className: "rvs-pane",
|
|
73887
|
-
style:
|
|
73888
|
-
height: `${Math.round(split * 1e3) / 10}%`,
|
|
73889
|
-
flex: "none",
|
|
73890
|
-
minHeight: 0
|
|
73891
|
-
} : {
|
|
75973
|
+
style: {
|
|
73892
75974
|
flex: 1,
|
|
73893
75975
|
minHeight: 0
|
|
73894
75976
|
},
|
|
73895
75977
|
children: panel
|
|
73896
|
-
})
|
|
73897
|
-
showEditorWithView && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
73898
|
-
className: "rvs-vsplit-handle",
|
|
73899
|
-
"data-dragging": dragging ? "true" : "false",
|
|
73900
|
-
onPointerDown: onDividerDown,
|
|
73901
|
-
onPointerMove: onDividerMove,
|
|
73902
|
-
onPointerUp: onDividerEnd,
|
|
73903
|
-
onPointerCancel: onDividerEnd,
|
|
73904
|
-
title: t("editor.resizeHint")
|
|
73905
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
73906
|
-
className: "rvs-pane grow",
|
|
73907
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditorPane, { visible: live })
|
|
73908
|
-
})] })
|
|
75978
|
+
})
|
|
73909
75979
|
]
|
|
73910
75980
|
})
|
|
73911
75981
|
]
|
|
@@ -74161,10 +76231,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
74161
76231
|
const step = () => {
|
|
74162
76232
|
if (disposed || token !== pollToken) return;
|
|
74163
76233
|
const handle = document.querySelector(RIGHTBAR_HANDLE);
|
|
74164
|
-
if (handle !== null && ownTabActive(ctx))
|
|
74165
|
-
resizeRightbar(handle, ratio);
|
|
74166
|
-
return;
|
|
74167
|
-
}
|
|
76234
|
+
if (handle !== null && ownTabActive(ctx) && resizeRightbar(handle, ratio)) return;
|
|
74168
76235
|
frames -= 1;
|
|
74169
76236
|
if (frames > 0) requestAnimationFrame(step);
|
|
74170
76237
|
};
|
|
@@ -74270,12 +76337,12 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
74270
76337
|
*/
|
|
74271
76338
|
function resizeRightbar(handle, ratio) {
|
|
74272
76339
|
const viewport = document.documentElement.clientWidth;
|
|
74273
|
-
if (viewport <= 0) return;
|
|
76340
|
+
if (viewport <= 0) return false;
|
|
74274
76341
|
const target = Math.min(Math.max(Math.round(viewport * clampViewWidthRatio(ratio)), RIGHTBAR_MIN_WIDTH), Math.max(RIGHTBAR_MIN_WIDTH, Math.round(viewport * RIGHTBAR_MAX_RATIO)));
|
|
74275
76342
|
const current = currentRightbarWidth(handle, viewport);
|
|
74276
|
-
if (current === void 0) return;
|
|
76343
|
+
if (current === void 0) return false;
|
|
74277
76344
|
const dx = Math.round(current) - target;
|
|
74278
|
-
if (Math.abs(dx) < 1) return;
|
|
76345
|
+
if (Math.abs(dx) < 1) return true;
|
|
74279
76346
|
const origin = Math.round(handle.getBoundingClientRect().left);
|
|
74280
76347
|
withNeutralPointerCapture(handle, () => {
|
|
74281
76348
|
withoutTrackTransition(handle, () => {
|
|
@@ -74283,6 +76350,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
74283
76350
|
dispatchPointer(handle, "pointerup", origin + dx);
|
|
74284
76351
|
});
|
|
74285
76352
|
});
|
|
76353
|
+
return true;
|
|
74286
76354
|
}
|
|
74287
76355
|
/**
|
|
74288
76356
|
* The width the drag will commit AGAINST (`base` in `setRightbar(base - dx)`).
|
|
@@ -74300,7 +76368,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
74300
76368
|
const positioned = Number.parseFloat(handle.style.left);
|
|
74301
76369
|
if (Number.isFinite(positioned) && positioned >= 0 && positioned <= viewport) {
|
|
74302
76370
|
const width = viewport - positioned;
|
|
74303
|
-
if (width
|
|
76371
|
+
if (width >= RIGHTBAR_MIN_WIDTH / 2) return width;
|
|
74304
76372
|
}
|
|
74305
76373
|
const column = document.querySelector(RIGHTBAR_COLUMN);
|
|
74306
76374
|
if (column !== null) {
|
|
@@ -75739,10 +77807,12 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
75739
77807
|
//#endregion
|
|
75740
77808
|
//#region src/client/RemoteEditorView.tsx
|
|
75741
77809
|
/**
|
|
75742
|
-
* The conversation-view body. The editor surface flag is
|
|
75743
|
-
*
|
|
75744
|
-
*
|
|
75745
|
-
* the
|
|
77810
|
+
* The conversation-view body. The editor surface flag is the STORE's (the
|
|
77811
|
+
* docked pane is the default; this view renders only while the user has moved
|
|
77812
|
+
* the editor here), and deliberately not derived from this component's own
|
|
77813
|
+
* mount: the view is unmounted while another conversation tab is selected, so
|
|
77814
|
+
* inferring the surface from mount/unmount would flip the sidebar's rail — and
|
|
77815
|
+
* its editor — on every host tab switch.
|
|
75746
77816
|
*/
|
|
75747
77817
|
function RemoteEditorView(props) {
|
|
75748
77818
|
useBootstrap(props.ctx);
|
|
@@ -75778,7 +77848,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
75778
77848
|
store.head.behind > 0 && ` ↓${store.head.behind}`
|
|
75779
77849
|
]
|
|
75780
77850
|
})]
|
|
75781
|
-
}), store.editorSurface === "center" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditorPane, { visible: true }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingEditorPlaceholder, {})]
|
|
77851
|
+
}), store.editorSurface === "center" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditorPane, { visible: true }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingEditorPlaceholder, { mode: store.floatOpen ? "float" : "sidebar" })]
|
|
75782
77852
|
})
|
|
75783
77853
|
})] });
|
|
75784
77854
|
}
|
|
@@ -77890,6 +79960,7 @@ exit 0
|
|
|
77890
79960
|
} catch {
|
|
77891
79961
|
return false;
|
|
77892
79962
|
}
|
|
79963
|
+
noteEditorSeatAvailable();
|
|
77893
79964
|
done = true;
|
|
77894
79965
|
stopTimer();
|
|
77895
79966
|
return true;
|
|
@@ -77899,6 +79970,7 @@ exit 0
|
|
|
77899
79970
|
done = true;
|
|
77900
79971
|
stopTimer();
|
|
77901
79972
|
disposeNative = registerNativeExplorer(ctx, nativeT) ?? void 0;
|
|
79973
|
+
if (disposeNative !== void 0) noteEditorSeatAvailable();
|
|
77902
79974
|
};
|
|
77903
79975
|
if (!goBetter()) {
|
|
77904
79976
|
try {
|
|
@@ -77921,6 +79993,7 @@ exit 0
|
|
|
77921
79993
|
try {
|
|
77922
79994
|
disposeNative?.();
|
|
77923
79995
|
} catch {}
|
|
79996
|
+
if (disposeBetter !== void 0 || disposeNative !== void 0) noteEditorSeatGone();
|
|
77924
79997
|
};
|
|
77925
79998
|
}, "dsh-remote-vs: explorer surface (better tab preferred, native fallback)");
|
|
77926
79999
|
ctx.effect(() => ctx.slots.inject("conversation.hero.workspace.directoryFlow", () => ctx.slots.inject("sidebar.workspaces.directoryFlow", function* () {
|
|
@@ -77985,12 +80058,13 @@ exit 0
|
|
|
77985
80058
|
order: 30,
|
|
77986
80059
|
label: () => viewT("view.editor")
|
|
77987
80060
|
}, () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RemoteEditorView, { ctx })));
|
|
80061
|
+
noteEditorSeatAvailable();
|
|
77988
80062
|
} catch (error) {
|
|
77989
80063
|
console.warn("[dsh-remote-vs] conversation.view registration failed:", error);
|
|
77990
80064
|
return () => {};
|
|
77991
80065
|
}
|
|
77992
|
-
setEditorSurface("center");
|
|
77993
80066
|
return () => {
|
|
80067
|
+
noteEditorSeatGone();
|
|
77994
80068
|
setEditorSurface("sidebar");
|
|
77995
80069
|
try {
|
|
77996
80070
|
dispose?.();
|