Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 30 additions & 11 deletions src/styles/clipboardChromeDensity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,50 @@ const clipboardView = readFileSync(resolve(root, 'src/views/ClipboardCompareView
const layout = readFileSync(resolve(root, 'src/layouts/AppLayout.vue'), 'utf8')

describe('clipboard compare chrome density', () => {
it('keeps Clipboard Compare toolbar/history/status chrome dense toward capture', () => {
it('keeps Clipboard Compare toolbar/history/status chrome at capture CSS scale', () => {
expect(css).toMatch(/\.clipboard-compare-view\s*\{[\s\S]*?padding:\s*2px 4px/)
expect(css).toMatch(
/\.clipboard-compare-view \.clipboard-toolbar\s*\{[\s\S]*?min-height:\s*20px/,
/\.clipboard-compare-view \.clipboard-toolbar\s*\{[\s\S]*?min-height:\s*22px/,
)
expect(css).toMatch(
/\.clipboard-compare-view \.clipboard-toolbar\s*\{[\s\S]*?border:\s*1px solid #a0a0a0/,
)
expect(css).toMatch(
/\.clipboard-compare-view \.clipboard-toolbar \.n-button[\s\S]*?height:\s*18px/,
)
expect(css).toMatch(/\.clipboard-compare-view \.history-entry\s*\{[\s\S]*?padding:\s*2px 6px/)
expect(css).toMatch(
/\.clipboard-compare-view \.path-side-footer\s*\{[\s\S]*?line-height:\s*16px/,
)
expect(css).toMatch(/\.clipboard-compare-view \.history-entry\s*\{[\s\S]*?padding:\s*1px 4px/)

expect(clipboardView).toMatch(/data-clipboard-chrome-density="capture-1to1"/)
expect(clipboardView).toMatch(/\.clipboard-compare-view\s*\{[\s\S]*?padding:\s*2px 4px/)
expect(clipboardView).toMatch(/chromeKind:\s*'clipboard-session'/)
expect(clipboardView).toMatch(/PathMetaFooter/)
expect(clipboardView).toMatch(/clipboard-path-footers/)
expect(clipboardView).toMatch(/:deep\(\.clipboard-toolbar \.n-button\)[\s\S]*?height:\s*18px/)
expect(clipboardView).not.toMatch(/font-size:\s*9px/)
expect(clipboardView).not.toMatch(/min-height:\s*9px/)

expect(layout).toMatch(/data-chrome-kind='clipboard-session'[\s\S]*?height:\s*20px/)
expect(css).toMatch(/\.bc-session-toolbar\s*\{[\s\S]*?min-height:\s*38px/)
})

it('keeps Clipboard history pane/entry chrome dense one more notch toward capture', () => {
expect(css).toMatch(/\.clipboard-compare-view \.history-pane\s*\{[\s\S]*?padding:\s*1px 4px/)
it('keeps Clipboard history pane/entry chrome on capture band', () => {
expect(css).toMatch(/\.clipboard-compare-view \.history-pane\s*\{[\s\S]*?padding:\s*4px 6px/)
expect(css).toMatch(
/\.clipboard-compare-view \.history-pane header\s*\{[\s\S]*?min-height:\s*20px/,
)
expect(css).toMatch(/\.clipboard-compare-view \.history-entry\s*\{[\s\S]*?min-height:\s*18px/)
expect(css).toMatch(
/\.clipboard-compare-view \.history-pane header\s*\{[\s\S]*?min-height:\s*16px/,
/\.clipboard-compare-view \.history-entry\s*\{[\s\S]*?border:\s*1px solid #a0a0a0/,
)
expect(css).toMatch(/\.clipboard-compare-view \.history-entry\s*\{[\s\S]*?min-height:\s*20px/)

expect(clipboardView).toMatch(/\.history-pane\s*\{[\s\S]*?padding:\s*1px 4px/)
expect(clipboardView).toMatch(/\.history-pane header\s*\{[\s\S]*?min-height:\s*16px/)
expect(clipboardView).toMatch(/\.history-entry\s*\{[\s\S]*?min-height:\s*20px/)
expect(clipboardView).toMatch(/\.history-entry\s*\{[\s\S]*?padding:\s*1px 4px/)
expect(clipboardView).toMatch(/data-clipboard-rows-density="capture-1to1"/)
expect(clipboardView).toMatch(/\.history-pane\s*\{[\s\S]*?padding:\s*4px 6px/)
expect(clipboardView).toMatch(/\.history-pane header\s*\{[\s\S]*?min-height:\s*20px/)
expect(clipboardView).toMatch(/\.history-entry\s*\{[\s\S]*?min-height:\s*18px/)
expect(clipboardView).toMatch(/\.history-entry\s*\{[\s\S]*?padding:\s*2px 6px/)
expect(clipboardView).toMatch(/\.history-pane header span\s*\{[\s\S]*?line-height:\s*16px/)
})
})
68 changes: 55 additions & 13 deletions src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2713,22 +2713,49 @@ html[data-show-path-bars='0'] .path-pair-bar {
line-height: 16px !important;
}

/* Clipboard Compare chrome densify toward capture toolbar/history/status strips */
/* Clipboard Compare chrome at capture CSS scale (toolbar/history ~18–20px; do not crush) */
.clipboard-compare-view {
gap: 2px !important;
gap: 4px !important;
padding: 2px 4px !important;
}

.clipboard-compare-view .clipboard-toolbar {
gap: 2px 4px !important;
min-height: 20px !important;
padding: 1px 4px !important;
gap: 4px 6px !important;
min-height: 22px !important;
padding: 2px 4px !important;
border: 1px solid #a0a0a0 !important;
border-radius: 0 !important;
background: var(--app-surface) !important;
}

.clipboard-compare-view .clipboard-toolbar .n-button {
--n-height: 18px !important;
--n-padding: 0 6px !important;
--n-font-size: 11px !important;

height: 18px !important;
min-height: 18px !important;
padding: 0 6px !important;
border-radius: 0 !important;
font-size: 11px !important;
line-height: 16px !important;
}

.clipboard-compare-view .status-chip {
font-size: 11px !important;
line-height: 14px !important;
line-height: 16px !important;
}

.clipboard-compare-view .bc-path-footers {
gap: 1px !important;
min-height: 20px !important;
padding: 0 2px !important;
}

.clipboard-compare-view .path-side-footer {
min-height: 20px !important;
font-size: 11px !important;
line-height: 16px !important;
}

.clipboard-compare-view .clipboard-layout {
Expand All @@ -2737,28 +2764,43 @@ html[data-show-path-bars='0'] .path-pair-bar {

.clipboard-compare-view .history-pane,
.clipboard-compare-view .diff-pane {
border: 1px solid #a0a0a0 !important;
border-radius: 0 !important;
}

.clipboard-compare-view .history-pane {
gap: 2px !important;
padding: 1px 4px !important;
gap: 4px !important;
padding: 4px 6px !important;
}

.clipboard-compare-view .history-pane header {
gap: 4px !important;
min-height: 16px !important;
gap: 6px !important;
min-height: 20px !important;
}

.clipboard-compare-view .history-pane header span {
font-size: 11px !important;
line-height: 16px !important;
}

.clipboard-compare-view .history-list {
gap: 2px !important;
}

.clipboard-compare-view .history-entry {
gap: 0 4px !important;
min-height: 20px !important;
padding: 1px 4px !important;
gap: 0 6px !important;
min-height: 18px !important;
padding: 2px 6px !important;
border: 1px solid #a0a0a0 !important;
border-radius: 0 !important;
font-size: 11px !important;
line-height: 16px !important;
}

.clipboard-compare-view .history-entry small,
.clipboard-compare-view .history-entry code {
font-size: 11px !important;
line-height: 16px !important;
}

/* Table Compare path chrome densify toward capture (~20px path/status) */
Expand Down
59 changes: 41 additions & 18 deletions src/views/ClipboardCompareView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ watch(
toolbar-test-id-prefix="clipboard-toolbar"
@toolbar-command="runClipboardToolbarCommand"
>
<section class="clipboard-compare-view">
<section
class="clipboard-compare-view"
data-clipboard-chrome-density="capture-1to1"
>
<section class="clipboard-toolbar">
<NButton
size="small"
Expand Down Expand Up @@ -327,7 +330,10 @@ watch(
>

<section class="clipboard-layout">
<aside class="history-pane">
<aside
class="history-pane"
data-clipboard-rows-density="capture-1to1"
>
<header>
<strong>{{ $t('ui.history') }}</strong>
<span>{{ $t('status.entryCount', { count: history.length }) }}</span>
Expand Down Expand Up @@ -378,7 +384,7 @@ watch(
display: grid;
grid-template-columns: 1fr 1fr;
align-items: center;
gap: 8px;
gap: 1px;
min-height: 20px;
padding: 0 2px;
}
Expand All @@ -392,7 +398,7 @@ watch(
.clipboard-compare-view {
display: grid;
grid-template-rows: auto auto minmax(0, 1fr);
gap: 2px;
gap: 4px;
height: 100%;
padding: 2px 4px;
overflow: hidden;
Expand All @@ -402,17 +408,31 @@ watch(
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 2px 4px;
min-height: 20px;
padding: 1px 4px;
border: 1px solid var(--app-border);
gap: 4px 6px;
min-height: 22px;
padding: 2px 4px;
border: 1px solid #a0a0a0;
border-radius: 0;
background: var(--app-surface);
}

.status-chip {
color: var(--app-text-muted);
font-size: 11px;
line-height: 16px;
}

:deep(.clipboard-toolbar .n-button) {
--n-height: 18px;
--n-padding: 0 6px;
--n-font-size: 11px;

height: 18px;
min-height: 18px;
padding: 0 6px;
border-radius: 0;
font-size: 11px;
line-height: 16px;
}

.clipboard-layout {
Expand All @@ -426,30 +446,30 @@ watch(
.diff-pane {
min-width: 0;
min-height: 0;
border: 1px solid var(--app-border);
border: 1px solid #a0a0a0;
border-radius: 0;
background: var(--app-surface);
}

.history-pane {
display: grid;
grid-template-rows: auto minmax(0, 1fr);
gap: 2px;
padding: 1px 4px;
gap: 4px;
padding: 4px 6px;
}

.history-pane header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 4px;
min-height: 16px;
gap: 6px;
min-height: 20px;
}

.history-pane header span {
color: var(--app-text-muted);
font-size: 11px;
line-height: 14px;
line-height: 16px;
}

.history-list {
Expand All @@ -462,13 +482,15 @@ watch(
.history-entry {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: 0 4px;
min-height: 20px;
padding: 1px 4px;
border: 1px solid var(--app-border);
gap: 0 6px;
min-height: 18px;
padding: 2px 6px;
border: 1px solid #a0a0a0;
border-radius: 0;
background: var(--app-bg);
color: var(--app-text);
font-size: 11px;
line-height: 16px;
text-align: left;
cursor: pointer;
}
Expand All @@ -485,6 +507,7 @@ watch(
overflow: hidden;
color: var(--app-text-muted);
font-size: 11px;
line-height: 16px;
text-overflow: ellipsis;
white-space: nowrap;
}
Expand Down
Loading