fix(open-in-app): scale the empty-state opener chevron up and trim its height to 36px

This commit is contained in:
Yif committed 2026-09-21 14:15:11 +08:00
1 parent 6cb1cd921f
commit 9a485724f6
3 files changed
+6 -4

No files matched your search

@@ -62,19 +62,19 @@
/* The unavailable preview emphasizes the same actions with a labeled button. */
.split[data-size='large'] {
height: 40px;
height: 36px;
border-radius: 14px;
border-color: var(--dsw-alias-border-l2);
}
.split[data-size='large'] .main {
gap: 6px;
padding: 8px 14px;
padding: 6px 14px;
font-size: 14px;
}
.split[data-size='large'] .chevron {
padding: 8px 10px;
padding: 6px 10px;
}
.skeleton { display: inline-block; flex: none; border-radius: 3px; background: var(--dsw-alias-interactive-bg-hover); }
@@ -133,7 +133,7 @@ export function OpenTargetButton(props: OpenTargetButtonProps): ReactNode {
setMenuOpen(value => !value)
}}
>
<IconChevronDownOutlineRegular size={10} />
<IconChevronDownOutlineRegular size={props.prominent ? 14 : 10} />
</button>}
</div>
)}
@@ -256,6 +256,8 @@ it('uses the same application menu in the prominent empty-state control', async
const view = render(<OpenPathEmptyAction {...b.props} />)
await act(async () => {})
expect(view.container.querySelector('[data-open-target]')?.getAttribute('data-size')).toBe('large')
// The large control scales the menu chevron up from the compact 10px glyph.
expect(screen.getByRole('button', { name: zh['path.more'] }).querySelector('svg')?.getAttribute('width')).toBe('14')
await act(async () => { fireEvent.click(screen.getByRole('button', { name: zh['path.more'] })) })
expect(screen.getAllByRole('menuitem').map(item => item.textContent)).toEqual(['Music(默认)', zh['path.reveal']])
await act(async () => { fireEvent.click(screen.getByRole('menuitem', { name: 'Music(默认)' })) })