dsh-remote-vs 0.15.1 → 0.17.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 +18 -10
- package/README.md +18 -10
- package/lib/client.js +1581 -18
- package/lib/index.js +692 -5
- package/lib/types/client/PortsView.d.ts +30 -0
- package/lib/types/client/ai-review.d.ts +116 -0
- package/lib/types/client/api.d.ts +29 -1
- package/lib/types/client/composer.d.ts +15 -0
- package/lib/types/client/drag-expand.d.ts +78 -0
- package/lib/types/client/store.d.ts +1 -1
- package/lib/types/forward.d.ts +114 -0
- package/lib/types/listen-ports.d.ts +56 -0
- package/lib/types/pool.d.ts +18 -0
- package/lib/types/protocol.d.ts +72 -0
- package/lib/types/routes.d.ts +7 -0
- package/package.json +1 -1
- package/src/client/PortsView.tsx +850 -0
- package/src/client/RemoteExplorer.tsx +201 -16
- package/src/client/RemoteRoot.tsx +7 -1
- package/src/client/ai-review.ts +428 -0
- package/src/client/api.ts +38 -0
- package/src/client/composer.ts +18 -0
- package/src/client/drag-expand.ts +128 -0
- package/src/client/i18n.ts +78 -0
- package/src/client/scm/CommitPane.tsx +71 -0
- package/src/client/scm/DiffView.tsx +85 -1
- package/src/client/store.tsx +2 -2
- package/src/client/vsc/vsc.css +183 -0
- package/src/forward.ts +445 -0
- package/src/index.ts +40 -1
- package/src/listen-ports.ts +241 -0
- package/src/pool.ts +63 -0
- package/src/protocol.ts +76 -0
- package/src/routes.ts +125 -0
package/lib/client.js
CHANGED
|
@@ -11,7 +11,7 @@ window.__ModuleLoader__.load({
|
|
|
11
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
12
|
let react_dom = require("react-dom");
|
|
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-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 * 放在编辑器上而不是面板里 —— 文件打开后光标就在这里,而面板可能被收起、被滚走。\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/* ------------------------------------------------------ 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";
|
|
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-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 * 放在编辑器上而不是面板里 —— 文件打开后光标就在这里,而面板可能被收起、被滚走。\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/* ------------------------------------------------------ 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";
|
|
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) {
|
|
@@ -56,7 +56,11 @@ window.__ModuleLoader__.load({
|
|
|
56
56
|
/** Current working directory of one live session (click resolution helper). */
|
|
57
57
|
sessionCwd: "/api/dsh-remote/session-cwd",
|
|
58
58
|
/** What one live session changed on its remote host (the review panel). */
|
|
59
|
-
changes: "/api/dsh-remote/changes"
|
|
59
|
+
changes: "/api/dsh-remote/changes",
|
|
60
|
+
/** Local TCP forwards (`ssh -L` semantics) for the port panel. */
|
|
61
|
+
forwards: "/api/dsh-remote/forwards",
|
|
62
|
+
/** Remote listening TCP sockets for the port panel (one bounded probe). */
|
|
63
|
+
listenPorts: "/api/dsh-remote/listen-ports"
|
|
60
64
|
};
|
|
61
65
|
/** Suggested/attachment file name for one multi-selection archive. */
|
|
62
66
|
function selectionDownloadName(count) {
|
|
@@ -352,6 +356,7 @@ window.__ModuleLoader__.load({
|
|
|
352
356
|
"tab.workspaces": "工作区",
|
|
353
357
|
"tab.files": "文件",
|
|
354
358
|
"tab.terminal": "终端",
|
|
359
|
+
"tab.ports": "端口",
|
|
355
360
|
"tab.remote": "远程",
|
|
356
361
|
"tab.remoteDesc": "远端文件、终端与 Git",
|
|
357
362
|
"hosts.title": "远程主机",
|
|
@@ -740,6 +745,14 @@ window.__ModuleLoader__.load({
|
|
|
740
745
|
"scm.commitDiff": "提交差异",
|
|
741
746
|
"scm.checkoutCommitTitle": "检出提交(分离头指针)",
|
|
742
747
|
"scm.checkoutCommitText": "将把远端工作区切到 {hash},处于分离头指针状态。",
|
|
748
|
+
"scm.aiReview": "让 AI 审查此 diff(只追加到对话草稿,不会自动发送)",
|
|
749
|
+
"scm.aiReviewNoSession": "当前会话与这个远端工作区没有绑定:绑定后才能把 diff 交给 AI 审查",
|
|
750
|
+
"scm.aiReviewNoContext": "插件上下文尚未就绪,暂时无法写入对话草稿",
|
|
751
|
+
"scm.aiReviewNoChannel": "当前宿主没有可用的对话输入通道,无法写入草稿(宿主版本可能不兼容)",
|
|
752
|
+
"scm.aiReviewAdded": "已追加到对话草稿,请检查后发送",
|
|
753
|
+
"scm.aiReviewAddedSummary": "diff 较大(或已被截断),已按摘要方式追加到草稿,请检查后发送",
|
|
754
|
+
"scm.aiReviewAddedRead": "该文件没有可内嵌的 diff 文本(新增或未跟踪),已让 AI 自行读取,请检查后发送",
|
|
755
|
+
"scm.aiReviewFailed": "追加失败:当前会话的输入框不可用(可能正在发送或校验中),请稍后重试",
|
|
743
756
|
"history.filter": "过滤提交(信息 / 作者 / 哈希)",
|
|
744
757
|
"history.details": "提交详情",
|
|
745
758
|
"history.content": "内容",
|
|
@@ -767,6 +780,8 @@ window.__ModuleLoader__.load({
|
|
|
767
780
|
"history.copyMessage": "复制提交信息",
|
|
768
781
|
"history.copyFilePatch": "复制该文件补丁",
|
|
769
782
|
"history.copyCommitPatch": "复制整个补丁",
|
|
783
|
+
"history.aiReview": "让 AI 审查此提交(只追加到对话草稿,不会自动发送)",
|
|
784
|
+
"history.aiReviewNoPatch": "该提交的 patch 尚未加载完成,或没有可内嵌的文本 diff",
|
|
770
785
|
"history.copiedMessage": "已复制提交信息",
|
|
771
786
|
"history.copiedHash": "已复制完整哈希",
|
|
772
787
|
"history.copiedSubject": "已复制提交标题",
|
|
@@ -871,12 +886,38 @@ window.__ModuleLoader__.load({
|
|
|
871
886
|
"quickopen.warning": "索引不完整:{detail}",
|
|
872
887
|
"quickopen.noResults": "没有匹配的文件",
|
|
873
888
|
"quickopen.more": "匹配过多,请继续输入",
|
|
874
|
-
"quickopen.noWorkspace": "没有选定的远端工作区"
|
|
889
|
+
"quickopen.noWorkspace": "没有选定的远端工作区",
|
|
890
|
+
"ports.selectHost": "选择主机",
|
|
891
|
+
"ports.refresh": "刷新",
|
|
892
|
+
"ports.remoteHost": "远端地址",
|
|
893
|
+
"ports.remotePort": "远端端口",
|
|
894
|
+
"ports.localPort": "本地端口(留空自动分配)",
|
|
895
|
+
"ports.add": "转发",
|
|
896
|
+
"ports.active": "已建转发",
|
|
897
|
+
"ports.listening": "远端监听端口",
|
|
898
|
+
"ports.emptyForwards": "还没有转发规则:上面的表单新建一条,或从下面的监听端口一键转发。",
|
|
899
|
+
"ports.noHosts": "还没有主机,请先去「设置 → 远程主机」配置。",
|
|
900
|
+
"ports.copyUrl": "复制本地 URL",
|
|
901
|
+
"ports.copied": "已复制",
|
|
902
|
+
"ports.open": "在浏览器中打开",
|
|
903
|
+
"ports.stop": "停止转发",
|
|
904
|
+
"ports.forward": "转发到本地",
|
|
905
|
+
"ports.stateListening": "监听中",
|
|
906
|
+
"ports.stateError": "连接失败",
|
|
907
|
+
"ports.connections": "{count} 个连接",
|
|
908
|
+
"ports.emptyListen": "远端没有列出监听端口。",
|
|
909
|
+
"ports.listenUnavailable": "无法枚举远端端口:远端既没有 ss 也没有 netstat。",
|
|
910
|
+
"ports.listenUnknown": "无法枚举远端端口:探测没有返回结果。",
|
|
911
|
+
"ports.badPort": "端口必须是 1–65535 的整数;本地端口留空表示自动分配。",
|
|
912
|
+
"ports.restoreFailed": "{count} 条已保存的转发规则未能恢复:本地端口可能被占用,或已超过每台主机的规则上限。",
|
|
913
|
+
"ports.forgetFailed": "移除这些规则",
|
|
914
|
+
"ports.remoteHostHint": "目标地址由远端主机拨号,可访问远端内网;本地监听只绑定 127.0.0.1。"
|
|
875
915
|
};
|
|
876
916
|
const en = {
|
|
877
917
|
"tab.workspaces": "Workspaces",
|
|
878
918
|
"tab.files": "Files",
|
|
879
919
|
"tab.terminal": "Terminal",
|
|
920
|
+
"tab.ports": "Ports",
|
|
880
921
|
"tab.remote": "Remote",
|
|
881
922
|
"tab.remoteDesc": "Remote files, terminal and Git",
|
|
882
923
|
"hosts.title": "Remote hosts",
|
|
@@ -1265,6 +1306,14 @@ window.__ModuleLoader__.load({
|
|
|
1265
1306
|
"scm.commitDiff": "commit diff",
|
|
1266
1307
|
"scm.checkoutCommitTitle": "Check out commit (detached HEAD)",
|
|
1267
1308
|
"scm.checkoutCommitText": "The remote working tree switches to {hash} in detached HEAD state.",
|
|
1309
|
+
"scm.aiReview": "Ask AI to review this diff (appends to the conversation draft; nothing is sent automatically)",
|
|
1310
|
+
"scm.aiReviewNoSession": "No session is bound to this remote workspace — binding one is what lets the diff be handed to AI",
|
|
1311
|
+
"scm.aiReviewNoContext": "The plugin context is not ready yet, so the draft cannot be written",
|
|
1312
|
+
"scm.aiReviewNoChannel": "This host exposes no conversation input channel, so the draft cannot be written (the host version may be incompatible)",
|
|
1313
|
+
"scm.aiReviewAdded": "Appended to the conversation draft — check it, then send",
|
|
1314
|
+
"scm.aiReviewAddedSummary": "Large (or truncated) diff: appended as a summary — check it, then send",
|
|
1315
|
+
"scm.aiReviewAddedRead": "This file has no inline diff (added or untracked), so AI was asked to read it — check the draft, then send",
|
|
1316
|
+
"scm.aiReviewFailed": "Append failed: this session’s composer is not writable right now (it may be sending) — try again later",
|
|
1268
1317
|
"history.filter": "Filter commits (message / author / hash)",
|
|
1269
1318
|
"history.details": "Commit details",
|
|
1270
1319
|
"history.content": "Contents",
|
|
@@ -1292,6 +1341,8 @@ window.__ModuleLoader__.load({
|
|
|
1292
1341
|
"history.copyMessage": "Copy commit message",
|
|
1293
1342
|
"history.copyFilePatch": "Copy file patch",
|
|
1294
1343
|
"history.copyCommitPatch": "Copy whole patch",
|
|
1344
|
+
"history.aiReview": "Ask AI to review this commit (appends to the conversation draft; nothing is sent automatically)",
|
|
1345
|
+
"history.aiReviewNoPatch": "This commit’s patch is not loaded yet, or it has no inline textual diff",
|
|
1295
1346
|
"history.copiedMessage": "Commit message copied",
|
|
1296
1347
|
"history.copiedHash": "Full hash copied",
|
|
1297
1348
|
"history.copiedSubject": "Subject copied",
|
|
@@ -1396,7 +1447,32 @@ window.__ModuleLoader__.load({
|
|
|
1396
1447
|
"quickopen.warning": "Index incomplete: {detail}",
|
|
1397
1448
|
"quickopen.noResults": "No matching file",
|
|
1398
1449
|
"quickopen.more": "Too many matches — keep typing",
|
|
1399
|
-
"quickopen.noWorkspace": "No remote workspace is selected"
|
|
1450
|
+
"quickopen.noWorkspace": "No remote workspace is selected",
|
|
1451
|
+
"ports.selectHost": "Select host",
|
|
1452
|
+
"ports.refresh": "Refresh",
|
|
1453
|
+
"ports.remoteHost": "Remote address",
|
|
1454
|
+
"ports.remotePort": "Remote port",
|
|
1455
|
+
"ports.localPort": "Local port (empty = auto)",
|
|
1456
|
+
"ports.add": "Forward",
|
|
1457
|
+
"ports.active": "Forwards",
|
|
1458
|
+
"ports.listening": "Listening on the remote host",
|
|
1459
|
+
"ports.emptyForwards": "No forwards yet — add one above, or forward a listening port below.",
|
|
1460
|
+
"ports.noHosts": "No hosts yet. Configure one under Settings → Remote hosts first.",
|
|
1461
|
+
"ports.copyUrl": "Copy local URL",
|
|
1462
|
+
"ports.copied": "Copied",
|
|
1463
|
+
"ports.open": "Open in browser",
|
|
1464
|
+
"ports.stop": "Stop forward",
|
|
1465
|
+
"ports.forward": "Forward to local",
|
|
1466
|
+
"ports.stateListening": "Listening",
|
|
1467
|
+
"ports.stateError": "Connection failed",
|
|
1468
|
+
"ports.connections": "{count} connection(s)",
|
|
1469
|
+
"ports.emptyListen": "The remote host listed no listening ports.",
|
|
1470
|
+
"ports.listenUnavailable": "Cannot enumerate remote ports: neither ss nor netstat is available on the host.",
|
|
1471
|
+
"ports.listenUnknown": "Cannot enumerate remote ports: the probe did not answer.",
|
|
1472
|
+
"ports.badPort": "Port must be an integer between 1 and 65535; leave the local port empty to auto-assign.",
|
|
1473
|
+
"ports.restoreFailed": "{count} saved forward(s) could not be restored — the local port may be taken, or the per-host rule limit reached.",
|
|
1474
|
+
"ports.forgetFailed": "Forget these rules",
|
|
1475
|
+
"ports.remoteHostHint": "The target is dialed from the remote host, so it can reach that host’s private network; the local listener binds 127.0.0.1 only."
|
|
1400
1476
|
};
|
|
1401
1477
|
function detectLang() {
|
|
1402
1478
|
try {
|
|
@@ -3073,6 +3149,32 @@ window.__ModuleLoader__.load({
|
|
|
3073
3149
|
importSshConfig: () => post(REMOTE_API.importSshConfig, {}),
|
|
3074
3150
|
importDshSsh: () => post(REMOTE_API.importDshSsh, {}),
|
|
3075
3151
|
terminalClose: (id) => post(REMOTE_API.terminalClose, { id }),
|
|
3152
|
+
/**
|
|
3153
|
+
* Live forwards, narrowed to one host when an alias is given.
|
|
3154
|
+
*
|
|
3155
|
+
* A purely LOCAL read: the Host already holds the tunnels, so the panel can
|
|
3156
|
+
* poll this every few seconds without spending a single remote command.
|
|
3157
|
+
*/
|
|
3158
|
+
forwards: (alias) => call(alias === void 0 || alias === "" ? REMOTE_API.forwards : `${REMOTE_API.forwards}?alias=${encodeURIComponent(alias)}`).then((r) => r.forwards),
|
|
3159
|
+
/**
|
|
3160
|
+
* Open one forward.
|
|
3161
|
+
*
|
|
3162
|
+
* 400 = the request is not a valid rule, 409 = the local port is taken, 502 =
|
|
3163
|
+
* the tunnel could not be established (a refused `direct-tcpip` included) —
|
|
3164
|
+
* all three arrive as a `RemoteApiError` whose `message` is the Host's own
|
|
3165
|
+
* explanation, which is what the panel shows.
|
|
3166
|
+
*/
|
|
3167
|
+
startForward: (request) => post(REMOTE_API.forwards, request).then((r) => r.forward),
|
|
3168
|
+
/** Close one forward by its rule id. */
|
|
3169
|
+
stopForward: (id) => call(`${REMOTE_API.forwards}?id=${encodeURIComponent(id)}`, { method: "DELETE" }),
|
|
3170
|
+
/**
|
|
3171
|
+
* One bounded probe of the remote host's listening TCP sockets.
|
|
3172
|
+
*
|
|
3173
|
+
* Costs one remote exec, so the panel asks rarely; `tool: 'none' | 'unknown'`
|
|
3174
|
+
* is an honest "cannot enumerate" answer and must not be rendered as "none
|
|
3175
|
+
* found" (see `RemoteListenPortsResult`).
|
|
3176
|
+
*/
|
|
3177
|
+
listenPorts: (alias) => call(`${REMOTE_API.listenPorts}?alias=${encodeURIComponent(alias)}`),
|
|
3076
3178
|
git: {
|
|
3077
3179
|
async status(alias, path) {
|
|
3078
3180
|
const timeoutMs = gitTimeoutMs();
|
|
@@ -37699,6 +37801,23 @@ window.__ModuleLoader__.load({
|
|
|
37699
37801
|
}
|
|
37700
37802
|
}
|
|
37701
37803
|
/**
|
|
37804
|
+
* Whether this session has a usable draft-insert channel right now.
|
|
37805
|
+
*
|
|
37806
|
+
* A PREFLIGHT for surfaces that must not offer an action they cannot complete
|
|
37807
|
+
* (the diff view's "review this diff with AI" button): the conversation service
|
|
37808
|
+
* is a soft, version-dependent read (see {@link conversationOf}), so on a host
|
|
37809
|
+
* that does not expose it the button has to say so up front instead of failing
|
|
37810
|
+
* on click with a message about a busy composer — a wrong cause is worse than no
|
|
37811
|
+
* button.
|
|
37812
|
+
*
|
|
37813
|
+
* Read-only and side-effect free on purpose: it never calls
|
|
37814
|
+
* `input.for()` (resolving the facade could materialise a per-session input
|
|
37815
|
+
* shell), so it can run on every render of the owning view.
|
|
37816
|
+
*/
|
|
37817
|
+
function canInsertDraft(ctx, sessionId) {
|
|
37818
|
+
return sessionScope(ctx, sessionId) !== void 0 && conversationOf(ctx) !== void 0;
|
|
37819
|
+
}
|
|
37820
|
+
/**
|
|
37702
37821
|
* Mint one reference chip through the host's public `insertReference` facade —
|
|
37703
37822
|
* the same method the native `@` picker's event listener calls, so the
|
|
37704
37823
|
* composer shows a compact chip while the model receives `reference.text`.
|
|
@@ -40688,7 +40807,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
40688
40807
|
const primary = host.querySelectorAll("[class*=\"rvs-ck-\"]").length;
|
|
40689
40808
|
const fallback = host.querySelectorAll("span[class^=\"rvs-t-\"]").length;
|
|
40690
40809
|
const count = primary > 0 ? primary : fallback;
|
|
40691
|
-
console.info(`[dsh-remote-vs] build
|
|
40810
|
+
console.info(`[dsh-remote-vs] build 1103-1732 · ${source} · colored tokens: ${count} (${propsRef.current.path})`);
|
|
40692
40811
|
propsRef.current.onTokens?.(count);
|
|
40693
40812
|
};
|
|
40694
40813
|
const armFallback = () => {
|
|
@@ -43763,7 +43882,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
43763
43882
|
function readStoredView() {
|
|
43764
43883
|
try {
|
|
43765
43884
|
const saved = localStorage.getItem(VIEW_KEY);
|
|
43766
|
-
if (saved === "explorer" || saved === "search" || saved === "scm" || saved === "history" || saved === "editor" || saved === "terminal" || saved === "workspaces") return saved;
|
|
43885
|
+
if (saved === "explorer" || saved === "search" || saved === "scm" || saved === "history" || saved === "editor" || saved === "terminal" || saved === "ports" || saved === "workspaces") return saved;
|
|
43767
43886
|
} catch {}
|
|
43768
43887
|
return "explorer";
|
|
43769
43888
|
}
|
|
@@ -46020,6 +46139,317 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
46020
46139
|
return (0, react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
46021
46140
|
}
|
|
46022
46141
|
//#endregion
|
|
46142
|
+
//#region src/client/ai-review.ts
|
|
46143
|
+
/**
|
|
46144
|
+
* "Review this diff with AI" (F6): the pure half — byte accounting, the size
|
|
46145
|
+
* tier decision and the prompt builder. No React, no DOM, no host access: the
|
|
46146
|
+
* button in `scm/DiffView.tsx` calls these and hands the result to
|
|
46147
|
+
* `appendToDraft` (`composer.ts`), the ONE delivery channel v1 uses.
|
|
46148
|
+
*
|
|
46149
|
+
* Why the byte accounting is not optional
|
|
46150
|
+
* ---------------------------------------
|
|
46151
|
+
* `git diff` runs through `capped()` in `git-ops.ts`: `| head -c GIT_CAP`, and
|
|
46152
|
+
* `RemoteExecResult` carries no `truncated` flag — the cut is SILENT. Sending
|
|
46153
|
+
* such a prefix as "the diff" produces a confident review of half a patch: a
|
|
46154
|
+
* wrong answer with no marker anywhere. So the caller compares BYTES against
|
|
46155
|
+
* `GIT_CAP`, and `pickReviewMode` refuses `full` for a capped diff even when the
|
|
46156
|
+
* prefix would fit the inline budget: a truncated diff can never be reviewed as
|
|
46157
|
+
* if it were complete.
|
|
46158
|
+
*
|
|
46159
|
+
* Two thresholds, two different jobs:
|
|
46160
|
+
* - `GIT_CAP` (2,000,000 B, `git-ops.ts`): the read was CUT, so the prompt's
|
|
46161
|
+
* FIRST line has to say so.
|
|
46162
|
+
* - `AI_REVIEW_MAX_BYTES` (32 KiB ≈ 8–10k tokens): above it the diff is not
|
|
46163
|
+
* inlined at all. The prompt carries the file, the scope and the `@@` hunk
|
|
46164
|
+
* headers, and tells the model to fetch the diff itself (a read or a
|
|
46165
|
+
* `git diff` on the remote host) instead of spending a whole context window
|
|
46166
|
+
* on one message — 2 MB would be ~550–700k tokens and could never be sent.
|
|
46167
|
+
*
|
|
46168
|
+
* The fence length is computed, never hardcoded: a file that CONTAINS ``` would
|
|
46169
|
+
* close a 3-backtick fence early and the rest of the patch would be read as
|
|
46170
|
+
* prose. One backtick more than the longest run inside makes that impossible.
|
|
46171
|
+
*/
|
|
46172
|
+
/** Largest complete diff we inline into the prompt, in BYTES (≈8–10k tokens). */
|
|
46173
|
+
const AI_REVIEW_MAX_BYTES = 32 * 1024;
|
|
46174
|
+
/** UTF-8 byte length — the unit `head -c` and therefore `GIT_CAP` count. */
|
|
46175
|
+
function diffByteLength(diff) {
|
|
46176
|
+
return new TextEncoder().encode(diff).length;
|
|
46177
|
+
}
|
|
46178
|
+
/**
|
|
46179
|
+
* Which revision range a diff tab shows.
|
|
46180
|
+
*
|
|
46181
|
+
* `ref` wins over `staged`, and that order is load-bearing: a commit drill-down
|
|
46182
|
+
* tab is BOTH `staged: true` and `ref: hash` (`store.openCommitFile`), so asking
|
|
46183
|
+
* `staged` first would label a commit's diff as "staged changes" and point the
|
|
46184
|
+
* model at the index instead of the commit.
|
|
46185
|
+
*/
|
|
46186
|
+
function reviewScopeOf(staged, ref) {
|
|
46187
|
+
if (ref !== void 0) return "commit";
|
|
46188
|
+
if (staged) return "staged";
|
|
46189
|
+
return "worktree";
|
|
46190
|
+
}
|
|
46191
|
+
/**
|
|
46192
|
+
* Which prompt shape this diff gets.
|
|
46193
|
+
*
|
|
46194
|
+
* Order matters. `pathOnly` answers "there is no diff text at all" (untracked /
|
|
46195
|
+
* binary / failed read) and outranks the rest because it needs no budget.
|
|
46196
|
+
* `capped` outranks the size test: a 1 KiB prefix of a 2 MB patch is not a
|
|
46197
|
+
* small diff, it is a CUT one. Only a complete, small diff earns `full`.
|
|
46198
|
+
*/
|
|
46199
|
+
function pickReviewMode(input) {
|
|
46200
|
+
if (!input.hasDiff) return "pathOnly";
|
|
46201
|
+
if (input.capped) return "summary";
|
|
46202
|
+
if (input.bytes <= 32768) return "full";
|
|
46203
|
+
return "summary";
|
|
46204
|
+
}
|
|
46205
|
+
/** Longest unbroken run of backticks in `text` (0 when there is none). */
|
|
46206
|
+
function longestBacktickRun(text) {
|
|
46207
|
+
let longest = 0;
|
|
46208
|
+
for (const run of text.matchAll(/`+/g)) if (run[0].length > longest) longest = run[0].length;
|
|
46209
|
+
return longest;
|
|
46210
|
+
}
|
|
46211
|
+
/**
|
|
46212
|
+
* A code fence `diff` itself cannot close: one backtick longer than the longest
|
|
46213
|
+
* run inside it, never shorter than the usual three.
|
|
46214
|
+
*/
|
|
46215
|
+
function diffFence(diff) {
|
|
46216
|
+
return "`".repeat(Math.max(3, longestBacktickRun(diff) + 1));
|
|
46217
|
+
}
|
|
46218
|
+
/**
|
|
46219
|
+
* The `@@ … @@` hunk headers of a unified diff, in order.
|
|
46220
|
+
*
|
|
46221
|
+
* A line starting with `@@` can only be a header: every content line of a
|
|
46222
|
+
* unified diff begins with ' ', '+' or '-', and the file-level lines begin with
|
|
46223
|
+
* `diff --git`, `index`, `---`, `+++`, `new file` or `deleted file`.
|
|
46224
|
+
*/
|
|
46225
|
+
function hunkHeaders(diff) {
|
|
46226
|
+
return diff.split("\n").filter((line) => line.startsWith("@@"));
|
|
46227
|
+
}
|
|
46228
|
+
/** How the prompt names the revision range. */
|
|
46229
|
+
const SCOPE_LABEL = {
|
|
46230
|
+
zh: {
|
|
46231
|
+
worktree: "工作区未暂存的更改",
|
|
46232
|
+
staged: "已暂存的更改",
|
|
46233
|
+
commit: "提交"
|
|
46234
|
+
},
|
|
46235
|
+
en: {
|
|
46236
|
+
worktree: "unstaged working-tree changes",
|
|
46237
|
+
staged: "staged changes",
|
|
46238
|
+
commit: "commit"
|
|
46239
|
+
}
|
|
46240
|
+
};
|
|
46241
|
+
function scopeLabel(scope, commitRef, lang) {
|
|
46242
|
+
const base = SCOPE_LABEL[lang][scope];
|
|
46243
|
+
if (scope !== "commit" || commitRef === void 0) return base;
|
|
46244
|
+
return `${base} ${commitRef}`;
|
|
46245
|
+
}
|
|
46246
|
+
/**
|
|
46247
|
+
* The warning that must be the prompt's FIRST line when the diff was capped.
|
|
46248
|
+
*
|
|
46249
|
+
* The number comes from `GIT_CAP` itself, so the prompt cannot drift from the
|
|
46250
|
+
* command that did the cut. The language is the reviewer's, like the rest.
|
|
46251
|
+
*/
|
|
46252
|
+
function cappedWarning(lang) {
|
|
46253
|
+
if (lang === "zh") return `⚠ 这份 diff 在 ${GIT_CAP} 字节处被静默截断:下面只是前缀,后面的文件与代码块可能缺失,请以远端实际内容为准。`;
|
|
46254
|
+
return `⚠ This diff was silently truncated at ${GIT_CAP} bytes: only a prefix is shown, so later files and hunks may be missing — rely on the real remote content.`;
|
|
46255
|
+
}
|
|
46256
|
+
/** The file/scope facts every prompt carries, right after the headline. */
|
|
46257
|
+
function contextLines(input) {
|
|
46258
|
+
const scope = scopeLabel(input.scope, input.commitRef, input.lang);
|
|
46259
|
+
if (input.lang === "zh") return [
|
|
46260
|
+
`目标文件:${input.fullPath}(仓库内相对路径 ${input.rel})`,
|
|
46261
|
+
`主机:${input.alias}`,
|
|
46262
|
+
`仓库根:${input.root}`,
|
|
46263
|
+
`差异范围:${scope}`
|
|
46264
|
+
];
|
|
46265
|
+
return [
|
|
46266
|
+
`Target file: ${input.fullPath} (repository-relative path ${input.rel})`,
|
|
46267
|
+
`Host: ${input.alias}`,
|
|
46268
|
+
`Repository root: ${input.root}`,
|
|
46269
|
+
`Diff scope: ${scope}`
|
|
46270
|
+
];
|
|
46271
|
+
}
|
|
46272
|
+
/**
|
|
46273
|
+
* The review instructions every prompt carries.
|
|
46274
|
+
*
|
|
46275
|
+
* Phrased as RULES rather than a persona because the receiver is a coding agent
|
|
46276
|
+
* with write access to the same host: this text lands in a normal draft and can
|
|
46277
|
+
* be sent as-is, so "change nothing" has to be explicit.
|
|
46278
|
+
*/
|
|
46279
|
+
function reviewRules(lang) {
|
|
46280
|
+
if (lang === "zh") return [
|
|
46281
|
+
"1. 只做审查:不要修改、暂存、提交或删除任何文件,也不要运行会改变工作区的命令。",
|
|
46282
|
+
"2. 重点看正确性、边界条件(空值 / 超大输入 / 异常路径)与错误处理(是否吞掉失败),以及与仓库既有约定不一致的地方(命名、分层、注释风格)。",
|
|
46283
|
+
"3. 每条问题用「文件:行号」定位(变更后的行号),说明为什么是问题、建议怎么改。",
|
|
46284
|
+
"4. 不要复述 diff 内容,直接给结论;没有发现问题就明确说「未发现问题」。"
|
|
46285
|
+
];
|
|
46286
|
+
return [
|
|
46287
|
+
"1. Review only: do not modify, stage, commit or delete any file, and do not run commands that change the working tree.",
|
|
46288
|
+
"2. Focus on correctness, boundary conditions (empty / huge input / unusual paths), swallowed failures, and anything that breaks the repository conventions (naming, layering, comment style).",
|
|
46289
|
+
"3. Locate every finding as \"file:line\" (line numbers AFTER the change) and say why it is a problem and how you would fix it.",
|
|
46290
|
+
"4. Do not restate the diff; give conclusions only, and say \"no issues found\" explicitly when there are none."
|
|
46291
|
+
];
|
|
46292
|
+
}
|
|
46293
|
+
/** The fenced, verbatim diff of a completed read. */
|
|
46294
|
+
function fullBlock(input) {
|
|
46295
|
+
const intro = input.lang === "zh" ? "完整 diff:" : "Complete diff:";
|
|
46296
|
+
const body = input.diff.endsWith("\n") ? input.diff.slice(0, -1) : input.diff;
|
|
46297
|
+
const fence = diffFence(input.diff);
|
|
46298
|
+
return [
|
|
46299
|
+
intro,
|
|
46300
|
+
`${fence}diff`,
|
|
46301
|
+
body,
|
|
46302
|
+
fence
|
|
46303
|
+
];
|
|
46304
|
+
}
|
|
46305
|
+
/**
|
|
46306
|
+
* The size-reduced prompt: no diff body, but the anchors a reviewer needs.
|
|
46307
|
+
*
|
|
46308
|
+
* The `@@` headers are the part of a large diff that is cheap and useful — they
|
|
46309
|
+
* say WHERE the changes are, so the model can read those regions instead of the
|
|
46310
|
+
* whole patch. The body is deliberately absent: shipping it would defeat the
|
|
46311
|
+
* budget this branch exists for.
|
|
46312
|
+
*/
|
|
46313
|
+
function summaryBlock(input) {
|
|
46314
|
+
const headers = hunkHeaders(input.diff);
|
|
46315
|
+
const listed = headers.slice(0, 40);
|
|
46316
|
+
const omitted = headers.length - listed.length;
|
|
46317
|
+
const lines = [];
|
|
46318
|
+
if (input.lang === "zh") {
|
|
46319
|
+
lines.push(`diff 大小:${diffByteLength(input.diff)} 字节;超过 ${AI_REVIEW_MAX_BYTES} 字节的内嵌上限,所以没有内嵌全文(按块摘要见下)。`);
|
|
46320
|
+
lines.push("");
|
|
46321
|
+
lines.push(`变更块(从 diff 的 @@ 头提取,共 ${headers.length} 处,最多列出 40 处):`);
|
|
46322
|
+
} else {
|
|
46323
|
+
lines.push(`Diff size: ${diffByteLength(input.diff)} bytes; above the ${AI_REVIEW_MAX_BYTES}-byte inline limit, so the body is not included (per-hunk summary below).`);
|
|
46324
|
+
lines.push("");
|
|
46325
|
+
lines.push(`Changed hunks (taken from the diff's @@ headers; ${headers.length} in total, at most 40 listed):`);
|
|
46326
|
+
}
|
|
46327
|
+
if (listed.length === 0) lines.push(input.lang === "zh" ? "(没有解析到 @@ 头:这份 diff 可能不是标准 unified 输出)" : "(no @@ header found: the diff may not be standard unified output)");
|
|
46328
|
+
lines.push(...listed);
|
|
46329
|
+
if (omitted > 0) lines.push(input.lang === "zh" ? `(另有 ${omitted} 处变更块未列出)` : `(${omitted} more hunks not listed)`);
|
|
46330
|
+
lines.push("");
|
|
46331
|
+
if (input.lang === "zh") lines.push(`获取完整内容:请读取 ${input.fullPath},或在该主机(${input.alias})的仓库根 ${input.root} 上自行执行 git diff / git show 取回完整差异,再用上面的 @@ 头定位。`);
|
|
46332
|
+
else lines.push(`Get the full text: read ${input.fullPath}, or run git diff / git show yourself in the repository root ${input.root} on host ${input.alias}, then use the @@ headers above as anchors.`);
|
|
46333
|
+
return lines;
|
|
46334
|
+
}
|
|
46335
|
+
/**
|
|
46336
|
+
* The no-text prompt: untracked and binary files have no diff to send, so the
|
|
46337
|
+
* model is asked to read the file and obtain the diff itself — never an empty
|
|
46338
|
+
* fenced block, which reads as "the change is empty".
|
|
46339
|
+
*/
|
|
46340
|
+
function pathOnlyBlock(input) {
|
|
46341
|
+
if (input.lang === "zh") return ["没有可内嵌的 diff 文本(未跟踪文件或二进制文件没有文本差异)。", `请在该主机上读取 ${input.fullPath} 并自行获取差异(git diff / git show),然后按下面的要求审查。`];
|
|
46342
|
+
return ["No diff text is available (an untracked or binary file has no textual diff).", `Read ${input.fullPath} on that host and obtain the diff yourself (git diff / git show), then review it against the requirements below.`];
|
|
46343
|
+
}
|
|
46344
|
+
/**
|
|
46345
|
+
* The prompt that goes into the composer draft.
|
|
46346
|
+
*
|
|
46347
|
+
* `mode` is what the caller decided (see {@link pickReviewMode}), but an empty
|
|
46348
|
+
* diff is normalized to `pathOnly` here as well: an empty file is not an empty
|
|
46349
|
+
* CHANGE, and an empty fenced block would answer the wrong question.
|
|
46350
|
+
*/
|
|
46351
|
+
function buildReviewPrompt(input) {
|
|
46352
|
+
const mode = input.diff === "" ? "pathOnly" : input.mode;
|
|
46353
|
+
const lines = [];
|
|
46354
|
+
if (input.capped) lines.push(cappedWarning(input.lang));
|
|
46355
|
+
lines.push(input.lang === "zh" ? "请审查下面这个文件的改动。" : "Please review the change to the file below.");
|
|
46356
|
+
lines.push("");
|
|
46357
|
+
lines.push(...contextLines(input));
|
|
46358
|
+
lines.push("");
|
|
46359
|
+
let body;
|
|
46360
|
+
if (mode === "full") body = fullBlock(input);
|
|
46361
|
+
else if (mode === "summary") body = summaryBlock(input);
|
|
46362
|
+
else body = pathOnlyBlock(input);
|
|
46363
|
+
lines.push(...body);
|
|
46364
|
+
lines.push("");
|
|
46365
|
+
lines.push(input.lang === "zh" ? "审查要求:" : "Review requirements:");
|
|
46366
|
+
lines.push(...reviewRules(input.lang));
|
|
46367
|
+
return lines.join("\n");
|
|
46368
|
+
}
|
|
46369
|
+
/** `A\tsrc/a.ts`, or `R\tsrc/a.ts → src/b.ts` for a rename. */
|
|
46370
|
+
function commitFileLine(file) {
|
|
46371
|
+
if (file.origPath === void 0 || file.origPath === file.path) return `${file.status}\t${file.path}`;
|
|
46372
|
+
return `${file.status}\t${file.origPath} → ${file.path}`;
|
|
46373
|
+
}
|
|
46374
|
+
/** The commit's identity and files, in both languages. */
|
|
46375
|
+
function commitFacts(input) {
|
|
46376
|
+
const lines = [];
|
|
46377
|
+
if (input.lang === "zh") {
|
|
46378
|
+
lines.push(`提交:${input.hash}`, `标题:${input.subject}`);
|
|
46379
|
+
if (input.body.trim() !== "") lines.push(`提交说明:\n${input.body.trim()}`);
|
|
46380
|
+
lines.push(`主机:${input.alias}`, `仓库根:${input.root}`);
|
|
46381
|
+
} else {
|
|
46382
|
+
lines.push(`Commit: ${input.hash}`, `Subject: ${input.subject}`);
|
|
46383
|
+
if (input.body.trim() !== "") lines.push(`Commit message:\n${input.body.trim()}`);
|
|
46384
|
+
lines.push(`Host: ${input.alias}`, `Repository root: ${input.root}`);
|
|
46385
|
+
}
|
|
46386
|
+
if (input.files.length === 0) return lines;
|
|
46387
|
+
const listed = input.files.slice(0, 100);
|
|
46388
|
+
const omitted = input.files.length - listed.length;
|
|
46389
|
+
lines.push("");
|
|
46390
|
+
lines.push(input.lang === "zh" ? `改动文件(${input.files.length} 个,最多列出 100 个):` : `Changed files (${input.files.length} total, at most 100 listed):`);
|
|
46391
|
+
lines.push(...listed.map(commitFileLine));
|
|
46392
|
+
if (omitted > 0) lines.push(input.lang === "zh" ? `(另有 ${omitted} 个文件未列出)` : `(${omitted} more files not listed)`);
|
|
46393
|
+
return lines;
|
|
46394
|
+
}
|
|
46395
|
+
/** The fenced, verbatim `git show --patch` body. */
|
|
46396
|
+
function commitFullBlock(input) {
|
|
46397
|
+
const intro = input.lang === "zh" ? "完整 patch:" : "Complete patch:";
|
|
46398
|
+
const body = input.patch.endsWith("\n") ? input.patch.slice(0, -1) : input.patch;
|
|
46399
|
+
const fence = diffFence(input.patch);
|
|
46400
|
+
return [
|
|
46401
|
+
intro,
|
|
46402
|
+
`${fence}diff`,
|
|
46403
|
+
body,
|
|
46404
|
+
fence
|
|
46405
|
+
];
|
|
46406
|
+
}
|
|
46407
|
+
/**
|
|
46408
|
+
* The size-reduced commit prompt: the file list above is the map, and the model
|
|
46409
|
+
* is told how to fetch the patch instead of being handed a truncated prefix.
|
|
46410
|
+
*/
|
|
46411
|
+
function commitSummaryBlock(input) {
|
|
46412
|
+
const hunks = hunkHeaders(input.patch).length;
|
|
46413
|
+
const bytes = diffByteLength(input.patch);
|
|
46414
|
+
if (input.lang === "zh") return [`patch 大小:${bytes} 字节,共 ${hunks} 处变更块${input.capped ? "(已被截断)" : `(超过 ${AI_REVIEW_MAX_BYTES} 字节的内嵌上限)`},所以没有内嵌全文。`, `获取完整内容:请在该主机(${input.alias})的仓库根 ${input.root} 上执行 git show ${input.hash} 取回完整 patch,必要时再逐个读取上面列出的文件。`];
|
|
46415
|
+
return [`Patch size: ${bytes} bytes, ${hunks} hunks${input.capped ? " (truncated)" : ` (above the ${AI_REVIEW_MAX_BYTES}-byte inline limit)`}, so the body is not included.`, `Get the full text: run git show ${input.hash} in the repository root ${input.root} on host ${input.alias}, then read the files listed above as needed.`];
|
|
46416
|
+
}
|
|
46417
|
+
/** The no-text commit prompt (empty commit, binary-only change, merge). */
|
|
46418
|
+
function commitPathOnlyBlock(input) {
|
|
46419
|
+
if (input.lang === "zh") return ["该提交没有可内嵌的文本 diff(可能是空提交、仅二进制改动或合并提交)。", `请在该主机(${input.alias})的仓库根 ${input.root} 上执行 git show ${input.hash} 查看完整改动,然后按下面的要求审查。`];
|
|
46420
|
+
return ["This commit has no inline textual diff (empty commit, binary-only change, or a merge).", `Run git show ${input.hash} in the repository root ${input.root} on host ${input.alias}, then review it against the requirements below.`];
|
|
46421
|
+
}
|
|
46422
|
+
/** One rule that only makes sense for a WHOLE commit (cross-file coherence). */
|
|
46423
|
+
function commitRule(lang) {
|
|
46424
|
+
if (lang === "zh") return "5. 以整个提交为单位:核对提交信息与改动是否一致,以及多个文件之间的关联改动是否有遗漏或不一致。";
|
|
46425
|
+
return "5. Review the commit as a whole: does the message match the change, and are the related edits across files consistent and complete?";
|
|
46426
|
+
}
|
|
46427
|
+
/**
|
|
46428
|
+
* The prompt for reviewing a WHOLE commit from the history pane (F6 v2).
|
|
46429
|
+
*
|
|
46430
|
+
* Same byte discipline as the single-file prompt (a capped `git show --patch`
|
|
46431
|
+
* must never be presented as the complete change), but the shape differs: a
|
|
46432
|
+
* commit is a set of files, so the facts list the files and the model is told
|
|
46433
|
+
* how to fetch the patch. `mode` is what the caller decided; an empty patch is
|
|
46434
|
+
* normalized to `pathOnly` here as well.
|
|
46435
|
+
*/
|
|
46436
|
+
function buildCommitReviewPrompt(input) {
|
|
46437
|
+
const mode = input.patch === "" ? "pathOnly" : input.mode;
|
|
46438
|
+
const lines = [];
|
|
46439
|
+
if (input.capped) lines.push(cappedWarning(input.lang));
|
|
46440
|
+
lines.push(input.lang === "zh" ? "请审查下面这个提交的改动。" : "Please review the changes in the commit below.");
|
|
46441
|
+
lines.push("");
|
|
46442
|
+
lines.push(...commitFacts(input));
|
|
46443
|
+
lines.push("");
|
|
46444
|
+
if (mode === "full") lines.push(...commitFullBlock(input));
|
|
46445
|
+
else if (mode === "summary") lines.push(...commitSummaryBlock(input));
|
|
46446
|
+
else lines.push(...commitPathOnlyBlock(input));
|
|
46447
|
+
lines.push("");
|
|
46448
|
+
lines.push(input.lang === "zh" ? "审查要求:" : "Review requirements:");
|
|
46449
|
+
lines.push(...reviewRules(input.lang), commitRule(input.lang));
|
|
46450
|
+
return lines.join("\n");
|
|
46451
|
+
}
|
|
46452
|
+
//#endregion
|
|
46023
46453
|
//#region src/client/scm/DiffView.tsx
|
|
46024
46454
|
/**
|
|
46025
46455
|
* Side-by-side diff: full file on both sides, real line numbers, added /
|
|
@@ -46353,6 +46783,25 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
46353
46783
|
const chat = useRemoteChatTarget(store.ctx);
|
|
46354
46784
|
const viewedAliasPath = store.workspace !== void 0 ? store.aliasPaths[store.workspace.id] : void 0;
|
|
46355
46785
|
const chatEnabled = chat.sessionId !== void 0 && chat.sessionWorkspacePath !== void 0 && viewedAliasPath !== void 0 && sameLocalDir(chat.sessionWorkspacePath, viewedAliasPath);
|
|
46786
|
+
/**
|
|
46787
|
+
* Why the "AI review" button cannot run, or `undefined` when it can.
|
|
46788
|
+
*
|
|
46789
|
+
* Three different absences, three different sentences, checked from the most
|
|
46790
|
+
* fundamental down:
|
|
46791
|
+
* - `store.ctx`: the shared store boots asynchronously, so before it lands
|
|
46792
|
+
* there is nothing to write into at all;
|
|
46793
|
+
* - `chatEnabled`: the same binding gate the selection popup uses — a prompt
|
|
46794
|
+
* that names a remote path means nothing in a session that does not live in
|
|
46795
|
+
* this binding;
|
|
46796
|
+
* - `canInsertDraft`: the conversation service is a SOFT, version-dependent
|
|
46797
|
+
* read. A host that does not expose it must say so up front instead of
|
|
46798
|
+
* failing on click with the "composer is busy" sentence, which would name
|
|
46799
|
+
* the wrong cause.
|
|
46800
|
+
*/
|
|
46801
|
+
let reviewBlocked;
|
|
46802
|
+
if (store.ctx === void 0) reviewBlocked = t("scm.aiReviewNoContext");
|
|
46803
|
+
else if (!chatEnabled || chat.sessionId === void 0) reviewBlocked = t("scm.aiReviewNoSession");
|
|
46804
|
+
else if (!canInsertDraft(store.ctx, chat.sessionId)) reviewBlocked = t("scm.aiReviewNoChannel");
|
|
46356
46805
|
(0, react.useEffect)(() => {
|
|
46357
46806
|
if (mode !== "after" || tab.staged || tab.text !== "" || tab.loading) return;
|
|
46358
46807
|
let cancelled = false;
|
|
@@ -46442,6 +46891,53 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
46442
46891
|
if (!await store.saveTab(tab.id, text)) return;
|
|
46443
46892
|
await store.reloadTab(tab.id);
|
|
46444
46893
|
};
|
|
46894
|
+
/**
|
|
46895
|
+
* Append an AI-review prompt for THIS tab's diff to the composer draft (F6).
|
|
46896
|
+
*
|
|
46897
|
+
* v1 stops at the DRAFT on purpose: `appendToDraft` is the only delivery
|
|
46898
|
+
* channel used here — no `submit`/`send` call — so the user always sees the
|
|
46899
|
+
* exact prompt (and can edit or discard it) before anything costs a turn. The
|
|
46900
|
+
* host does expose submit facades (see `docs/.feasibility/review.md` §2);
|
|
46901
|
+
* wiring them is a separate, opt-in feature.
|
|
46902
|
+
*
|
|
46903
|
+
* The prompt is built on CLICK, not during render: `diffByteLength` encodes
|
|
46904
|
+
* the whole diff and the prompt can be tens of kilobytes, which must not be
|
|
46905
|
+
* recomputed per frame while the user scrolls the diff.
|
|
46906
|
+
*/
|
|
46907
|
+
const reviewWithAi = () => {
|
|
46908
|
+
const ctx = store.ctx;
|
|
46909
|
+
const sessionId = chat.sessionId;
|
|
46910
|
+
if (reviewBlocked !== void 0 || ctx === void 0 || sessionId === void 0) {
|
|
46911
|
+
toast(reviewBlocked ?? t("scm.aiReviewNoSession"), true);
|
|
46912
|
+
return;
|
|
46913
|
+
}
|
|
46914
|
+
const diff = tab.diff?.diff ?? "";
|
|
46915
|
+
const bytes = diffByteLength(diff);
|
|
46916
|
+
const capped = bytes >= GIT_CAP;
|
|
46917
|
+
const mode = pickReviewMode({
|
|
46918
|
+
bytes,
|
|
46919
|
+
hasDiff: diff !== "",
|
|
46920
|
+
capped
|
|
46921
|
+
});
|
|
46922
|
+
if (!appendToDraft(ctx, sessionId, buildReviewPrompt({
|
|
46923
|
+
alias: store.alias,
|
|
46924
|
+
root: store.repoRoot ?? store.root,
|
|
46925
|
+
rel: tab.rel,
|
|
46926
|
+
fullPath: tab.fullPath,
|
|
46927
|
+
scope: reviewScopeOf(tab.staged, tab.ref),
|
|
46928
|
+
...tab.ref === void 0 ? {} : { commitRef: tab.ref },
|
|
46929
|
+
diff,
|
|
46930
|
+
mode,
|
|
46931
|
+
capped,
|
|
46932
|
+
lang
|
|
46933
|
+
}))) {
|
|
46934
|
+
toast(t("scm.aiReviewFailed"), true);
|
|
46935
|
+
return;
|
|
46936
|
+
}
|
|
46937
|
+
if (mode === "full") toast(t("scm.aiReviewAdded"));
|
|
46938
|
+
else if (mode === "summary") toast(t("scm.aiReviewAddedSummary"));
|
|
46939
|
+
else toast(t("scm.aiReviewAddedRead"));
|
|
46940
|
+
};
|
|
46445
46941
|
if (tab.error !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
46446
46942
|
className: "rvs-diff",
|
|
46447
46943
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -46551,6 +47047,17 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
46551
47047
|
]
|
|
46552
47048
|
}),
|
|
46553
47049
|
busy && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MiniSpinner, {}),
|
|
47050
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
47051
|
+
title: reviewBlocked ?? t("scm.aiReview"),
|
|
47052
|
+
onClick: reviewWithAi,
|
|
47053
|
+
disabled: reviewBlocked !== void 0,
|
|
47054
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
47055
|
+
className: "rvs-glyph",
|
|
47056
|
+
"aria-hidden": "true",
|
|
47057
|
+
style: { fontSize: 12 },
|
|
47058
|
+
children: "AI"
|
|
47059
|
+
})
|
|
47060
|
+
}),
|
|
46554
47061
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
46555
47062
|
title: t("scm.reloadDiff"),
|
|
46556
47063
|
onClick: () => {
|
|
@@ -47524,8 +48031,8 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
47524
48031
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConnectionStatusChip, { compact: true }),
|
|
47525
48032
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
47526
48033
|
className: "rvs-build",
|
|
47527
|
-
title: `dsh-remote-vs build
|
|
47528
|
-
children: "
|
|
48034
|
+
title: `dsh-remote-vs build 1103-1732`,
|
|
48035
|
+
children: "1103-1732"
|
|
47529
48036
|
}),
|
|
47530
48037
|
tokenCount !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
47531
48038
|
className: "rvs-build",
|
|
@@ -48817,6 +49324,824 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
48817
49324
|
}, task.id))
|
|
48818
49325
|
}), document.body);
|
|
48819
49326
|
}
|
|
49327
|
+
//#endregion
|
|
49328
|
+
//#region src/client/PortsView.tsx
|
|
49329
|
+
/**
|
|
49330
|
+
* Ports view: the `ssh -L` tunnels this client owns, plus a way to make more.
|
|
49331
|
+
*
|
|
49332
|
+
* Why a panel instead of a hidden command: a forward the panel does not show is
|
|
49333
|
+
* invisible state. The listener lives in the HOST process, so closing the
|
|
49334
|
+
* sidebar, switching hosts or reloading the page must not look like "the tunnel
|
|
49335
|
+
* is gone" while it still holds a local port. The list is therefore the Host's
|
|
49336
|
+
* own answer (a local-only read, polled), the rules the user created are
|
|
49337
|
+
* remembered by the BROWSER, and a reload restores them — the listener belongs
|
|
49338
|
+
* to the Host, the memory of why it exists belongs here.
|
|
49339
|
+
*
|
|
49340
|
+
* Two costs shape the polling: the forward list is a local JSON read (cheap, so
|
|
49341
|
+
* every 4 s while visible), whereas the listening-port probe runs a remote
|
|
49342
|
+
* command (`ss`/`netstat`) and is therefore rare: on mount, on an explicit
|
|
49343
|
+
* refresh, and once every 30 s.
|
|
49344
|
+
*/
|
|
49345
|
+
const ALIAS_KEY$1 = "dsh-remote-vs.ports.alias";
|
|
49346
|
+
const RULES_KEY = "dsh-remote-vs.portForwards";
|
|
49347
|
+
/** Local forward list: one loopback JSON call into the Host, no SSH. */
|
|
49348
|
+
const FORWARDS_POLL_MS = 4e3;
|
|
49349
|
+
/** Listening ports: one remote exec, so this stays deliberately rare. */
|
|
49350
|
+
const LISTEN_POLL_MS = 3e4;
|
|
49351
|
+
/**
|
|
49352
|
+
* The remote target a rule dials by default.
|
|
49353
|
+
*
|
|
49354
|
+
* `ssh -L` connects to the remote host first and then dials the target FROM
|
|
49355
|
+
* there, so the remote host's own loopback is where its services listen. The
|
|
49356
|
+
* same reasoning makes this the target for a one-click "forward this listening
|
|
49357
|
+
* port": a discovered `0.0.0.0` / `::` / `*` bind address is not a dialable
|
|
49358
|
+
* address at all.
|
|
49359
|
+
*/
|
|
49360
|
+
const DEFAULT_REMOTE_HOST = "127.0.0.1";
|
|
49361
|
+
/**
|
|
49362
|
+
* The remote address one discovered listener should be dialed at.
|
|
49363
|
+
*
|
|
49364
|
+
* A wildcard bind (`0.0.0.0` / `::` / `*`) is not a dialable address, and the
|
|
49365
|
+
* remote host's own loopback is what every such listener accepts; a socket
|
|
49366
|
+
* bound to a CONCRETE address (a specific interface address) must be dialed at
|
|
49367
|
+
* that address, because the loopback would simply not be listening there.
|
|
49368
|
+
*/
|
|
49369
|
+
function reachableHost(addr) {
|
|
49370
|
+
const bare = addr.startsWith("[") && addr.endsWith("]") ? addr.slice(1, -1) : addr;
|
|
49371
|
+
if (bare === "" || bare === "*" || bare === "0.0.0.0") return DEFAULT_REMOTE_HOST;
|
|
49372
|
+
if (bare === "::") return "::1";
|
|
49373
|
+
if (bare === "127.0.0.1") return DEFAULT_REMOTE_HOST;
|
|
49374
|
+
return bare;
|
|
49375
|
+
}
|
|
49376
|
+
/** True for an integer port in range; `allowAuto` admits the 0 "assign one" case. */
|
|
49377
|
+
function isPort(value, allowAuto = false) {
|
|
49378
|
+
if (typeof value !== "number" || !Number.isInteger(value)) return false;
|
|
49379
|
+
if (value > 65535) return false;
|
|
49380
|
+
return value >= (allowAuto ? 0 : 1);
|
|
49381
|
+
}
|
|
49382
|
+
/** Parse one port typed into the form; `undefined` for anything invalid. */
|
|
49383
|
+
function parsePort(text) {
|
|
49384
|
+
const trimmed = text.trim();
|
|
49385
|
+
if (!/^\d{1,5}$/.test(trimmed)) return void 0;
|
|
49386
|
+
const value = Number(trimmed);
|
|
49387
|
+
return isPort(value) ? value : void 0;
|
|
49388
|
+
}
|
|
49389
|
+
function errorText$2(error) {
|
|
49390
|
+
return error instanceof RemoteApiError ? error.message : String(error);
|
|
49391
|
+
}
|
|
49392
|
+
/**
|
|
49393
|
+
* `addr:port`, bracketing an IPv6 literal.
|
|
49394
|
+
*
|
|
49395
|
+
* The Host's parser strips the brackets from `[::]:22` (the conventional
|
|
49396
|
+
* spelling for display), so joining naively would print `:::22` — which reads
|
|
49397
|
+
* as a malformed address rather than as "port 22 on every v6 interface".
|
|
49398
|
+
*/
|
|
49399
|
+
function hostPort(addr, port) {
|
|
49400
|
+
return addr.includes(":") ? `[${addr}]:${port}` : `${addr}:${port}`;
|
|
49401
|
+
}
|
|
49402
|
+
function readAlias$1() {
|
|
49403
|
+
try {
|
|
49404
|
+
return localStorage.getItem(ALIAS_KEY$1) ?? "";
|
|
49405
|
+
} catch {
|
|
49406
|
+
return "";
|
|
49407
|
+
}
|
|
49408
|
+
}
|
|
49409
|
+
/**
|
|
49410
|
+
* Read the remembered rules, discarding anything that is not a valid rule.
|
|
49411
|
+
*
|
|
49412
|
+
* localStorage is shared with older builds and with the user's devtools, so a
|
|
49413
|
+
* malformed entry must cost that entry — never the whole list, and never a
|
|
49414
|
+
* `POST` built from garbage.
|
|
49415
|
+
*/
|
|
49416
|
+
function readRules() {
|
|
49417
|
+
let parsed;
|
|
49418
|
+
try {
|
|
49419
|
+
const raw = localStorage.getItem(RULES_KEY);
|
|
49420
|
+
if (raw === null) return {};
|
|
49421
|
+
parsed = JSON.parse(raw);
|
|
49422
|
+
} catch {
|
|
49423
|
+
return {};
|
|
49424
|
+
}
|
|
49425
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return {};
|
|
49426
|
+
const out = {};
|
|
49427
|
+
for (const [alias, rows] of Object.entries(parsed)) {
|
|
49428
|
+
if (!Array.isArray(rows)) continue;
|
|
49429
|
+
const rules = [];
|
|
49430
|
+
for (const row of rows) {
|
|
49431
|
+
if (typeof row !== "object" || row === null) continue;
|
|
49432
|
+
const { remoteHost, remotePort, localPort } = row;
|
|
49433
|
+
if (typeof remoteHost !== "string" || remoteHost === "") continue;
|
|
49434
|
+
if (!isPort(remotePort) || !isPort(localPort, true)) continue;
|
|
49435
|
+
rules.push({
|
|
49436
|
+
remoteHost,
|
|
49437
|
+
remotePort,
|
|
49438
|
+
localPort
|
|
49439
|
+
});
|
|
49440
|
+
}
|
|
49441
|
+
if (rules.length > 0) out[alias] = rules;
|
|
49442
|
+
}
|
|
49443
|
+
return out;
|
|
49444
|
+
}
|
|
49445
|
+
function writeRules(rules) {
|
|
49446
|
+
try {
|
|
49447
|
+
localStorage.setItem(RULES_KEY, JSON.stringify(rules));
|
|
49448
|
+
} catch {}
|
|
49449
|
+
}
|
|
49450
|
+
/** Remember one rule so the next mount can restore it. */
|
|
49451
|
+
function rememberRule(alias, rule) {
|
|
49452
|
+
const all = readRules();
|
|
49453
|
+
const rows = all[alias] ?? [];
|
|
49454
|
+
if (rows.some((row) => row.remoteHost === rule.remoteHost && row.remotePort === rule.remotePort && row.localPort === rule.localPort)) return;
|
|
49455
|
+
all[alias] = [...rows, rule];
|
|
49456
|
+
writeRules(all);
|
|
49457
|
+
}
|
|
49458
|
+
/**
|
|
49459
|
+
* Drop the saved rule behind one live forward.
|
|
49460
|
+
*
|
|
49461
|
+
* The id cannot be recomputed here for an auto-assigned port: the request said
|
|
49462
|
+
* "any", the Host answered with a number, so the saved rule's `localPort` is 0
|
|
49463
|
+
* while `forward.localPort` is real. Match the exact rule first, then the
|
|
49464
|
+
* auto-assign one, and remove exactly ONE line — a user may legitimately hold
|
|
49465
|
+
* two rules for the same remote port on two different local ports.
|
|
49466
|
+
*/
|
|
49467
|
+
function forgetRule(alias, forward) {
|
|
49468
|
+
const all = readRules();
|
|
49469
|
+
const rows = all[alias] ?? [];
|
|
49470
|
+
const sameTarget = (row) => row.remoteHost === forward.remoteHost && row.remotePort === forward.remotePort;
|
|
49471
|
+
const exact = rows.findIndex((row) => sameTarget(row) && row.localPort === forward.localPort);
|
|
49472
|
+
const auto = rows.findIndex((row) => sameTarget(row) && row.localPort === 0);
|
|
49473
|
+
const index = exact >= 0 ? exact : auto;
|
|
49474
|
+
if (index < 0) return;
|
|
49475
|
+
const next = rows.filter((_row, at) => at !== index);
|
|
49476
|
+
if (next.length === 0) delete all[alias];
|
|
49477
|
+
else all[alias] = next;
|
|
49478
|
+
writeRules(all);
|
|
49479
|
+
}
|
|
49480
|
+
/**
|
|
49481
|
+
* Drop one SAVED rule that never became a live forward.
|
|
49482
|
+
*
|
|
49483
|
+
* A restore can fail for reasons that do not go away by themselves (a fixed
|
|
49484
|
+
* local port now taken by another app, the per-alias rule ceiling): such a rule
|
|
49485
|
+
* has no live row to press "stop" on, so without this the banner would retry it
|
|
49486
|
+
* — and reappear — on every mount with no way out.
|
|
49487
|
+
*/
|
|
49488
|
+
function forgetStoredRule(alias, rule) {
|
|
49489
|
+
const all = readRules();
|
|
49490
|
+
const rows = all[alias] ?? [];
|
|
49491
|
+
const index = rows.findIndex((row) => row.remoteHost === rule.remoteHost && row.remotePort === rule.remotePort && row.localPort === rule.localPort);
|
|
49492
|
+
if (index < 0) return;
|
|
49493
|
+
const next = rows.filter((_row, at) => at !== index);
|
|
49494
|
+
if (next.length === 0) delete all[alias];
|
|
49495
|
+
else all[alias] = next;
|
|
49496
|
+
writeRules(all);
|
|
49497
|
+
}
|
|
49498
|
+
/**
|
|
49499
|
+
* Merge freshly created forwards into the rendered list.
|
|
49500
|
+
*
|
|
49501
|
+
* The 4 s poll REPLACES the list with the Host's truth, so a just-started rule
|
|
49502
|
+
* is shown immediately here and every list read that started before it is
|
|
49503
|
+
* invalidated by the caller (see `adoptForward`); otherwise a poll that left
|
|
49504
|
+
* before the POST landed would briefly erase the row the user just created.
|
|
49505
|
+
*/
|
|
49506
|
+
function mergeForwards(previous, added) {
|
|
49507
|
+
const merged = [...previous ?? []];
|
|
49508
|
+
for (const forward of added) {
|
|
49509
|
+
const index = merged.findIndex((item) => item.id === forward.id);
|
|
49510
|
+
if (index >= 0) merged[index] = forward;
|
|
49511
|
+
else merged.push(forward);
|
|
49512
|
+
}
|
|
49513
|
+
return merged;
|
|
49514
|
+
}
|
|
49515
|
+
/**
|
|
49516
|
+
* Rail icon: a plug. Kept here rather than in `vsc/kit.tsx` because it is the
|
|
49517
|
+
* only screen that draws one, and the shared icon set is a curated list.
|
|
49518
|
+
*/
|
|
49519
|
+
function IconPlug(props) {
|
|
49520
|
+
const size = props.size ?? 16;
|
|
49521
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
49522
|
+
width: size,
|
|
49523
|
+
height: size,
|
|
49524
|
+
viewBox: "0 0 16 16",
|
|
49525
|
+
fill: "none",
|
|
49526
|
+
stroke: "currentColor",
|
|
49527
|
+
strokeWidth: "1.4",
|
|
49528
|
+
strokeLinecap: "round",
|
|
49529
|
+
strokeLinejoin: "round",
|
|
49530
|
+
"aria-hidden": "true",
|
|
49531
|
+
children: [
|
|
49532
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M6 1.8v2.4M10 1.8v2.4" }),
|
|
49533
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 4.2h8v2a4 4 0 0 1-4 4 4 4 0 0 1-4-4Z" }),
|
|
49534
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M8 10.2v4" })
|
|
49535
|
+
]
|
|
49536
|
+
});
|
|
49537
|
+
}
|
|
49538
|
+
/** Local "leaves the page" mark for the open-in-browser link. */
|
|
49539
|
+
function IconExternal(props) {
|
|
49540
|
+
const size = props.size ?? 14;
|
|
49541
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
49542
|
+
width: size,
|
|
49543
|
+
height: size,
|
|
49544
|
+
viewBox: "0 0 16 16",
|
|
49545
|
+
fill: "none",
|
|
49546
|
+
stroke: "currentColor",
|
|
49547
|
+
strokeWidth: "1.4",
|
|
49548
|
+
strokeLinecap: "round",
|
|
49549
|
+
strokeLinejoin: "round",
|
|
49550
|
+
"aria-hidden": "true",
|
|
49551
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M6.6 3.4H3.4v9.2h9.2V9.4" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M9.2 2.6h4.2v4.2M13.4 2.6 8 8" })]
|
|
49552
|
+
});
|
|
49553
|
+
}
|
|
49554
|
+
function PortsView(props) {
|
|
49555
|
+
const t = props.t;
|
|
49556
|
+
const [alias, setAlias] = (0, react.useState)(readAlias$1);
|
|
49557
|
+
const [forwards, setForwards] = (0, react.useState)(void 0);
|
|
49558
|
+
const [forwardError, setForwardError] = (0, react.useState)(void 0);
|
|
49559
|
+
const [listen, setListen] = (0, react.useState)(void 0);
|
|
49560
|
+
const [listenError, setListenError] = (0, react.useState)(void 0);
|
|
49561
|
+
/** Rules that failed to come back after a reload (shown, never silently dropped). */
|
|
49562
|
+
const [restoreFailed, setRestoreFailed] = (0, react.useState)([]);
|
|
49563
|
+
/** The form's own failure, or a one-click forward's — one banner, one place. */
|
|
49564
|
+
const [actionError, setActionError] = (0, react.useState)(void 0);
|
|
49565
|
+
/**
|
|
49566
|
+
* What is in flight, keyed ('form', 'refresh', a forward id or a discovered
|
|
49567
|
+
* row). A Set, not one string: a second action must neither hide the first
|
|
49568
|
+
* one's spinner nor re-enable its button when it settles.
|
|
49569
|
+
*/
|
|
49570
|
+
const [busy, setBusy] = (0, react.useState)(() => /* @__PURE__ */ new Set());
|
|
49571
|
+
const [remoteHost, setRemoteHost] = (0, react.useState)(DEFAULT_REMOTE_HOST);
|
|
49572
|
+
const [remotePort, setRemotePort] = (0, react.useState)("");
|
|
49573
|
+
const [localPort, setLocalPort] = (0, react.useState)("");
|
|
49574
|
+
const markBusy = (0, react.useCallback)((key) => {
|
|
49575
|
+
setBusy((previous) => {
|
|
49576
|
+
if (previous.has(key)) return previous;
|
|
49577
|
+
const next = new Set(previous);
|
|
49578
|
+
next.add(key);
|
|
49579
|
+
return next;
|
|
49580
|
+
});
|
|
49581
|
+
}, []);
|
|
49582
|
+
const clearBusy = (0, react.useCallback)((key) => {
|
|
49583
|
+
setBusy((previous) => {
|
|
49584
|
+
if (!previous.has(key)) return previous;
|
|
49585
|
+
const next = new Set(previous);
|
|
49586
|
+
next.delete(key);
|
|
49587
|
+
return next;
|
|
49588
|
+
});
|
|
49589
|
+
}, []);
|
|
49590
|
+
const effectiveAlias = alias !== "" && props.hosts.some((host) => host.alias === alias) ? alias : props.hosts[0]?.alias ?? "";
|
|
49591
|
+
/**
|
|
49592
|
+
* Async answers must not land after unmount, and a host switch must not let
|
|
49593
|
+
* the previous host's answer win a race against the new one. `alive` covers
|
|
49594
|
+
* the first; the two sequence refs below cover the second.
|
|
49595
|
+
*/
|
|
49596
|
+
const alive = (0, react.useRef)(true);
|
|
49597
|
+
(0, react.useEffect)(() => {
|
|
49598
|
+
alive.current = true;
|
|
49599
|
+
return () => {
|
|
49600
|
+
alive.current = false;
|
|
49601
|
+
};
|
|
49602
|
+
}, []);
|
|
49603
|
+
const forwardSeq = (0, react.useRef)(0);
|
|
49604
|
+
const listenSeq = (0, react.useRef)(0);
|
|
49605
|
+
/**
|
|
49606
|
+
* The alias the panel is on NOW, for async code.
|
|
49607
|
+
*
|
|
49608
|
+
* The restore loop below is the one path that keeps working across a host
|
|
49609
|
+
* switch (each POST is already in flight); without this mirror it could adopt
|
|
49610
|
+
* another host's forward into the visible list. A ref, not the state, because
|
|
49611
|
+
* the loop must see the CURRENT pick, not the one captured when it started.
|
|
49612
|
+
*/
|
|
49613
|
+
const aliasRef = (0, react.useRef)(effectiveAlias);
|
|
49614
|
+
aliasRef.current = effectiveAlias;
|
|
49615
|
+
(0, react.useEffect)(() => {
|
|
49616
|
+
try {
|
|
49617
|
+
localStorage.setItem(ALIAS_KEY$1, effectiveAlias);
|
|
49618
|
+
} catch {}
|
|
49619
|
+
}, [effectiveAlias]);
|
|
49620
|
+
const reloadForwards = (0, react.useCallback)(async (host) => {
|
|
49621
|
+
if (host === "") return;
|
|
49622
|
+
const seq = ++forwardSeq.current;
|
|
49623
|
+
try {
|
|
49624
|
+
const list = await api.forwards(host);
|
|
49625
|
+
if (!alive.current || seq !== forwardSeq.current) return;
|
|
49626
|
+
setForwards(list);
|
|
49627
|
+
setForwardError(void 0);
|
|
49628
|
+
} catch (error) {
|
|
49629
|
+
if (!alive.current || seq !== forwardSeq.current) return;
|
|
49630
|
+
setForwardError(errorText$2(error));
|
|
49631
|
+
}
|
|
49632
|
+
}, []);
|
|
49633
|
+
const loadListen = (0, react.useCallback)(async (host) => {
|
|
49634
|
+
if (host === "") return;
|
|
49635
|
+
const seq = ++listenSeq.current;
|
|
49636
|
+
try {
|
|
49637
|
+
const result = await api.listenPorts(host);
|
|
49638
|
+
if (!alive.current || seq !== listenSeq.current) return;
|
|
49639
|
+
setListen(result);
|
|
49640
|
+
setListenError(void 0);
|
|
49641
|
+
} catch (error) {
|
|
49642
|
+
if (!alive.current || seq !== listenSeq.current) return;
|
|
49643
|
+
setListenError(errorText$2(error));
|
|
49644
|
+
}
|
|
49645
|
+
}, []);
|
|
49646
|
+
/**
|
|
49647
|
+
* A host switch starts from a blank slate.
|
|
49648
|
+
*
|
|
49649
|
+
* The previous host's forwards and ports are not this host's anything: showing
|
|
49650
|
+
* them under the new picker would invite the user to stop a tunnel they did
|
|
49651
|
+
* not see. They are re-fetched immediately by the effects below.
|
|
49652
|
+
*/
|
|
49653
|
+
(0, react.useEffect)(() => {
|
|
49654
|
+
setForwards(void 0);
|
|
49655
|
+
setForwardError(void 0);
|
|
49656
|
+
setListen(void 0);
|
|
49657
|
+
setListenError(void 0);
|
|
49658
|
+
setRestoreFailed([]);
|
|
49659
|
+
setActionError(void 0);
|
|
49660
|
+
}, [effectiveAlias]);
|
|
49661
|
+
(0, react.useEffect)(() => {
|
|
49662
|
+
if (!props.visible || effectiveAlias === "") return;
|
|
49663
|
+
reloadForwards(effectiveAlias);
|
|
49664
|
+
const timer = window.setInterval(() => {
|
|
49665
|
+
if (document.hidden) return;
|
|
49666
|
+
reloadForwards(effectiveAlias);
|
|
49667
|
+
}, FORWARDS_POLL_MS);
|
|
49668
|
+
return () => {
|
|
49669
|
+
forwardSeq.current += 1;
|
|
49670
|
+
window.clearInterval(timer);
|
|
49671
|
+
};
|
|
49672
|
+
}, [
|
|
49673
|
+
props.visible,
|
|
49674
|
+
effectiveAlias,
|
|
49675
|
+
reloadForwards
|
|
49676
|
+
]);
|
|
49677
|
+
(0, react.useEffect)(() => {
|
|
49678
|
+
if (!props.visible || effectiveAlias === "") return;
|
|
49679
|
+
loadListen(effectiveAlias);
|
|
49680
|
+
const timer = window.setInterval(() => {
|
|
49681
|
+
if (document.hidden) return;
|
|
49682
|
+
loadListen(effectiveAlias);
|
|
49683
|
+
}, LISTEN_POLL_MS);
|
|
49684
|
+
return () => {
|
|
49685
|
+
listenSeq.current += 1;
|
|
49686
|
+
window.clearInterval(timer);
|
|
49687
|
+
};
|
|
49688
|
+
}, [
|
|
49689
|
+
props.visible,
|
|
49690
|
+
effectiveAlias,
|
|
49691
|
+
loadListen
|
|
49692
|
+
]);
|
|
49693
|
+
/**
|
|
49694
|
+
* Show a just-created forward at once.
|
|
49695
|
+
*
|
|
49696
|
+
* Bumping the sequence invalidates a list read that left before the POST
|
|
49697
|
+
* landed: without it the 4 s poll could resolve with a list that predates the
|
|
49698
|
+
* new rule and erase the row for a full interval.
|
|
49699
|
+
*/
|
|
49700
|
+
const adoptForward = (0, react.useCallback)((forward) => {
|
|
49701
|
+
forwardSeq.current += 1;
|
|
49702
|
+
if (alive.current && forward.alias === aliasRef.current) setForwards((previous) => mergeForwards(previous, [forward]));
|
|
49703
|
+
}, []);
|
|
49704
|
+
/**
|
|
49705
|
+
* Restore the remembered rules for one host, once per mount.
|
|
49706
|
+
*
|
|
49707
|
+
* Once per host per mount, not on every visibility flip: a forward that fails
|
|
49708
|
+
* (the remote port is closed) would otherwise be retried on every rail switch,
|
|
49709
|
+
* costing an SSH channel each time and re-raising the same banner. The rules
|
|
49710
|
+
* are posted IN ORDER because the Host is the one place that knows whether a
|
|
49711
|
+
* local port is free — a parallel burst would race for the same port.
|
|
49712
|
+
*
|
|
49713
|
+
* The live list is read FIRST: reloading the page does not restart the Host,
|
|
49714
|
+
* so tunnels from before the reload are usually still listening and must not be
|
|
49715
|
+
* reported as "could not be restored" (a duplicate start is rejected).
|
|
49716
|
+
*/
|
|
49717
|
+
const restored = (0, react.useRef)(/* @__PURE__ */ new Set());
|
|
49718
|
+
(0, react.useEffect)(() => {
|
|
49719
|
+
if (!props.visible || effectiveAlias === "") return;
|
|
49720
|
+
if (restored.current.has(effectiveAlias)) return;
|
|
49721
|
+
restored.current.add(effectiveAlias);
|
|
49722
|
+
const rules = readRules()[effectiveAlias] ?? [];
|
|
49723
|
+
if (rules.length === 0) return;
|
|
49724
|
+
const host = effectiveAlias;
|
|
49725
|
+
(async () => {
|
|
49726
|
+
let live = [];
|
|
49727
|
+
try {
|
|
49728
|
+
live = await api.forwards(host);
|
|
49729
|
+
if (!alive.current || aliasRef.current !== host) return;
|
|
49730
|
+
setForwards((previous) => mergeForwards(previous, live));
|
|
49731
|
+
} catch {}
|
|
49732
|
+
const failed = [];
|
|
49733
|
+
for (const rule of rules) {
|
|
49734
|
+
if (!alive.current || aliasRef.current !== host) return;
|
|
49735
|
+
if (live.some((item) => item.remoteHost === rule.remoteHost && item.remotePort === rule.remotePort && (rule.localPort === 0 || item.localPort === rule.localPort))) continue;
|
|
49736
|
+
try {
|
|
49737
|
+
const forward = await api.startForward({
|
|
49738
|
+
alias: host,
|
|
49739
|
+
remoteHost: rule.remoteHost,
|
|
49740
|
+
remotePort: rule.remotePort,
|
|
49741
|
+
localPort: rule.localPort
|
|
49742
|
+
});
|
|
49743
|
+
adoptForward(forward);
|
|
49744
|
+
} catch {
|
|
49745
|
+
failed.push(rule);
|
|
49746
|
+
}
|
|
49747
|
+
}
|
|
49748
|
+
if (failed.length > 0 && alive.current && aliasRef.current === host) setRestoreFailed(failed);
|
|
49749
|
+
})();
|
|
49750
|
+
}, [
|
|
49751
|
+
props.visible,
|
|
49752
|
+
effectiveAlias,
|
|
49753
|
+
adoptForward
|
|
49754
|
+
]);
|
|
49755
|
+
const refresh = async () => {
|
|
49756
|
+
if (effectiveAlias === "") return;
|
|
49757
|
+
markBusy("refresh");
|
|
49758
|
+
try {
|
|
49759
|
+
await Promise.all([reloadForwards(effectiveAlias), loadListen(effectiveAlias)]);
|
|
49760
|
+
} finally {
|
|
49761
|
+
if (alive.current) clearBusy("refresh");
|
|
49762
|
+
}
|
|
49763
|
+
};
|
|
49764
|
+
const startManual = async () => {
|
|
49765
|
+
if (effectiveAlias === "") return;
|
|
49766
|
+
const targetPort = parsePort(remotePort);
|
|
49767
|
+
if (targetPort === void 0) {
|
|
49768
|
+
setActionError(t("ports.badPort"));
|
|
49769
|
+
return;
|
|
49770
|
+
}
|
|
49771
|
+
const trimmedLocal = localPort.trim();
|
|
49772
|
+
const requestedLocal = trimmedLocal === "" ? 0 : parsePort(trimmedLocal);
|
|
49773
|
+
if (requestedLocal === void 0) {
|
|
49774
|
+
setActionError(t("ports.badPort"));
|
|
49775
|
+
return;
|
|
49776
|
+
}
|
|
49777
|
+
const targetHost = remoteHost.trim() === "" ? DEFAULT_REMOTE_HOST : remoteHost.trim();
|
|
49778
|
+
markBusy("form");
|
|
49779
|
+
try {
|
|
49780
|
+
const forward = await api.startForward({
|
|
49781
|
+
alias: effectiveAlias,
|
|
49782
|
+
remoteHost: targetHost,
|
|
49783
|
+
remotePort: targetPort,
|
|
49784
|
+
localPort: requestedLocal
|
|
49785
|
+
});
|
|
49786
|
+
adoptForward(forward);
|
|
49787
|
+
rememberRule(effectiveAlias, {
|
|
49788
|
+
remoteHost: targetHost,
|
|
49789
|
+
remotePort: targetPort,
|
|
49790
|
+
localPort: requestedLocal
|
|
49791
|
+
});
|
|
49792
|
+
setActionError(void 0);
|
|
49793
|
+
setRemotePort("");
|
|
49794
|
+
setLocalPort("");
|
|
49795
|
+
} catch (error) {
|
|
49796
|
+
if (alive.current) setActionError(errorText$2(error));
|
|
49797
|
+
} finally {
|
|
49798
|
+
if (alive.current) clearBusy("form");
|
|
49799
|
+
}
|
|
49800
|
+
};
|
|
49801
|
+
/** One-click forward of a discovered port; the local port is auto-assigned. */
|
|
49802
|
+
const forwardDiscovered = async (port) => {
|
|
49803
|
+
if (effectiveAlias === "") return;
|
|
49804
|
+
const remoteHost = reachableHost(port.addr);
|
|
49805
|
+
const busyId = `listen:${port.addr}:${port.port}`;
|
|
49806
|
+
markBusy(busyId);
|
|
49807
|
+
try {
|
|
49808
|
+
const forward = await api.startForward({
|
|
49809
|
+
alias: effectiveAlias,
|
|
49810
|
+
remoteHost,
|
|
49811
|
+
remotePort: port.port,
|
|
49812
|
+
localPort: 0
|
|
49813
|
+
});
|
|
49814
|
+
adoptForward(forward);
|
|
49815
|
+
rememberRule(effectiveAlias, {
|
|
49816
|
+
remoteHost,
|
|
49817
|
+
remotePort: port.port,
|
|
49818
|
+
localPort: 0
|
|
49819
|
+
});
|
|
49820
|
+
setActionError(void 0);
|
|
49821
|
+
} catch (error) {
|
|
49822
|
+
if (alive.current) setActionError(errorText$2(error));
|
|
49823
|
+
} finally {
|
|
49824
|
+
if (alive.current) clearBusy(busyId);
|
|
49825
|
+
}
|
|
49826
|
+
};
|
|
49827
|
+
const stop = async (forward) => {
|
|
49828
|
+
markBusy(forward.id);
|
|
49829
|
+
try {
|
|
49830
|
+
await api.stopForward(forward.id);
|
|
49831
|
+
forwardSeq.current += 1;
|
|
49832
|
+
if (alive.current) setForwards((previous) => (previous ?? []).filter((item) => item.id !== forward.id));
|
|
49833
|
+
forgetRule(forward.alias, forward);
|
|
49834
|
+
setActionError(void 0);
|
|
49835
|
+
} catch (error) {
|
|
49836
|
+
if (alive.current) setActionError(errorText$2(error));
|
|
49837
|
+
} finally {
|
|
49838
|
+
if (alive.current) clearBusy(forward.id);
|
|
49839
|
+
}
|
|
49840
|
+
};
|
|
49841
|
+
const stateLabel = (forward) => forward.state === "error" ? t("ports.stateError") : t("ports.stateListening");
|
|
49842
|
+
const renderForwards = () => {
|
|
49843
|
+
if (effectiveAlias === "") return null;
|
|
49844
|
+
if (forwards === void 0) {
|
|
49845
|
+
if (forwardError !== void 0) return null;
|
|
49846
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49847
|
+
className: "rvs-empty",
|
|
49848
|
+
children: t("common.loading")
|
|
49849
|
+
});
|
|
49850
|
+
}
|
|
49851
|
+
if (forwards.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49852
|
+
className: "rvs-empty",
|
|
49853
|
+
children: t("ports.emptyForwards")
|
|
49854
|
+
});
|
|
49855
|
+
return forwards.map((forward) => {
|
|
49856
|
+
const label = stateLabel(forward);
|
|
49857
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49858
|
+
className: "rvs-ports-row",
|
|
49859
|
+
children: [
|
|
49860
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49861
|
+
className: "rvs-ports-line",
|
|
49862
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49863
|
+
className: `rvs-ports-dot ${forward.state}`,
|
|
49864
|
+
role: "img",
|
|
49865
|
+
"aria-label": label,
|
|
49866
|
+
title: label
|
|
49867
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
49868
|
+
className: "rvs-ports-addr",
|
|
49869
|
+
title: `${hostPort(forward.remoteHost, forward.remotePort)} → ${forward.localUrl}`,
|
|
49870
|
+
children: [
|
|
49871
|
+
hostPort(forward.remoteHost, forward.remotePort),
|
|
49872
|
+
" → ",
|
|
49873
|
+
forward.localUrl
|
|
49874
|
+
]
|
|
49875
|
+
})]
|
|
49876
|
+
}),
|
|
49877
|
+
forward.lastError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49878
|
+
className: "rvs-ports-err",
|
|
49879
|
+
children: forward.lastError
|
|
49880
|
+
}),
|
|
49881
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49882
|
+
className: "rvs-ports-actions",
|
|
49883
|
+
children: [
|
|
49884
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49885
|
+
className: "rvs-ports-conn",
|
|
49886
|
+
children: t("ports.connections").replace("{count}", String(forward.connections))
|
|
49887
|
+
}),
|
|
49888
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { style: { flex: 1 } }),
|
|
49889
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49890
|
+
title: t("ports.copyUrl"),
|
|
49891
|
+
onClick: () => {
|
|
49892
|
+
copyText$1(forward.localUrl).then(() => toast(t("ports.copied")));
|
|
49893
|
+
},
|
|
49894
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCopy, { size: 13 })
|
|
49895
|
+
}),
|
|
49896
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
49897
|
+
className: "rvs-hbtn rvs-ports-open",
|
|
49898
|
+
href: forward.localUrl,
|
|
49899
|
+
target: "_blank",
|
|
49900
|
+
rel: "noopener noreferrer",
|
|
49901
|
+
title: t("ports.open"),
|
|
49902
|
+
"aria-label": t("ports.open"),
|
|
49903
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconExternal, { size: 13 })
|
|
49904
|
+
}),
|
|
49905
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
49906
|
+
title: t("ports.stop"),
|
|
49907
|
+
danger: true,
|
|
49908
|
+
disabled: busy.has(forward.id),
|
|
49909
|
+
onClick: () => {
|
|
49910
|
+
stop(forward);
|
|
49911
|
+
},
|
|
49912
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStop, { size: 13 })
|
|
49913
|
+
})
|
|
49914
|
+
]
|
|
49915
|
+
})
|
|
49916
|
+
]
|
|
49917
|
+
}, forward.id);
|
|
49918
|
+
});
|
|
49919
|
+
};
|
|
49920
|
+
/** The "what did the probe find" half of the listening section. */
|
|
49921
|
+
const listenBody = (result) => {
|
|
49922
|
+
if (result.tool === "none") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49923
|
+
className: "rvs-empty",
|
|
49924
|
+
children: [t("ports.listenUnavailable"), result.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49925
|
+
className: "rvs-ports-hint",
|
|
49926
|
+
children: result.error
|
|
49927
|
+
})]
|
|
49928
|
+
});
|
|
49929
|
+
if (result.tool === "unknown") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49930
|
+
className: "rvs-empty",
|
|
49931
|
+
children: [t("ports.listenUnknown"), result.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49932
|
+
className: "rvs-ports-hint",
|
|
49933
|
+
children: result.error
|
|
49934
|
+
})]
|
|
49935
|
+
});
|
|
49936
|
+
if (result.ports.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49937
|
+
className: "rvs-empty",
|
|
49938
|
+
children: t("ports.emptyListen")
|
|
49939
|
+
});
|
|
49940
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [result.ports.map((port) => {
|
|
49941
|
+
const busyId = `listen:${port.addr}:${port.port}`;
|
|
49942
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49943
|
+
className: "rvs-ports-row",
|
|
49944
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49945
|
+
className: "rvs-ports-line",
|
|
49946
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49947
|
+
className: "rvs-ports-addr",
|
|
49948
|
+
children: hostPort(port.addr, port.port)
|
|
49949
|
+
}), port.process !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49950
|
+
className: "rvs-ports-proc",
|
|
49951
|
+
title: port.process,
|
|
49952
|
+
children: port.process
|
|
49953
|
+
})]
|
|
49954
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49955
|
+
className: "rvs-ports-actions",
|
|
49956
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { style: { flex: 1 } }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
49957
|
+
type: "button",
|
|
49958
|
+
className: "rvs-chip",
|
|
49959
|
+
disabled: busy.has(busyId),
|
|
49960
|
+
onClick: () => {
|
|
49961
|
+
forwardDiscovered(port);
|
|
49962
|
+
},
|
|
49963
|
+
children: t("ports.forward")
|
|
49964
|
+
})]
|
|
49965
|
+
})]
|
|
49966
|
+
}, `${port.addr}:${port.port}`);
|
|
49967
|
+
}), result.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49968
|
+
className: "rvs-ports-hint",
|
|
49969
|
+
children: result.error
|
|
49970
|
+
})] });
|
|
49971
|
+
};
|
|
49972
|
+
const renderListen = () => {
|
|
49973
|
+
if (effectiveAlias === "") return null;
|
|
49974
|
+
if (listen === void 0) {
|
|
49975
|
+
if (listenError !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49976
|
+
className: "rvs-banner error",
|
|
49977
|
+
children: listenError
|
|
49978
|
+
});
|
|
49979
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49980
|
+
className: "rvs-empty",
|
|
49981
|
+
children: t("common.loading")
|
|
49982
|
+
});
|
|
49983
|
+
}
|
|
49984
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [listenBody(listen), listenError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49985
|
+
className: "rvs-ports-hint",
|
|
49986
|
+
children: listenError
|
|
49987
|
+
})] });
|
|
49988
|
+
};
|
|
49989
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49990
|
+
className: "rvs-pane grow",
|
|
49991
|
+
children: [
|
|
49992
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49993
|
+
className: "rvs-header",
|
|
49994
|
+
children: [
|
|
49995
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49996
|
+
className: "rvs-title",
|
|
49997
|
+
children: t("tab.ports")
|
|
49998
|
+
}),
|
|
49999
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
50000
|
+
className: "rvs-select",
|
|
50001
|
+
value: effectiveAlias,
|
|
50002
|
+
onChange: (e) => setAlias(e.target.value),
|
|
50003
|
+
disabled: props.hosts.length === 0,
|
|
50004
|
+
title: t("ports.selectHost"),
|
|
50005
|
+
style: {
|
|
50006
|
+
flex: 1,
|
|
50007
|
+
minWidth: 90
|
|
50008
|
+
},
|
|
50009
|
+
children: props.hosts.map((host) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
|
|
50010
|
+
value: host.alias,
|
|
50011
|
+
style: optionStyle,
|
|
50012
|
+
children: [
|
|
50013
|
+
host.alias,
|
|
50014
|
+
" (",
|
|
50015
|
+
host.user,
|
|
50016
|
+
"@",
|
|
50017
|
+
host.host,
|
|
50018
|
+
")"
|
|
50019
|
+
]
|
|
50020
|
+
}, host.alias))
|
|
50021
|
+
}),
|
|
50022
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
50023
|
+
title: t("ports.refresh"),
|
|
50024
|
+
onClick: () => {
|
|
50025
|
+
refresh();
|
|
50026
|
+
},
|
|
50027
|
+
disabled: effectiveAlias === "" || busy.has("refresh"),
|
|
50028
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconRefresh, { size: 14 })
|
|
50029
|
+
})
|
|
50030
|
+
]
|
|
50031
|
+
}),
|
|
50032
|
+
props.hosts.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
50033
|
+
className: "rvs-banner warn",
|
|
50034
|
+
children: t("ports.noHosts")
|
|
50035
|
+
}),
|
|
50036
|
+
forwardError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
50037
|
+
className: "rvs-banner error",
|
|
50038
|
+
children: forwardError
|
|
50039
|
+
}),
|
|
50040
|
+
restoreFailed.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
50041
|
+
className: "rvs-banner warn rvs-ports-restore",
|
|
50042
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("ports.restoreFailed").replace("{count}", String(restoreFailed.length)) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
50043
|
+
type: "button",
|
|
50044
|
+
className: "rvs-chip",
|
|
50045
|
+
onClick: () => {
|
|
50046
|
+
for (const rule of restoreFailed) forgetStoredRule(effectiveAlias, rule);
|
|
50047
|
+
setRestoreFailed([]);
|
|
50048
|
+
},
|
|
50049
|
+
children: t("ports.forgetFailed")
|
|
50050
|
+
})]
|
|
50051
|
+
}),
|
|
50052
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
50053
|
+
className: "rvs-ports-body",
|
|
50054
|
+
children: [
|
|
50055
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
50056
|
+
className: "rvs-ports-form",
|
|
50057
|
+
onSubmit: (event) => {
|
|
50058
|
+
event.preventDefault();
|
|
50059
|
+
startManual();
|
|
50060
|
+
},
|
|
50061
|
+
children: [
|
|
50062
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
50063
|
+
className: "rvs-ports-hint",
|
|
50064
|
+
children: t("ports.remoteHostHint")
|
|
50065
|
+
}),
|
|
50066
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
50067
|
+
className: "rvs-ports-field",
|
|
50068
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
50069
|
+
className: "rvs-ports-label",
|
|
50070
|
+
children: t("ports.remoteHost")
|
|
50071
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
50072
|
+
className: "rvs-input rvs-ports-input",
|
|
50073
|
+
value: remoteHost,
|
|
50074
|
+
spellCheck: false,
|
|
50075
|
+
autoComplete: "off",
|
|
50076
|
+
onChange: (e) => setRemoteHost(e.target.value)
|
|
50077
|
+
})]
|
|
50078
|
+
}),
|
|
50079
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
50080
|
+
className: "rvs-ports-field",
|
|
50081
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
50082
|
+
className: "rvs-ports-label",
|
|
50083
|
+
children: t("ports.remotePort")
|
|
50084
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
50085
|
+
className: "rvs-input rvs-ports-input",
|
|
50086
|
+
value: remotePort,
|
|
50087
|
+
inputMode: "numeric",
|
|
50088
|
+
spellCheck: false,
|
|
50089
|
+
autoComplete: "off",
|
|
50090
|
+
placeholder: "5432",
|
|
50091
|
+
onChange: (e) => setRemotePort(e.target.value)
|
|
50092
|
+
})]
|
|
50093
|
+
}),
|
|
50094
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
50095
|
+
className: "rvs-ports-field",
|
|
50096
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
50097
|
+
className: "rvs-ports-label",
|
|
50098
|
+
children: t("ports.localPort")
|
|
50099
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
50100
|
+
className: "rvs-input rvs-ports-input",
|
|
50101
|
+
value: localPort,
|
|
50102
|
+
inputMode: "numeric",
|
|
50103
|
+
spellCheck: false,
|
|
50104
|
+
autoComplete: "off",
|
|
50105
|
+
onChange: (e) => setLocalPort(e.target.value)
|
|
50106
|
+
})]
|
|
50107
|
+
}),
|
|
50108
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
50109
|
+
className: "rvs-ports-form-actions",
|
|
50110
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
50111
|
+
type: "submit",
|
|
50112
|
+
className: "rvs-chip primary",
|
|
50113
|
+
disabled: effectiveAlias === "" || busy.has("form"),
|
|
50114
|
+
children: t("ports.add")
|
|
50115
|
+
})
|
|
50116
|
+
})
|
|
50117
|
+
]
|
|
50118
|
+
}),
|
|
50119
|
+
actionError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
50120
|
+
className: "rvs-banner error",
|
|
50121
|
+
children: actionError
|
|
50122
|
+
}),
|
|
50123
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
50124
|
+
className: "rvs-ports-section",
|
|
50125
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
50126
|
+
className: "rvs-ports-sec-head",
|
|
50127
|
+
children: [t("ports.active"), forwards !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
50128
|
+
className: "rvs-ports-count",
|
|
50129
|
+
children: forwards.length
|
|
50130
|
+
})]
|
|
50131
|
+
}), renderForwards()]
|
|
50132
|
+
}),
|
|
50133
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
50134
|
+
className: "rvs-ports-section",
|
|
50135
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
50136
|
+
className: "rvs-ports-sec-head",
|
|
50137
|
+
children: t("ports.listening")
|
|
50138
|
+
}), renderListen()]
|
|
50139
|
+
})
|
|
50140
|
+
]
|
|
50141
|
+
})
|
|
50142
|
+
]
|
|
50143
|
+
});
|
|
50144
|
+
}
|
|
48820
50145
|
/** localStorage key: `{ [alias]: string[] }`. Prefix kept for the panel's own data. */
|
|
48821
50146
|
const QUICKOPEN_RECENT_KEY = "dsh-remote-vs.recentFiles";
|
|
48822
50147
|
/**
|
|
@@ -49766,6 +51091,51 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
49766
51091
|
function moveToCommand(from, intoDir, name) {
|
|
49767
51092
|
return `mv -- ${shQuote(assertAbsPath(from))} ${name === void 0 ? `${shQuote(assertAbsPath(intoDir))}/` : shQuote(joinAbs(intoDir, name))}`;
|
|
49768
51093
|
}
|
|
51094
|
+
/**
|
|
51095
|
+
* Build one expander.
|
|
51096
|
+
*
|
|
51097
|
+
* @param onExpand - called ONCE per rest, after the delay, with the directory
|
|
51098
|
+
* that was still hovered when the timer fired.
|
|
51099
|
+
* @param scheduler - timer implementation (see {@link DragExpandScheduler}).
|
|
51100
|
+
* @param delayMs - rest time; defaults to {@link DRAG_EXPAND_DELAY_MS}.
|
|
51101
|
+
*/
|
|
51102
|
+
function createDragExpander(onExpand, scheduler, delayMs = 650) {
|
|
51103
|
+
/** The directory a timer is running for; undefined = idle. */
|
|
51104
|
+
let candidate;
|
|
51105
|
+
/** The pending timer handle, or undefined when idle. */
|
|
51106
|
+
let timer;
|
|
51107
|
+
const clear = () => {
|
|
51108
|
+
if (timer !== void 0) {
|
|
51109
|
+
scheduler.clear(timer);
|
|
51110
|
+
timer = void 0;
|
|
51111
|
+
}
|
|
51112
|
+
};
|
|
51113
|
+
return {
|
|
51114
|
+
hover(dir) {
|
|
51115
|
+
if (candidate === dir && timer !== void 0) return;
|
|
51116
|
+
clear();
|
|
51117
|
+
candidate = dir;
|
|
51118
|
+
timer = scheduler.set(() => {
|
|
51119
|
+
if (candidate !== dir) return;
|
|
51120
|
+
candidate = void 0;
|
|
51121
|
+
timer = void 0;
|
|
51122
|
+
onExpand(dir);
|
|
51123
|
+
}, delayMs);
|
|
51124
|
+
},
|
|
51125
|
+
leave(dir) {
|
|
51126
|
+
if (candidate !== dir) return;
|
|
51127
|
+
clear();
|
|
51128
|
+
candidate = void 0;
|
|
51129
|
+
},
|
|
51130
|
+
reset() {
|
|
51131
|
+
clear();
|
|
51132
|
+
candidate = void 0;
|
|
51133
|
+
},
|
|
51134
|
+
pending() {
|
|
51135
|
+
return candidate;
|
|
51136
|
+
}
|
|
51137
|
+
};
|
|
51138
|
+
}
|
|
49769
51139
|
//#endregion
|
|
49770
51140
|
//#region src/client/listing-requests.ts
|
|
49771
51141
|
var ListingRequests = class {
|
|
@@ -50571,6 +51941,29 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
50571
51941
|
const uploadAbort = (0, react.useRef)(void 0);
|
|
50572
51942
|
/** True while a remote WRITE batch is in flight (upload/paste/delete serialization). */
|
|
50573
51943
|
const transferRef = (0, react.useRef)(false);
|
|
51944
|
+
/**
|
|
51945
|
+
* `expanded` readable SYNCHRONOUSLY by the window-capture drag listeners.
|
|
51946
|
+
*
|
|
51947
|
+
* Those listeners live outside React's tree and are re-attached per binding,
|
|
51948
|
+
* so reading the state value from inside them would be one render stale; the
|
|
51949
|
+
* spring-load decision ("is this directory already open?") has to answer for
|
|
51950
|
+
* the tree as the pointer sees it.
|
|
51951
|
+
*/
|
|
51952
|
+
const expandedRef = (0, react.useRef)(expanded);
|
|
51953
|
+
expandedRef.current = expanded;
|
|
51954
|
+
/** The latest {@link springOpen}; the expander below is created once and reads through. */
|
|
51955
|
+
const springOpenRef = (0, react.useRef)(() => void 0);
|
|
51956
|
+
/**
|
|
51957
|
+
* Spring-loaded folders (see `drag-expand.ts`): one instance per mounted
|
|
51958
|
+
* panel. Both drag paths feed it — the row's own `onDragOver` (our rows =
|
|
51959
|
+
* move) and the window-capture `dragover` (OS files = upload) — because those
|
|
51960
|
+
* are two different event deliveries, not one.
|
|
51961
|
+
*/
|
|
51962
|
+
const dragExpand = (0, react.useRef)(void 0);
|
|
51963
|
+
if (dragExpand.current === void 0) dragExpand.current = createDragExpander((dir) => springOpenRef.current(dir), {
|
|
51964
|
+
set: (callback, ms) => window.setTimeout(callback, ms),
|
|
51965
|
+
clear: (handle) => window.clearTimeout(handle)
|
|
51966
|
+
});
|
|
50574
51967
|
/** Last handled "show this folder" request id (see `shouldConsumeReveal`). */
|
|
50575
51968
|
const lastRevealId = (0, react.useRef)(0);
|
|
50576
51969
|
const menu = useContextMenu();
|
|
@@ -50603,19 +51996,28 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
50603
51996
|
const listingsApi = (0, react.useMemo)(() => new ListingRequests((dir) => dirKey(alias, dir), (dir) => api.fileOp.list(alias, dir), (key, entries) => {
|
|
50604
51997
|
if (alive.current && aliasRef.current === alias) setListings((prev) => withListing(prev, key, entries));
|
|
50605
51998
|
}), [alias]);
|
|
50606
|
-
|
|
50607
|
-
|
|
50608
|
-
|
|
51999
|
+
/**
|
|
52000
|
+
* List one directory into the tree cache.
|
|
52001
|
+
*
|
|
52002
|
+
* @returns whether the listing landed. Callers that act on the RESULT (the
|
|
52003
|
+
* spring-loaded expand, which has to collapse a directory it could not read)
|
|
52004
|
+
* need it; the many refresh callers ignore it.
|
|
52005
|
+
*/
|
|
52006
|
+
const loadDir = (0, react.useCallback)(async (dir, force = false, silent = false) => {
|
|
52007
|
+
if (alias === "") return false;
|
|
52008
|
+
if (offline) return false;
|
|
50609
52009
|
const key = dirKey(alias, dir);
|
|
50610
52010
|
setLoading((prev) => {
|
|
50611
52011
|
const next = new Set(prev);
|
|
50612
52012
|
next.add(key);
|
|
50613
52013
|
return next;
|
|
50614
52014
|
});
|
|
52015
|
+
let listed = false;
|
|
50615
52016
|
try {
|
|
50616
52017
|
await listingsApi.request(dir, revisionRef.current, force);
|
|
52018
|
+
listed = true;
|
|
50617
52019
|
} catch (error) {
|
|
50618
|
-
if (!isConnectionFailure(error)) toast(error instanceof Error ? error.message : String(error), true);
|
|
52020
|
+
if (!silent && !isConnectionFailure(error)) toast(error instanceof Error ? error.message : String(error), true);
|
|
50619
52021
|
} finally {
|
|
50620
52022
|
setLoading((prev) => {
|
|
50621
52023
|
const next = new Set(prev);
|
|
@@ -50623,6 +52025,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
50623
52025
|
return next;
|
|
50624
52026
|
});
|
|
50625
52027
|
}
|
|
52028
|
+
return listed;
|
|
50626
52029
|
}, [
|
|
50627
52030
|
alias,
|
|
50628
52031
|
listingsApi,
|
|
@@ -50762,10 +52165,19 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
50762
52165
|
alive.current = true;
|
|
50763
52166
|
return () => {
|
|
50764
52167
|
alive.current = false;
|
|
52168
|
+
dragExpand.current?.reset();
|
|
50765
52169
|
if (prefetchTimer.current !== void 0) window.clearTimeout(prefetchTimer.current);
|
|
50766
52170
|
};
|
|
50767
52171
|
}, []);
|
|
50768
52172
|
/**
|
|
52173
|
+
* A binding change invalidates every drag candidate: `expanded` is re-keyed to
|
|
52174
|
+
* the new workspace, so a countdown armed on the old tree could open a path
|
|
52175
|
+
* that does not even exist on the host now bound.
|
|
52176
|
+
*/
|
|
52177
|
+
(0, react.useEffect)(() => {
|
|
52178
|
+
dragExpand.current?.reset();
|
|
52179
|
+
}, [alias, root]);
|
|
52180
|
+
/**
|
|
50769
52181
|
* One directory's visible, sorted rows, cached for the life of one
|
|
50770
52182
|
* `listings`/`showHidden`/`alias` combination.
|
|
50771
52183
|
*
|
|
@@ -50811,6 +52223,29 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
50811
52223
|
});
|
|
50812
52224
|
if (!isOpen) loadDir(entry.path);
|
|
50813
52225
|
};
|
|
52226
|
+
springOpenRef.current = (0, react.useCallback)((dir) => {
|
|
52227
|
+
if (dir === "" || offline) return;
|
|
52228
|
+
setExpanded((prev) => {
|
|
52229
|
+
if (prev.has(dir)) return prev;
|
|
52230
|
+
const next = new Set(prev);
|
|
52231
|
+
next.add(dir);
|
|
52232
|
+
return next;
|
|
52233
|
+
});
|
|
52234
|
+
loadDir(dir, true, true).then((listed) => {
|
|
52235
|
+
if (listed) return;
|
|
52236
|
+
if (listingsRef.current[dirKey(alias, dir)] !== void 0) return;
|
|
52237
|
+
setExpanded((prev) => {
|
|
52238
|
+
if (!prev.has(dir)) return prev;
|
|
52239
|
+
const next = new Set(prev);
|
|
52240
|
+
next.delete(dir);
|
|
52241
|
+
return next;
|
|
52242
|
+
});
|
|
52243
|
+
});
|
|
52244
|
+
}, [
|
|
52245
|
+
alias,
|
|
52246
|
+
offline,
|
|
52247
|
+
loadDir
|
|
52248
|
+
]);
|
|
50814
52249
|
/** Open one path: previews for images, diffs for changed text files. */
|
|
50815
52250
|
const openEntry = (0, react.useCallback)((entry) => {
|
|
50816
52251
|
if (entry.isDir) {
|
|
@@ -51410,19 +52845,56 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
51410
52845
|
event.stopPropagation();
|
|
51411
52846
|
if (event.dataTransfer !== null) event.dataTransfer.dropEffect = "copy";
|
|
51412
52847
|
};
|
|
52848
|
+
/**
|
|
52849
|
+
* The DIRECTORY row under the pointer, or undefined.
|
|
52850
|
+
*
|
|
52851
|
+
* Same hit stack as `dropDirFromEvent` (the shell paints a full-screen
|
|
52852
|
+
* "drop here" overlay during a file drag, so `event.target` is that
|
|
52853
|
+
* overlay, never the row), but this one answers "which closed directory is
|
|
52854
|
+
* the pointer resting on" for spring-loading. A FILE row answers undefined:
|
|
52855
|
+
* a drop there lands in its parent directory, which is already open.
|
|
52856
|
+
*/
|
|
52857
|
+
const hoverDirOf = (event) => {
|
|
52858
|
+
const point = pointerOf(event);
|
|
52859
|
+
if (point === void 0) return void 0;
|
|
52860
|
+
for (const element of document.elementsFromPoint(point.x, point.y)) {
|
|
52861
|
+
const row = element.closest("[data-rvs-path]");
|
|
52862
|
+
if (row === null) continue;
|
|
52863
|
+
const path = row.getAttribute("data-rvs-path") ?? "";
|
|
52864
|
+
if (path === "") continue;
|
|
52865
|
+
return row.getAttribute("data-rvs-dir") === "1" ? path : void 0;
|
|
52866
|
+
}
|
|
52867
|
+
};
|
|
52868
|
+
/**
|
|
52869
|
+
* Feed the spring-load expander from an OS-file drag.
|
|
52870
|
+
*
|
|
52871
|
+
* `dragover` fires continuously while the pointer rests, which is exactly
|
|
52872
|
+
* the signal the expander wants: it ignores a repeat for the row already
|
|
52873
|
+
* counting down and only restarts when the pointer moves to another row.
|
|
52874
|
+
* RESET rather than `leave` on a file row or the pane background: the
|
|
52875
|
+
* pointer left the candidate and there is no path to name it by here.
|
|
52876
|
+
*/
|
|
52877
|
+
const trackHover = (event) => {
|
|
52878
|
+
const dir = hoverDirOf(event);
|
|
52879
|
+
if (dir !== void 0 && !expandedRef.current.has(dir)) dragExpand.current?.hover(dir);
|
|
52880
|
+
else dragExpand.current?.reset();
|
|
52881
|
+
};
|
|
51413
52882
|
const onDragEnter = (event) => {
|
|
51414
52883
|
if (!isFileDrag(event.dataTransfer) || !overPane(event)) return;
|
|
51415
52884
|
claim(event);
|
|
51416
52885
|
setDropTarget(root);
|
|
51417
52886
|
setDropHint(root);
|
|
52887
|
+
trackHover(event);
|
|
51418
52888
|
};
|
|
51419
52889
|
const onDragOver = (event) => {
|
|
51420
52890
|
if (!isFileDrag(event.dataTransfer) || !overPane(event)) return;
|
|
51421
52891
|
claim(event);
|
|
51422
52892
|
setDropTarget(root);
|
|
51423
52893
|
setDropHint(root);
|
|
52894
|
+
trackHover(event);
|
|
51424
52895
|
};
|
|
51425
52896
|
const onDrop = (event) => {
|
|
52897
|
+
dragExpand.current?.reset();
|
|
51426
52898
|
dropLog("drop", {
|
|
51427
52899
|
types: event.dataTransfer === null ? null : [...event.dataTransfer.types],
|
|
51428
52900
|
overPane: overPane(event),
|
|
@@ -51442,7 +52914,21 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
51442
52914
|
});
|
|
51443
52915
|
};
|
|
51444
52916
|
const onDragLeave = (event) => {
|
|
51445
|
-
if (overPane(event)) return;
|
|
52917
|
+
if (overPane(event) && event.relatedTarget !== null) return;
|
|
52918
|
+
dragExpand.current?.reset();
|
|
52919
|
+
setDropTarget(void 0);
|
|
52920
|
+
setDropHint(void 0);
|
|
52921
|
+
};
|
|
52922
|
+
/**
|
|
52923
|
+
* The end of a drag whose SOURCE is in this document (our tree rows): a
|
|
52924
|
+
* drop, Esc, or a drop outside the pane. OS-file drags end in
|
|
52925
|
+
* `onDragLeave` instead (see there). Clearing `dragPaths` matters because a
|
|
52926
|
+
* cancelled move leaves the old selection in it, and the next drag would
|
|
52927
|
+
* then treat a stale row as its move source.
|
|
52928
|
+
*/
|
|
52929
|
+
const onDragEnd = () => {
|
|
52930
|
+
dragExpand.current?.reset();
|
|
52931
|
+
dragPaths.current = [];
|
|
51446
52932
|
setDropTarget(void 0);
|
|
51447
52933
|
setDropHint(void 0);
|
|
51448
52934
|
};
|
|
@@ -51450,11 +52936,14 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
51450
52936
|
window.addEventListener("dragover", onDragOver, true);
|
|
51451
52937
|
window.addEventListener("drop", onDrop, true);
|
|
51452
52938
|
window.addEventListener("dragleave", onDragLeave, true);
|
|
52939
|
+
window.addEventListener("dragend", onDragEnd, true);
|
|
51453
52940
|
return () => {
|
|
52941
|
+
dragExpand.current?.reset();
|
|
51454
52942
|
window.removeEventListener("dragenter", onDragEnter, true);
|
|
51455
52943
|
window.removeEventListener("dragover", onDragOver, true);
|
|
51456
52944
|
window.removeEventListener("drop", onDrop, true);
|
|
51457
52945
|
window.removeEventListener("dragleave", onDragLeave, true);
|
|
52946
|
+
window.removeEventListener("dragend", onDragEnd, true);
|
|
51458
52947
|
};
|
|
51459
52948
|
}, [
|
|
51460
52949
|
root,
|
|
@@ -51797,17 +53286,22 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
51797
53286
|
setDropHint(entry.isDir ? entry.path : entry.path.split("/").slice(0, -1).join("/") || "/");
|
|
51798
53287
|
return;
|
|
51799
53288
|
}
|
|
51800
|
-
if (!entry.isDir) return;
|
|
51801
53289
|
const source = dragPaths.current[0];
|
|
51802
|
-
if (source
|
|
51803
|
-
|
|
51804
|
-
|
|
51805
|
-
|
|
53290
|
+
if (entry.isDir && source !== void 0 && e.dataTransfer !== null && [...e.dataTransfer.types].includes("text/plain") && entry.path !== source && !entry.path.startsWith(`${source}/`)) {
|
|
53291
|
+
e.preventDefault();
|
|
53292
|
+
setDropTarget(entry.path);
|
|
53293
|
+
if (expanded.has(entry.path)) dragExpand.current?.reset();
|
|
53294
|
+
else dragExpand.current?.hover(entry.path);
|
|
53295
|
+
return;
|
|
53296
|
+
}
|
|
53297
|
+
dragExpand.current?.reset();
|
|
51806
53298
|
},
|
|
51807
53299
|
dragLeave: (entry) => {
|
|
53300
|
+
dragExpand.current?.leave(entry.path);
|
|
51808
53301
|
setDropTarget((current) => current === entry.path ? void 0 : current);
|
|
51809
53302
|
},
|
|
51810
53303
|
dropOn: (entry, e) => {
|
|
53304
|
+
dragExpand.current?.reset();
|
|
51811
53305
|
if (isFileDrag(e.dataTransfer)) {
|
|
51812
53306
|
const into = entry.isDir ? entry.path : entry.path.split("/").slice(0, -1).join("/") || "/";
|
|
51813
53307
|
handleDrop(into, e);
|
|
@@ -53823,6 +55317,58 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
53823
55317
|
};
|
|
53824
55318
|
const blockRefs = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
53825
55319
|
const menu = useContextMenu();
|
|
55320
|
+
/**
|
|
55321
|
+
* Hand THIS commit to the on-screen session as one review prompt (F6 v2).
|
|
55322
|
+
*
|
|
55323
|
+
* Same delivery rule as the single-file button in `DiffView`: draft only,
|
|
55324
|
+
* never sent, and the same three reasons a click is refused. The patch is
|
|
55325
|
+
* ALREADY in memory here (the 差异 tab renders with it), so this costs no
|
|
55326
|
+
* extra remote round trip; `patchTruncated` comes from the loader that
|
|
55327
|
+
* computed the byte cap — the one place that knows the read was cut.
|
|
55328
|
+
*/
|
|
55329
|
+
const store = useExplorer();
|
|
55330
|
+
const chat = useRemoteChatTarget(store.ctx);
|
|
55331
|
+
const viewedAliasPath = store.workspace === void 0 ? void 0 : store.aliasPaths[store.workspace.id];
|
|
55332
|
+
const chatEnabled = chat.sessionId !== void 0 && chat.sessionWorkspacePath !== void 0 && viewedAliasPath !== void 0 && sameLocalDir(chat.sessionWorkspacePath, viewedAliasPath);
|
|
55333
|
+
let reviewBlocked;
|
|
55334
|
+
if (store.ctx === void 0) reviewBlocked = t("scm.aiReviewNoContext");
|
|
55335
|
+
else if (!chatEnabled || chat.sessionId === void 0) reviewBlocked = t("scm.aiReviewNoSession");
|
|
55336
|
+
else if (!canInsertDraft(store.ctx, chat.sessionId)) reviewBlocked = t("scm.aiReviewNoChannel");
|
|
55337
|
+
else if (props.patch === void 0 || props.patch === "") reviewBlocked = t("history.aiReviewNoPatch");
|
|
55338
|
+
const reviewCommit = () => {
|
|
55339
|
+
const ctx = store.ctx;
|
|
55340
|
+
const sessionId = chat.sessionId;
|
|
55341
|
+
if (reviewBlocked !== void 0 || ctx === void 0 || sessionId === void 0) {
|
|
55342
|
+
toast(reviewBlocked ?? t("scm.aiReviewNoSession"), true);
|
|
55343
|
+
return;
|
|
55344
|
+
}
|
|
55345
|
+
const patch = props.patch ?? "";
|
|
55346
|
+
const bytes = diffByteLength(patch);
|
|
55347
|
+
const capped = props.patchTruncated || bytes >= 2e6;
|
|
55348
|
+
const mode = pickReviewMode({
|
|
55349
|
+
bytes,
|
|
55350
|
+
hasDiff: patch !== "",
|
|
55351
|
+
capped
|
|
55352
|
+
});
|
|
55353
|
+
if (!appendToDraft(ctx, sessionId, buildCommitReviewPrompt({
|
|
55354
|
+
alias: store.alias,
|
|
55355
|
+
root: store.repoRoot ?? store.root,
|
|
55356
|
+
hash: props.commit.hash,
|
|
55357
|
+
subject: props.commit.subject,
|
|
55358
|
+
body: props.body,
|
|
55359
|
+
files: props.files ?? [],
|
|
55360
|
+
patch,
|
|
55361
|
+
mode,
|
|
55362
|
+
capped,
|
|
55363
|
+
lang: props.lang
|
|
55364
|
+
}))) {
|
|
55365
|
+
toast(t("scm.aiReviewFailed"), true);
|
|
55366
|
+
return;
|
|
55367
|
+
}
|
|
55368
|
+
if (mode === "full") toast(t("scm.aiReviewAdded"));
|
|
55369
|
+
else if (mode === "summary") toast(t("scm.aiReviewAddedSummary"));
|
|
55370
|
+
else toast(t("scm.aiReviewAddedRead"));
|
|
55371
|
+
};
|
|
53826
55372
|
const resolvedFocus = props.focusPath === void 0 ? void 0 : blockForPath(model, props.focusPath);
|
|
53827
55373
|
const currentPath = resolvedFocus ?? paths[0];
|
|
53828
55374
|
const currentIndex = currentPath === void 0 ? -1 : paths.indexOf(currentPath);
|
|
@@ -53945,6 +55491,17 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
53945
55491
|
onClick: copyAll,
|
|
53946
55492
|
disabled: props.patch === void 0 || props.patch === "",
|
|
53947
55493
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCopy, { size: 13 })
|
|
55494
|
+
}),
|
|
55495
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
55496
|
+
title: reviewBlocked ?? t("history.aiReview"),
|
|
55497
|
+
onClick: reviewCommit,
|
|
55498
|
+
disabled: reviewBlocked !== void 0,
|
|
55499
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
55500
|
+
className: "rvs-glyph",
|
|
55501
|
+
"aria-hidden": "true",
|
|
55502
|
+
style: { fontSize: 12 },
|
|
55503
|
+
children: "AI"
|
|
55504
|
+
})
|
|
53948
55505
|
})
|
|
53949
55506
|
]
|
|
53950
55507
|
}),
|
|
@@ -70920,6 +72477,11 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
70920
72477
|
visible: panelLive("terminal"),
|
|
70921
72478
|
request: store.terminalRequest
|
|
70922
72479
|
});
|
|
72480
|
+
case "ports": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PortsView, {
|
|
72481
|
+
t,
|
|
72482
|
+
hosts: store.hosts,
|
|
72483
|
+
visible: panelLive("ports")
|
|
72484
|
+
});
|
|
70923
72485
|
case "workspaces": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
70924
72486
|
className: "rvs-viewpad",
|
|
70925
72487
|
style: { height: "100%" },
|
|
@@ -70981,6 +72543,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
70981
72543
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "rvs-rail-sep" }),
|
|
70982
72544
|
editorInStack && store.tabs.length > 0 && railButton("editor", store.activeTab?.rel.split("/").pop() ?? t("tab.editor"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconDiff, { size: 17 }), store.tabs.length),
|
|
70983
72545
|
railButton("terminal", t("tab.terminal"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconTerminal, { size: 17 })),
|
|
72546
|
+
railButton("ports", t("tab.ports"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPlug, { size: 17 })),
|
|
70984
72547
|
railButton("workspaces", t("tab.workspaces"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconServer, { size: 17 }), store.workspaces.length)
|
|
70985
72548
|
]
|
|
70986
72549
|
}),
|