emrg: GUI workspace panel P2.3+P3.4 — WebContentsView HTML preview (rant 2026-08-11T12:20:35) - #671
Conversation
…ant 2026-08-11T12:20:35) - main.js: lazy WebContentsView (sandbox+contextIsolation), right-aligned bounds sync via emrg:panelResized + win resize; will-frame-navigate file:-only gate + setWindowOpenHandler deny (security checklist); preview path kept in main as source of truth for renderer crash recovery - preload.js: previewHtml / closePreview / panelResized / getPreviewState - result-panel.js: .html/.htm → embedded preview (no read_file), DOM placeholder (mixed model), syncPreview on tab switch, panelResized on width/collapse changes, crash-recovery reopen via getPreviewState - i18n zh/en result.htmlPreview; layout.css .viewer-html placeholder - +7 renderer smoke tests (IPC calls, html detection both states, html→html reload semantics, close/switch closePreview, panelResized reporting, crash recovery, idempotent reopen); GUI 205→212
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
P2.3+P3.4 WebContentsView HTML preview — final major workspace-panel slice. Verified locally:
- main.js: lazy WebContentsView (sandbox+contextIsolation+nodeIntegration:false), right-aligned bounds via previewRect (win resize + emrg:panelResized), will-frame-navigate file:-only main-frame gate + setWindowOpenHandler deny, preview path held in main as crash-recovery source of truth
- renderer: .html/.htm → embedded preview (no read_file), DOM placeholder mixed model, HTML→HTML reload / HTML→non-HTML closePreview semantics, panelResized on init/width/collapse, getPreviewState reopen after renderer crash
- GUI 212/212 (+7 renderer smoke), pytest 694/694, doc guard 3/3, import + --help ✓
CI test PASS (31464133515).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Verified in worktree (head 7036193): GUI 212/212 (+7 renderer smoke: previewHtml IPC, html-path detection both states (.html/.htm/.HTM → preview; .py → readFile), html→html reload semantics, close/switch closePreview, panelResized init+collapse/expand, crash-recovery reopen, idempotent handlePreviewState), pytest 694/694, doc-count guard 3/3, node --check clean, CI test SUCCESS, MERGEABLE.
Security checklist confirmed: WebContentsView sandbox+contextIsolation+nodeIntegration:false (mirrors main window), setWindowOpenHandler deny, will-frame-navigate restricts main-frame to file: URLs, lazy create/single instance reuse, collapse → offscreen bounds, renderer-crash recovery with main as source of truth (emrg:getPreviewState). Closes the final rant slice (P2.3+P3.4) after #670.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Third LGTM. Verified at head 7036193 (merge base = master 80ab4a0, MERGEABLE):
- main.js: WebContentsView lazy creation (sandbox + contextIsolation + nodeIntegration:false), right-aligned previewRect bounds synced via emrg:panelResized + win resize, will-frame-navigate file:-only main-frame gate + setWindowOpenHandler deny, crash-recovery source of truth via emrg:getPreviewState
- renderer: .html/.htm embedded preview (no read_file) with DOM placeholder, syncPreview (HTML→HTML reload / non-HTML closePreview), panelResized reporting, idempotent handlePreviewState
- Tests: GUI 212/212 (+7 renderer smoke), pytest 694/694, doc guard 3/3
CI test PASS (31464133515). Mergeable CLEAN.
…viewer + P2.3/P3.4 HTML preview)
…viewer + P2.3/P3.4 HTML preview) (#672)
GUI right-column workspace panel: final major slice — embedded-browser HTML preview via WebContentsView (last remaining item of the rant's P2.3 framework + P3.4 preview content, which the design allows to land together).
P2.3 WebContentsView framework (main.js)
new WebContentsView({ sandbox: true, contextIsolation: true, nodeIntegration: false }), single instance reused (one preview at a time){x: winW-panelW, y: contentTop, w: panelW, h: winH-contentTop}; contentTop = viewer pane top reported by renderer; updated onwin resize+emrg:panelResizedIPC (width / collapse / narrow-screen)setWindowOpenHandler→ deny;will-frame-navigate→ main-frame navigations restricted tofile:(remote URLs blocked)emrg:getPreviewStateafter reload and reopens the tabP3.4 HTML preview (renderer)
.html/.htm→ embedded preview (no read_file call); DOM placeholder (mixed model) visible when collapsedresult.htmlPreview; CSS.viewer-htmlplaceholderVerification: GUI 212/212 (+7 renderer smoke tests: IPC calls, html-path detection both states, html→html reload semantics, close/switch closePreview, panelResized reporting on init/collapse/expand, crash-recovery reopen, idempotent reopen), pytest 694/694, doc-count guard 3/3, import + --help ✓.
Rant 2026-08-11T12:20:35 acceptance: P1-P3 all slices now merged/submitted (P3.3 viewer #670 merged; this PR closes the last item).