🎨 style(driver-manager): 精简驱动卡片重复信息

- 移除卡片标题中的内部驱动类型,仅保留展示名和状态徽章
- 删除更新原因区域重复的重装标题,保留具体 revision 说明
- 覆盖普通弹窗、嵌入设置页和多语言重装提示
This commit is contained in:
Syngnat
2026-07-23 09:36:58 +08:00
parent 8c0e685429
commit 430e27fb1e
3 changed files with 19 additions and 2 deletions

View File

@@ -492,6 +492,10 @@ describe('DriverManagerModal i18n', () => {
});
const content = textContent(renderer!.toJSON());
const titleRow = renderer!.root.findByProps({ className: 'driver-manager-title-row' });
const updateNote = renderer!.root.findByProps({ className: 'driver-manager-update-note' });
expect(textContent(titleRow)).toContain('Reinstall needed');
expect(updateNote.findAll((node) => node.type === 'span' && textContent(node) === 'Reinstall required')).toHaveLength(0);
expect(content).toContain('Reinstall required to apply driver updates.');
expect(content).toContain('Affects 3 saved connections');
expect(content).toContain('installed revision rev-old');

View File

@@ -279,6 +279,21 @@ describe('DriverManagerModal toolbar actions', () => {
expect(findButton(modalRenderer!, t('driver.modal.card.action.install')).props.size).toBeUndefined();
});
it('shows the driver display name without repeating its internal type', async () => {
for (const embedded of [false, true]) {
let renderer: ReactTestRenderer;
await act(async () => {
renderer = create(<DriverManagerModal open embedded={embedded} onClose={vi.fn()} />);
});
await flushPromises();
const titleRow = renderer!.root.findByProps({ className: 'driver-manager-title-row' });
const titleText = textContent(titleRow);
expect(titleText).toContain('DuckDB');
expect(titleText).not.toContain('duckdb');
}
});
it('releases install action when the driver install watchdog expires', async () => {
vi.useFakeTimers();
try {

View File

@@ -1768,7 +1768,6 @@ const DriverManagerModal: React.FC<{ open: boolean; onClose: () => void; onBack?
<div className="driver-manager-card-info">
<div className="driver-manager-title-row">
<Text strong className="driver-manager-driver-name">{row.name}</Text>
<Tag>{embedded ? <code>{row.type}</code> : row.type}</Tag>
{resolveDriverStatusTag(row)}
</div>
<div className="driver-manager-meta-row">
@@ -1778,7 +1777,6 @@ const DriverManagerModal: React.FC<{ open: boolean; onClose: () => void; onBack?
</div>
{row.needsUpdate && statusMessage ? (
<div className="driver-manager-update-note" style={managerUpdateNoteStyle}>
<Text strong type="warning">{t('driver.modal.card.needsUpdate')}</Text>
<Paragraph
className="driver-manager-note-text"
ellipsis={{ rows: 2, expandable: true, symbol: t('driver.modal.card.expandReason') }}