Mike0021 commited on
Commit
bcb8862
·
verified ·
1 Parent(s): c272ede

Browser: direct preview controls fit a narrow pane

Browse files
Files changed (1) hide show
  1. piweb/hf-design.patch +17 -10
piweb/hf-design.patch CHANGED
@@ -7885,10 +7885,10 @@ index 0bf21eb..d2f4031 100644
7885
  font-family: var(--font-mono);
7886
  diff --git a/app/shell.css b/app/shell.css
7887
  new file mode 100644
7888
- index 0000000..dddbcc6
7889
  --- /dev/null
7890
  +++ b/app/shell.css
7891
- @@ -0,0 +1,751 @@
7892
  +/* The app's frame, as Claude Code Desktop's: the conversation's header (the
7893
  + title and its menu; a button per pane on the right), the tiles (the chat
7894
  + and the panes it opened: Terminal, Changes, Browser, Files) and the Changes
@@ -8464,7 +8464,9 @@ index 0000000..dddbcc6
8464
  +
8465
  +/* ---------------------------------------------------------------- Browser */
8466
  +.pane-browser { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
8467
- +.browser-pane { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
 
 
8468
  +.browser-toolbar { gap: 2px; padding: 4px 6px; }
8469
  +.browser-address { display: flex; flex: 1 1 auto; min-width: 80px; margin: 0 4px; }
8470
  +.browser-address input {
@@ -8570,7 +8572,8 @@ index 0000000..dddbcc6
8570
  + font-size: 12px;
8571
  +}
8572
  +.browser-preview-bar > svg { flex: none; color: var(--text-dim); }
8573
- +.browser-preview-title { flex: none; color: var(--text-strong); white-space: nowrap; }
 
8574
  +.browser-preview-note { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--text-dim); text-overflow: ellipsis; white-space: nowrap; }
8575
  +.browser-preview-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
8576
  +.browser-canvas.is-picking { cursor: crosshair; }
@@ -13069,10 +13072,10 @@ index 0f8186b..ef6cc22 100644
13069
  <div style={{ padding: "4px 12px 8px 12px", maxHeight: 260, overflowY: "auto" }}>
13070
  diff --git a/components/BrowserPane.tsx b/components/BrowserPane.tsx
13071
  new file mode 100644
13072
- index 0000000..9ce0ce6
13073
  --- /dev/null
13074
  +++ b/components/BrowserPane.tsx
13075
- @@ -0,0 +1,757 @@
13076
  +"use client";
13077
  +
13078
  +// The Browser pane, as Claude Code Desktop's: the machine's own Chromium
@@ -13623,9 +13626,9 @@ index 0000000..9ce0ce6
13623
  + </form>
13624
  + {previewTarget && !preview && (
13625
  + <Tip label={t("browser.previewTip")}>
13626
- + <button type="button" className="ui-btn ui-btn--sm" onClick={() => void openPreview(previewTarget)}>
13627
  + <CarbonIcon icon={Carbon.Flash} size={16} />
13628
- + <span>{t("browser.preview")}</span>
13629
  + </button>
13630
  + </Tip>
13631
  + )}
@@ -13723,7 +13726,7 @@ index 0000000..9ce0ce6
13723
  + {preview && (
13724
  + <div className="browser-preview-bar" role="status">
13725
  + <CarbonIcon icon={Carbon.Flash} size={14} />
13726
- + <span className="browser-preview-title">{t("browser.previewOf", { host: preview.host })}</span>
13727
  + <span className="browser-preview-note" title={t("browser.previewNote")}>{t("browser.previewNote")}</span>
13728
  + <Tip label={t("browser.previewReload")}>
13729
  + <button type="button" className="ui-btn ui-btn--sm ui-btn--icon" aria-label={t("browser.previewReload")} onClick={() => setPreview({ ...preview, key: Date.now() })}>
@@ -13735,7 +13738,11 @@ index 0000000..9ce0ce6
13735
  + <CarbonIcon icon={Carbon.Launch} size={16} />
13736
  + </a>
13737
  + </Tip>
13738
- + <button type="button" className="ui-btn ui-btn--sm" onClick={() => setPreview(null)}>{t("browser.previewBack")}</button>
 
 
 
 
13739
  + </div>
13740
  + )}
13741
  +
 
7885
  font-family: var(--font-mono);
7886
  diff --git a/app/shell.css b/app/shell.css
7887
  new file mode 100644
7888
+ index 0000000..106b05b
7889
  --- /dev/null
7890
  +++ b/app/shell.css
7891
+ @@ -0,0 +1,754 @@
7892
  +/* The app's frame, as Claude Code Desktop's: the conversation's header (the
7893
  + title and its menu; a button per pane on the right), the tiles (the chat
7894
  + and the panes it opened: Terminal, Changes, Browser, Files) and the Changes
 
8464
  +
8465
  +/* ---------------------------------------------------------------- Browser */
8466
  +.pane-browser { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
8467
+ +.browser-pane { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; container-type: inline-size; }
8468
+ +/* A narrow pane keeps Direct preview as its icon (the tooltip names it). */
8469
+ +@container (max-width: 460px) { .browser-preview-label, .browser-preview-note { display: none; } }
8470
  +.browser-toolbar { gap: 2px; padding: 4px 6px; }
8471
  +.browser-address { display: flex; flex: 1 1 auto; min-width: 80px; margin: 0 4px; }
8472
  +.browser-address input {
 
8572
  + font-size: 12px;
8573
  +}
8574
  +.browser-preview-bar > svg { flex: none; color: var(--text-dim); }
8575
+ +.browser-preview-title { flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--text-strong); text-overflow: ellipsis; white-space: nowrap; }
8576
+ +.browser-preview-bar > .ui-btn { flex: none; }
8577
  +.browser-preview-note { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--text-dim); text-overflow: ellipsis; white-space: nowrap; }
8578
  +.browser-preview-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
8579
  +.browser-canvas.is-picking { cursor: crosshair; }
 
13072
  <div style={{ padding: "4px 12px 8px 12px", maxHeight: 260, overflowY: "auto" }}>
13073
  diff --git a/components/BrowserPane.tsx b/components/BrowserPane.tsx
13074
  new file mode 100644
13075
+ index 0000000..fd2ff63
13076
  --- /dev/null
13077
  +++ b/components/BrowserPane.tsx
13078
+ @@ -0,0 +1,761 @@
13079
  +"use client";
13080
  +
13081
  +// The Browser pane, as Claude Code Desktop's: the machine's own Chromium
 
13626
  + </form>
13627
  + {previewTarget && !preview && (
13628
  + <Tip label={t("browser.previewTip")}>
13629
+ + <button type="button" className="ui-btn ui-btn--sm" aria-label={t("browser.preview")} onClick={() => void openPreview(previewTarget)}>
13630
  + <CarbonIcon icon={Carbon.Flash} size={16} />
13631
+ + <span className="browser-preview-label">{t("browser.preview")}</span>
13632
  + </button>
13633
  + </Tip>
13634
  + )}
 
13726
  + {preview && (
13727
  + <div className="browser-preview-bar" role="status">
13728
  + <CarbonIcon icon={Carbon.Flash} size={14} />
13729
+ + <span className="browser-preview-title" title={t("browser.previewNote")}>{t("browser.previewOf", { host: preview.host })}</span>
13730
  + <span className="browser-preview-note" title={t("browser.previewNote")}>{t("browser.previewNote")}</span>
13731
  + <Tip label={t("browser.previewReload")}>
13732
  + <button type="button" className="ui-btn ui-btn--sm ui-btn--icon" aria-label={t("browser.previewReload")} onClick={() => setPreview({ ...preview, key: Date.now() })}>
 
13738
  + <CarbonIcon icon={Carbon.Launch} size={16} />
13739
  + </a>
13740
  + </Tip>
13741
+ + <Tip label={t("browser.previewBack")}>
13742
+ + <button type="button" className="ui-btn ui-btn--sm ui-btn--icon" aria-label={t("browser.previewBack")} onClick={() => setPreview(null)}>
13743
+ + <CarbonIcon icon={Carbon.Close} size={16} />
13744
+ + </button>
13745
+ + </Tip>
13746
  + </div>
13747
  + )}
13748
  +