Skip to content

Commit b94c99b

Browse files
committed
fix(icons): rail 图标 16px + fetch 虚线改原生 strokeDasharray(修 round 端帽填缝糊线) + 底线加粗
- Icon 组件 shape 支持 {d, w, dash} 单 path 覆盖 - fetch:杆为单 path dasharray 2.4/2.6(规则重复不再糊),底线 w:2 对齐 VS Code 笔画层级 - rail/组头图标 15 -> 16(用户反馈尺寸没加大)
1 parent f3ff15d commit b94c99b

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

‎src/client.js‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8243,7 +8243,7 @@ window.__ModuleLoader__.load({
82438243
fetch — a BROKEN stem: the references come down, nothing is merged;
82448244
pull — a solid stem pointing down: the remote lands here;
82458245
push — a solid stem pointing up: the local goes out. */
8246-
fetch: ['M8 2v1.6', 'M8 4.8v1.6', 'M8 7.7v1.6', 'M4.6 6.4 8 9.8l3.4-3.4', 'M3 13h10'],
8246+
fetch: [{ d: 'M8 1.5v8.3', dash: '2.4 2.6' }, { d: 'M4.6 6.4 8 9.8l3.4-3.4' }, { d: 'M3 13h10', w: 2 }],
82478247
pull: ['M8 2v7.8', 'M4.6 6.4 8 9.8l3.4-3.4', 'M3 13h10'],
82488248
push: ['M8 9.8V2.2', 'M4.6 5.6 8 2.2l3.4 3.4', 'M3 13h10'],
82498249
plus: ['M8 3v10', 'M3 8h10'],
@@ -8295,11 +8295,22 @@ window.__ModuleLoader__.load({
82958295
const size = props.size === undefined ? 14 : props.size
82968296
const shape = ICONS[props.name] === undefined ? ICONS.commit : ICONS[props.name]
82978297
const weight = props.name === 'more' ? 2.6 : props.name === 'grip' ? 1.6 : 1.4
8298+
/* A shape entry is either a plain `d` string or { d, w, dash } for
8299+
per-path overrides — fetch's broken stem needs a real stroke-dasharray
8300+
(hand-drawn gaps were being re-filled by the round line caps at 15px),
8301+
and its ground rail carries a heavier stroke like the VS Code original. */
82988302
return E('svg', {
82998303
className: 'dig-icon', width: size, height: size, viewBox: '0 0 16 16',
83008304
fill: 'none', stroke: 'currentColor', strokeWidth: weight,
83018305
strokeLinecap: 'round', strokeLinejoin: 'round',
8302-
}, shape.map((d, index) => E('path', { key: index, d: d })))
8306+
}, shape.map((entry, index) => {
8307+
const path = typeof entry === 'string' ? { d: entry } : entry
8308+
return E('path', {
8309+
key: index, d: path.d,
8310+
strokeWidth: path.w === undefined ? undefined : path.w,
8311+
strokeDasharray: path.dash === undefined ? undefined : path.dash,
8312+
})
8313+
}))
83038314
}
83048315

83058316
/* Menus are laid out INSIDE the panel on purpose: dsh-better-sidebar's bottom
@@ -9662,7 +9673,7 @@ window.__ModuleLoader__.load({
96629673
title: t('toolbar.more'),
96639674
'data-action': 'more',
96649675
onClick: (event) => props.onMoreMenu(event),
9665-
}, E(Icon, { name: 'more', size: 15 })))
9676+
}, E(Icon, { name: 'more', size: 16 })))
96669677
return E('div', { className: 'dig-changes' },
96679678
aiConfirmDialog,
96689679
head,
@@ -11568,7 +11579,7 @@ window.__ModuleLoader__.load({
1156811579
title: action.disabled === true ? action.label + ' · ' + reason : action.label,
1156911580
disabled: action.disabled === true,
1157011581
onClick: action.run,
11571-
}, E(Icon, { name: action.icon, size: 15 })))
11582+
}, E(Icon, { name: action.icon, size: 16 })))
1157211583
if (overflow === true) {
1157311584
children.push(E('button', {
1157411585
key: 'more',
@@ -11602,7 +11613,7 @@ window.__ModuleLoader__.load({
1160211613
if (target === 'page') { openSettingsPage(); return }
1160311614
setRailSettings(true)
1160411615
},
11605-
}, E(Icon, { name: 'settings', size: 15 })))
11616+
}, E(Icon, { name: 'settings', size: 16 })))
1160611617
return E('div', { className: vertical ? 'dig-rail' : 'dig-rail-row', ref: railHostRef }, children)
1160711618
}
1160811619

‎tests/smoke.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ test('the settings entry draws a gear, not a sunburst', () => {
14411441
for (const ray of ['M8 1.8v1.5', 'M8 12.7v1.5', 'M1.8 8h1.5', 'M12.7 8h1.5']) {
14421442
assert.ok(line.indexOf(ray) < 0, 'no sun ray survives in the gear: ' + ray)
14431443
}
1444-
assert.match(client, /E\(Icon, \{ name: 'settings', size: 15 \}\)/, 'the rail settings button still uses it')
1444+
assert.match(client, /E\(Icon, \{ name: 'settings', size: 16 \}\)/, 'the rail settings button still uses it')
14451445
})
14461446

14471447
test('the rail settings live in the row Config, with localStorage only as the legacy home', () => {

0 commit comments

Comments
 (0)