fix(FN-1162): keep mobile file browser header controls accessible
- Update file browser header styles to wrap cleanly on small screens and preserve readable truncated labels - Increase mobile close-button hit area and keep close action visible within header actions layout - Add responsive WorkspaceSelector constraints to prevent menu/trigger overflow on narrow viewports - Add a regression test that verifies the mobile close button remains visible and clickable
This commit is contained in:
@@ -145,6 +145,33 @@ describe("FileBrowserModal", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps mobile close button visible and clickable", async () => {
|
||||
Object.defineProperty(window, "innerWidth", {
|
||||
writable: true,
|
||||
configurable: true,
|
||||
value: 375,
|
||||
});
|
||||
|
||||
const { container } = render(
|
||||
<FileBrowserModal
|
||||
initialWorkspace="project"
|
||||
isOpen={true}
|
||||
onClose={mockOnClose}
|
||||
/>,
|
||||
);
|
||||
|
||||
fireEvent(window, new Event("resize"));
|
||||
|
||||
const closeButton = container.querySelector("button.modal-close");
|
||||
expect(closeButton).toBeInTheDocument();
|
||||
expect(closeButton).toBeVisible();
|
||||
|
||||
fireEvent.click(closeButton!);
|
||||
await waitFor(() => {
|
||||
expect(mockOnClose).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
it("closes on Escape and saves on Cmd+S", () => {
|
||||
mockUseWorkspaceFileEditor.mockReturnValue({
|
||||
...defaultEditorState,
|
||||
|
||||
@@ -109,3 +109,21 @@
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.workspace-selector-trigger {
|
||||
min-width: 0;
|
||||
max-width: min(56vw, 160px);
|
||||
}
|
||||
|
||||
.workspace-selector-menu {
|
||||
left: auto;
|
||||
right: 0;
|
||||
min-width: min(300px, calc(100vw - 24px));
|
||||
max-width: calc(100vw - 24px);
|
||||
}
|
||||
|
||||
.workspace-selector-option-meta {
|
||||
max-width: 120px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user