fix(app): polish workspace navigation surfaces
Use mobile action sheets and long-press file menus while preserving provider context across sheet portals. Keep sidebar and file-pane glyphs on shared visual rails, avoid scrollbar layout shifts, and hide keyboard affordances where shortcuts are unavailable.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { keyboardShortcutsAvailable } from "./availability";
|
||||
|
||||
describe("keyboardShortcutsAvailable", () => {
|
||||
it("matches the environments where the shortcut dispatcher runs", () => {
|
||||
expect(keyboardShortcutsAvailable({ isNative: false, isCompact: false })).toBe(true);
|
||||
expect(keyboardShortcutsAvailable({ isNative: false, isCompact: true })).toBe(false);
|
||||
expect(keyboardShortcutsAvailable({ isNative: true, isCompact: false })).toBe(false);
|
||||
expect(keyboardShortcutsAvailable({ isNative: true, isCompact: true })).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
import { useIsCompactFormFactor } from "@/constants/layout";
|
||||
import { isNative } from "@/constants/platform";
|
||||
|
||||
interface KeyboardShortcutEnvironment {
|
||||
isNative: boolean;
|
||||
isCompact: boolean;
|
||||
}
|
||||
|
||||
export function keyboardShortcutsAvailable({
|
||||
isNative: native,
|
||||
isCompact,
|
||||
}: KeyboardShortcutEnvironment): boolean {
|
||||
return !native && !isCompact;
|
||||
}
|
||||
|
||||
export function useKeyboardShortcutsAvailable(): boolean {
|
||||
const isCompact = useIsCompactFormFactor();
|
||||
return keyboardShortcutsAvailable({ isNative, isCompact });
|
||||
}
|
||||
Reference in New Issue
Block a user