tiletopia/src/lib/layout/LeafPane.css
megaproxy 774b8633dc Migrate frontend from Svelte 5 to React 18
After hours of fighting Svelte 5's prop-reactivity through the
recursive Pane → SplitNode → LeafPane chain (props captured at
mount, never updated; context+getter pattern crashed; DOM-direct
workarounds created zombie-split click-intercept bugs), we
checkpointed the Svelte version (branch svelte-archive at e9015b2,
tarball at D:\archives\tiletopia-svelte-2026-05-22.tar.gz) and
rewrote the frontend in React.

Kept verbatim:
- All of src-tauri/ (Rust backend, Tauri config, icons)
- scripts/ (make-icon.py, release.sh)
- README.md, CLAUDE.md, memory.md
- src/lib/layout/tree.ts (pure TS — 43 tests still pass)
- src/ipc.ts (Tauri command wrappers)

Rewrote in React:
- src/App.tsx (top-level state via useState, OrchestrationProvider
  for descendants via React.Context)
- src/lib/layout/orchestration.tsx (React Context API for shared
  state — known-reliable reactivity, no Svelte 5 wall)
- src/lib/layout/Pane.tsx (recursive dispatcher)
- src/lib/layout/SplitNode.tsx (draggable gutter, local ratio state)
- src/lib/layout/LeafPane.tsx (toolbar + XtermPane)
- src/components/XtermPane.tsx (xterm.js wrapper, refs for callbacks)
- src/components/Notifications.tsx, Palette.tsx

Build: Vite + @vitejs/plugin-react. TypeScript strict. Same Tauri 2
config. Verified: pnpm check (clean), pnpm test (43/43 pass).
Not yet verified: pnpm tauri dev — that requires the Windows host.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 18:05:05 +01:00

170 lines
3.1 KiB
CSS

.leaf {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
min-width: 0;
min-height: 0;
border: 2px solid transparent;
box-sizing: border-box;
}
.leaf.active {
border-color: #5a8cd8;
}
.leaf.broadcasting {
border-color: #e09838;
}
.leaf.active.broadcasting {
border-color: #ffb840;
}
.pane-toolbar {
flex: 0 0 auto;
display: flex;
align-items: center;
gap: 8px;
padding: 2px 8px;
background: #181818;
border-bottom: 1px solid #2a2a2a;
font-size: 11px;
color: #aaa;
user-select: none;
min-height: 24px;
}
.pane-label {
font: inherit;
font-family: "Cascadia Mono", "JetBrains Mono", "Consolas", monospace;
font-weight: 600;
color: #ccc;
background: transparent;
border: 1px solid transparent;
border-radius: 3px;
padding: 1px 6px;
cursor: text;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 200px;
}
.pane-label:hover {
background: #222;
border-color: #2a2a2a;
}
.label-input {
font: inherit;
font-family: "Cascadia Mono", "JetBrains Mono", "Consolas", monospace;
font-weight: 600;
color: #fff;
background: #0c0c0c;
border: 1px solid #3a5a8c;
border-radius: 3px;
padding: 1px 6px;
outline: none;
max-width: 240px;
}
.distro-wrap {
position: relative;
}
.distro-chip,
.bcast-chip {
font: inherit;
font-family: "Cascadia Mono", "JetBrains Mono", "Consolas", monospace;
font-size: 10px;
background: #222;
color: #88c;
border: 1px solid #2a2a3a;
border-radius: 3px;
padding: 1px 6px;
cursor: pointer;
}
.distro-chip:hover,
.bcast-chip:hover {
background: #2a2a3a;
color: #aac;
}
.bcast-chip {
color: #777;
background: #1c1c1c;
border-color: #2a2a2a;
padding: 1px 5px;
}
.bcast-chip.on {
background: #4a3010;
color: #f0c060;
border-color: #c98a1f;
}
.distro-menu {
position: absolute;
top: 100%;
left: 0;
margin-top: 2px;
background: #1a1a1a;
border: 1px solid #2a2a2a;
border-radius: 4px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
z-index: 10;
min-width: 140px;
display: flex;
flex-direction: column;
padding: 2px;
}
.distro-menu-item {
font: inherit;
font-family: "Cascadia Mono", "JetBrains Mono", "Consolas", monospace;
font-size: 11px;
text-align: left;
background: transparent;
color: #ccc;
border: none;
border-radius: 2px;
padding: 3px 8px;
cursor: pointer;
}
.distro-menu-item:hover {
background: #2a2a2a;
}
.distro-menu-item.active {
background: #1a3a5c;
color: #cce6ff;
}
.pane-status {
margin-left: auto;
font-family: "Cascadia Mono", "JetBrains Mono", "Consolas", monospace;
color: #777;
font-size: 10px;
white-space: nowrap;
}
.pane-status.ok { color: #6c6; }
.pane-status.err { color: #d66; }
.pane-actions {
display: flex;
gap: 2px;
}
.pane-btn {
background: transparent;
border: none;
color: #888;
font: inherit;
font-size: 14px;
line-height: 1;
padding: 2px 6px;
border-radius: 3px;
cursor: pointer;
}
.pane-btn:hover {
background: #2a2a2a;
color: #ddd;
}
.pane-btn.close:hover {
background: #5a1a1a;
color: #fcc;
}
.xterm-wrap {
flex: 1 1 auto;
min-height: 0;
position: relative;
}