Spaces:
Paused
Paused
Pi Web fork: Browser address ellipsis
Browse files- piweb/hf-design.patch +20 -7
piweb/hf-design.patch
CHANGED
|
@@ -7759,10 +7759,10 @@ index 0bf21eb..f4c84b5 100644
|
|
| 7759 |
font-family: var(--font-mono);
|
| 7760 |
diff --git a/app/shell.css b/app/shell.css
|
| 7761 |
new file mode 100644
|
| 7762 |
-
index 0000000..
|
| 7763 |
--- /dev/null
|
| 7764 |
+++ b/app/shell.css
|
| 7765 |
-
@@ -0,0 +1,
|
| 7766 |
+/* The app's frame, as Claude Code Desktop's: the conversation's header (the
|
| 7767 |
+ title and its menu; a button per pane on the right), the tiles (the chat
|
| 7768 |
+ and the panes it opened: Terminal, Changes, Browser, Files) and the Changes
|
|
@@ -8352,7 +8352,12 @@ index 0000000..e65c420
|
|
| 8352 |
+ color: var(--text);
|
| 8353 |
+ font: inherit;
|
| 8354 |
+ font-size: 12.5px;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8355 |
+}
|
|
|
|
| 8356 |
+.browser-address input:focus { box-shadow: inset 0 0 0 1px var(--focus-line), var(--focus-glow); }
|
| 8357 |
+.browser-error-count { color: var(--danger); font-size: 11.5px; font-variant-numeric: tabular-nums; }
|
| 8358 |
+.browser-tabs {
|
|
@@ -12923,10 +12928,10 @@ index 0f8186b..ef6cc22 100644
|
|
| 12923 |
<div style={{ padding: "4px 12px 8px 12px", maxHeight: 260, overflowY: "auto" }}>
|
| 12924 |
diff --git a/components/BrowserPane.tsx b/components/BrowserPane.tsx
|
| 12925 |
new file mode 100644
|
| 12926 |
-
index 0000000..
|
| 12927 |
--- /dev/null
|
| 12928 |
+++ b/components/BrowserPane.tsx
|
| 12929 |
-
@@ -0,0 +1,
|
| 12930 |
+"use client";
|
| 12931 |
+
|
| 12932 |
+// The Browser pane, as Claude Code Desktop's: the machine's own Chromium
|
|
@@ -13363,8 +13368,15 @@ index 0000000..f4a161c
|
|
| 13363 |
+ spellCheck={false}
|
| 13364 |
+ autoCapitalize="off"
|
| 13365 |
+ autoCorrect="off"
|
|
|
|
|
|
|
|
|
|
| 13366 |
+ onFocus={(event) => { setAddressFocused(true); event.currentTarget.select(); }}
|
| 13367 |
-
+ onBlur={() =>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13368 |
+ onChange={(event) => setAddress(event.target.value)}
|
| 13369 |
+ onKeyDown={(event) => {
|
| 13370 |
+ if (event.key === "Escape") {
|
|
@@ -30842,10 +30854,10 @@ index ce26694..9c6aa29 100644
|
|
| 30842 |
## Sidebar breakpoint (`components/AppShell.tsx`)
|
| 30843 |
diff --git a/docs/agents/desktop-shell.md b/docs/agents/desktop-shell.md
|
| 30844 |
new file mode 100644
|
| 30845 |
-
index 0000000..
|
| 30846 |
--- /dev/null
|
| 30847 |
+++ b/docs/agents/desktop-shell.md
|
| 30848 |
-
@@ -0,0 +1,
|
| 30849 |
+# The Claude Code Desktop layout (hf-design)
|
| 30850 |
+
|
| 30851 |
+Pi Web's frame follows Claude Code Desktop's Code tab: a sidebar of sessions, a header, then the conversation and the panes it opened as tiles. Pi's power stays reachable through "/", the composer's "+" menu, the title's session menu and Settings rather than permanent chrome. Popups are Base UI (`@base-ui/react` 1.8.0) through the wrappers in `components/ui/`, styled in `app/ui.css`; the header and tiles in `app/shell.css`. The Code tab is claude.ai web code (its chunks are on assets-proxy.anthropic.com, no Cloudflare there); the tile behaviour below was read from its tile engine and side-pane store, not from screenshots. The conversation outline (upstream's ChatMinimap) is removed.
|
|
@@ -30906,6 +30918,7 @@ index 0000000..0fc40bd
|
|
| 30906 |
+- Send (⌘/Ctrl+Enter) formats every comment with its quoted lines (`patchLines()` on the patch, by side) into one message (`formatReviewComments()`).
|
| 30907 |
+
|
| 30908 |
+## Browser pane (`components/BrowserPane.tsx`; server: [browser.md](browser.md))
|
|
|
|
| 30909 |
+- The event stream is open only while the pane is in sight (`active`: open and not under another expanded pane), so the browser can idle out. Frames decode with `createImageBitmap` onto a canvas; a frame arriving mid-decode replaces the pending one.
|
| 30910 |
+- Input maps client coordinates by the frame's `width/height` (the viewport's CSS pixels). It goes **one request at a time, in order** (a queue): separate requests race, and a click's release arriving after the first keys typed after it loses them. A move waiting its turn is replaced by a newer one. `clickCount` is 1–3 (moves and wheel send 1).
|
| 30911 |
+- "Fit" sends the stage's size as the viewport (debounced); device sizes are fixed viewports scaled to fit.
|
|
|
|
| 7759 |
font-family: var(--font-mono);
|
| 7760 |
diff --git a/app/shell.css b/app/shell.css
|
| 7761 |
new file mode 100644
|
| 7762 |
+
index 0000000..167c922
|
| 7763 |
--- /dev/null
|
| 7764 |
+++ b/app/shell.css
|
| 7765 |
+
@@ -0,0 +1,734 @@
|
| 7766 |
+/* The app's frame, as Claude Code Desktop's: the conversation's header (the
|
| 7767 |
+ title and its menu; a button per pane on the right), the tiles (the chat
|
| 7768 |
+ and the panes it opened: Terminal, Changes, Browser, Files) and the Changes
|
|
|
|
| 8352 |
+ color: var(--text);
|
| 8353 |
+ font: inherit;
|
| 8354 |
+ font-size: 12.5px;
|
| 8355 |
+
+ /* A long URL ends in an ellipsis instead of being cut mid-letter; focused, it scrolls whole. */
|
| 8356 |
+
+ text-overflow: ellipsis;
|
| 8357 |
+
+ white-space: nowrap;
|
| 8358 |
+
+ overflow: hidden;
|
| 8359 |
+}
|
| 8360 |
+
+.browser-address input:focus { text-overflow: clip; }
|
| 8361 |
+.browser-address input:focus { box-shadow: inset 0 0 0 1px var(--focus-line), var(--focus-glow); }
|
| 8362 |
+.browser-error-count { color: var(--danger); font-size: 11.5px; font-variant-numeric: tabular-nums; }
|
| 8363 |
+.browser-tabs {
|
|
|
|
| 12928 |
<div style={{ padding: "4px 12px 8px 12px", maxHeight: 260, overflowY: "auto" }}>
|
| 12929 |
diff --git a/components/BrowserPane.tsx b/components/BrowserPane.tsx
|
| 12930 |
new file mode 100644
|
| 12931 |
+
index 0000000..fd1ad6e
|
| 12932 |
--- /dev/null
|
| 12933 |
+++ b/components/BrowserPane.tsx
|
| 12934 |
+
@@ -0,0 +1,624 @@
|
| 12935 |
+"use client";
|
| 12936 |
+
|
| 12937 |
+// The Browser pane, as Claude Code Desktop's: the machine's own Chromium
|
|
|
|
| 13368 |
+ spellCheck={false}
|
| 13369 |
+ autoCapitalize="off"
|
| 13370 |
+ autoCorrect="off"
|
| 13371 |
+
+ // A long address ends in an ellipsis while not edited (CSS), its whole text still the
|
| 13372 |
+
+ // value: focus selects all of it to edit or copy, and the tooltip shows it on hover.
|
| 13373 |
+
+ title={addressFocused ? undefined : address || undefined}
|
| 13374 |
+ onFocus={(event) => { setAddressFocused(true); event.currentTarget.select(); }}
|
| 13375 |
+
+ onBlur={(event) => {
|
| 13376 |
+
+ setAddressFocused(false);
|
| 13377 |
+
+ // Back to its start, so the ellipsis shows again after editing scrolled it.
|
| 13378 |
+
+ event.currentTarget.scrollLeft = 0;
|
| 13379 |
+
+ }}
|
| 13380 |
+ onChange={(event) => setAddress(event.target.value)}
|
| 13381 |
+ onKeyDown={(event) => {
|
| 13382 |
+ if (event.key === "Escape") {
|
|
|
|
| 30854 |
## Sidebar breakpoint (`components/AppShell.tsx`)
|
| 30855 |
diff --git a/docs/agents/desktop-shell.md b/docs/agents/desktop-shell.md
|
| 30856 |
new file mode 100644
|
| 30857 |
+
index 0000000..e95c4b8
|
| 30858 |
--- /dev/null
|
| 30859 |
+++ b/docs/agents/desktop-shell.md
|
| 30860 |
+
@@ -0,0 +1,71 @@
|
| 30861 |
+# The Claude Code Desktop layout (hf-design)
|
| 30862 |
+
|
| 30863 |
+Pi Web's frame follows Claude Code Desktop's Code tab: a sidebar of sessions, a header, then the conversation and the panes it opened as tiles. Pi's power stays reachable through "/", the composer's "+" menu, the title's session menu and Settings rather than permanent chrome. Popups are Base UI (`@base-ui/react` 1.8.0) through the wrappers in `components/ui/`, styled in `app/ui.css`; the header and tiles in `app/shell.css`. The Code tab is claude.ai web code (its chunks are on assets-proxy.anthropic.com, no Cloudflare there); the tile behaviour below was read from its tile engine and side-pane store, not from screenshots. The conversation outline (upstream's ChatMinimap) is removed.
|
|
|
|
| 30918 |
+- Send (⌘/Ctrl+Enter) formats every comment with its quoted lines (`patchLines()` on the patch, by side) into one message (`formatReviewComments()`).
|
| 30919 |
+
|
| 30920 |
+## Browser pane (`components/BrowserPane.tsx`; server: [browser.md](browser.md))
|
| 30921 |
+
+- **The address field** ends a long URL in an ellipsis while it is not being edited (`text-overflow` on the input; Chromium, Firefox and Safari honour it), its value always the whole URL: focus selects all of it to edit or copy, the hover tooltip shows it, and blur scrolls it back to its start so the ellipsis returns.
|
| 30922 |
+- The event stream is open only while the pane is in sight (`active`: open and not under another expanded pane), so the browser can idle out. Frames decode with `createImageBitmap` onto a canvas; a frame arriving mid-decode replaces the pending one.
|
| 30923 |
+- Input maps client coordinates by the frame's `width/height` (the viewport's CSS pixels). It goes **one request at a time, in order** (a queue): separate requests race, and a click's release arriving after the first keys typed after it loses them. A move waiting its turn is replaced by a newer one. `clickCount` is 1–3 (moves and wheel send 1).
|
| 30924 |
+- "Fit" sends the stage's size as the viewport (debounced); device sizes are fixed viewports scaled to fit.
|