style: compare view fills the viewer + reflect-horizontal icon
- The diff now spans the full viewer width and height (scoped via an is-compare class on #docContainer) instead of a centered min(96%,1100px) card that left empty space; .diff-body flexes so short diffs still fill the pane. - Compare toolbar icon -> mdi reflect-horizontal (was table-merge-cells). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -120,7 +120,7 @@
|
||||
|
||||
<button id="compareBtn" class="toolbar-btn" title="Compare two files…" data-i18n-title="compare.openTwo">
|
||||
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">
|
||||
<path d="M5,10H3V4H11V6H5V10M19,18H13V20H21V14H19V18M5,18V14H3V20H11V18H5M21,4H13V6H19V10H21V4M8,13V15L11,12L8,9V11H3V13H8M16,11V9L13,12L16,15V13H21V11H16Z" />
|
||||
<path d="M22,20H14A1,1 0 0,1 13,19V4.97C13,4.5 13.31,4.12 13.74,4C14.19,3.88 14.65,4.08 14.87,4.47L22.89,18.5C23.07,18.81 23.07,19.19 22.89,19.5C22.71,19.81 22.38,20 22,20M2,20C1.62,20 1.29,19.81 1.11,19.5C0.93,19.19 0.93,18.81 1.11,18.5L9.13,4.47C9.35,4.08 9.81,3.88 10.26,4C10.69,4.12 11,4.5 11,4.97V19A1,1 0 0,1 10,20H2M9,18V8.74L3.71,18H9Z" />
|
||||
</svg>
|
||||
</button>
|
||||
<input id="compareInput" type="file" class="hidden" multiple
|
||||
|
||||
@@ -317,6 +317,7 @@ export class DocumentViewer {
|
||||
const page = document.createElement('div')
|
||||
page.className = 'diff-page'
|
||||
container.appendChild(page)
|
||||
container.classList.add('is-compare') // let the diff fill the viewer area
|
||||
|
||||
const { renderCompare } = await import('./diff-view.js')
|
||||
this._compareCtl = renderCompare(page, {
|
||||
@@ -346,6 +347,7 @@ export class DocumentViewer {
|
||||
_clearCompare() {
|
||||
this._compareCtl?.destroy()
|
||||
this._compareCtl = null
|
||||
document.getElementById('docContainer')?.classList.remove('is-compare')
|
||||
}
|
||||
|
||||
/* ── Page navigation ─────────────────────────────────────────────────── */
|
||||
|
||||
+8
-5
@@ -450,14 +450,17 @@ html, body {
|
||||
.diff-page {
|
||||
background: #2b2d31;
|
||||
color: #d6d9de;
|
||||
width: min(96%, 1100px);
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
border: 1px solid #1a1b1e;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 12px rgba(0,0,0,.5);
|
||||
flex-shrink: 0;
|
||||
align-self: center;
|
||||
margin: 6px 0;
|
||||
align-self: stretch;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
/* compare mode: stretch docContainer so the diff fills the viewer area */
|
||||
#docContainer.is-compare { align-self: stretch; padding-bottom: 0; }
|
||||
.diff-mode-toggle {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
@@ -482,7 +485,7 @@ html, body {
|
||||
.diff-mode-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
|
||||
.diff-mode-btn.active { background: #2b2d31; color: #90caf9; border-color: #90caf9; font-weight: 600; }
|
||||
|
||||
.diff-body { position: relative; }
|
||||
.diff-body { position: relative; flex: 1 1 auto; }
|
||||
.diff-rows { font-family: ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; }
|
||||
|
||||
/* side-by-side: aligned two-column grid */
|
||||
|
||||
Reference in New Issue
Block a user