mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-10-31 08:13:50 +00:00
fix: keep plugin buttons in the composer's bottom bar from running over Discard
This commit is contained in:
@@ -366,6 +366,11 @@ describe('composer-options-menu and composer-toolbar-actions', () => {
|
||||
const button = screen.getByRole('button', { name: 'Assistant' });
|
||||
expect(button).toHaveAttribute('title', 'Assistant (Alt+A)');
|
||||
expect(button.className).toContain('h-9');
|
||||
// Icon only unless the bar is wide enough for the label next to the app's buttons.
|
||||
expect(button.querySelector('span')!.className).toContain('@[44rem]/composer-bar:inline');
|
||||
let bar: HTMLElement | null = button;
|
||||
while (bar && !bar.classList.contains('@container/composer-bar')) bar = bar.parentElement;
|
||||
expect(bar).not.toBeNull();
|
||||
// Not in the plugin frame row above the bar.
|
||||
expect(button.closest('[data-composer-plugin-row]')).toBeNull();
|
||||
await act(async () => { fireEvent.click(button); });
|
||||
|
||||
@@ -178,7 +178,9 @@ export function ComposerPluginToolbarButtons({ surface, context }: { surface: "c
|
||||
onClick={() => { void runAction(action, surface, context()); }}
|
||||
>
|
||||
<Icon className="w-4 h-4" />
|
||||
<span className="hidden sm:inline text-sm">{action.label}</span>
|
||||
{/* The label only when the bar has room for it next to the app's own
|
||||
buttons; otherwise the icon, with the label as tooltip. */}
|
||||
<span className="hidden @[44rem]/composer-bar:inline text-sm">{action.label}</span>
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -3995,7 +3995,7 @@ export function EmailComposer({
|
||||
<div
|
||||
data-mv-compose-footer={mvWindow ? "" : undefined}
|
||||
className={cn(
|
||||
"flex items-center justify-between px-4 py-2.5 bg-background shrink-0 pb-[calc(0.625rem+env(safe-area-inset-bottom)/2)]",
|
||||
"@container/composer-bar flex items-center justify-between px-4 py-2.5 bg-background shrink-0 pb-[calc(0.625rem+env(safe-area-inset-bottom)/2)]",
|
||||
mvWindow ? "gap-1" : "border-t",
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user