Skip to content

Commit 3f5e926

Browse files
committed
line-height fixes
1 parent a0db8bc commit 3f5e926

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

special-pages/pages/history/app/components/Item.module.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
.item {
2+
23
}
34

45
.title {
5-
height: 32px;
6+
--title-height: 32px;
7+
height: var(--title-height);
68
width: 100%;
79
font-size: var(--title-3-em-font-size);
810
font-weight: var(--title-3-em-font-weight);
@@ -17,7 +19,8 @@
1719
}
1820

1921
.row {
20-
height: 28px;
22+
--row-height: 28px;
23+
height: var(--row-height);
2124
display: flex;
2225
gap: 8px;
2326
align-items: center;
@@ -99,6 +102,7 @@
99102
text-overflow: ellipsis;
100103
text-decoration: none;
101104
color: inherit;
105+
line-height: var(--row-height);
102106
}
103107

104108
.domain {

special-pages/pages/history/app/mocks/mock-transport.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ const url = new URL(window.location.href);
77
* @typedef {import('@duckduckgo/messaging/lib/test-utils.mjs').SubscriptionEvent} SubscriptionEvent
88
*/
99

10+
/**
11+
* @template T
12+
* @param {T} value
13+
* @return {T}
14+
*/
15+
function clone(value) {
16+
return window.structuredClone?.(value) ?? JSON.parse(JSON.stringify(value));
17+
}
18+
1019
export function mockTransport() {
1120
/** @type {Map<string, (d: any)=>void>} */
1221
const subscriptions = new Map();
@@ -18,20 +27,20 @@ export function mockTransport() {
1827
};
1928
}
2029

21-
let memory = structuredClone(historyMocks.few).value;
30+
let memory = clone(historyMocks.few).value;
2231

2332
if (url.searchParams.has('history')) {
2433
const key = url.searchParams.get('history');
2534
if (key && key in historyMocks) {
26-
memory = structuredClone(historyMocks[key]).value;
35+
memory = clone(historyMocks[key]).value;
2736
} else if (key?.match(/^\d+$/)) {
2837
memory = generateSampleData({ count: parseInt(key), offset: 0 });
2938
}
3039
}
3140
// console.log(memory);
3241
return new TestTransportConfig({
3342
notify(_msg) {
34-
window.__playwright_01?.mocks?.outgoing?.push?.({ payload: structuredClone(_msg) });
43+
window.__playwright_01?.mocks?.outgoing?.push?.({ payload: clone(_msg) });
3544
/** @type {import('../../types/history.ts').HistoryMessages['notifications']} */
3645
const msg = /** @type {any} */ (_msg);
3746
console.warn('unhandled notification', msg);
@@ -40,7 +49,7 @@ export function mockTransport() {
4049
const sub = /** @type {any} */ (_msg.subscriptionName);
4150

4251
if ('__playwright_01' in window) {
43-
window.__playwright_01?.mocks?.outgoing?.push?.({ payload: structuredClone(_msg) });
52+
window.__playwright_01?.mocks?.outgoing?.push?.({ payload: clone(_msg) });
4453
subscriptions.set(sub, cb);
4554
return () => {
4655
subscriptions.delete(sub);
@@ -53,7 +62,7 @@ export function mockTransport() {
5362
},
5463
// eslint-ignore-next-line require-await
5564
request(_msg) {
56-
window.__playwright_01?.mocks?.outgoing?.push?.({ payload: structuredClone(_msg) });
65+
window.__playwright_01?.mocks?.outgoing?.push?.({ payload: clone(_msg) });
5766
/** @type {import('../../types/history.ts').HistoryMessages['requests']} */
5867
const msg = /** @type {any} */ (_msg);
5968

0 commit comments

Comments
 (0)