mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 21:11:14 +00:00
feat(native): Android tablets get the shortcuts, two panes meet at a foldable's fold
The Android shell now reports keyCommands and windowLayout, so the large screen layout no longer assumes an iPad: - The keyboard host hands the shortcuts to the app whenever the shell has the keyCommands feature, whatever the platform. Before it also required iOS, so an Android tablet with a keyboard answered the keys in the page and never listed them in the system's shortcuts. - useWindowFold follows the layout the Android shell reports (feature windowLayout). When a vertical fold separates the window, a foldable half open like a book, MobileShell marks it with data-fold and its place, and the leading pane (the trip's plan, a tab's summary, a list beside its detail) ends at the fold while the trailing one starts there, on either reading direction. A flat fold that does not separate stays one screen. - The split size class starts at 840pt, Android's expanded width, instead of 900pt, so a foldable unfolded on its side (about 841dp) gets two panes like an iPad does. An 11" iPad upright (834pt) stays a single pane. The address screen of the native shell follows the same width. - TrekShell exports NativeWindowLayout for it. Also: the sheet's width and anchor types and the collab board type stay private to their modules, which nothing else imports (knip).
This commit is contained in:
@@ -47,7 +47,7 @@ const DISCARD_BUTTON = 'rounded-full bg-danger px-4 py-2 text-body font-semibold
|
||||
* rather than a panel across the screen: compact for a short list of actions,
|
||||
* regular for a form, large for a sheet that holds a page of its own.
|
||||
*/
|
||||
export type MSheetWidth = 'compact' | 'regular' | 'large'
|
||||
type MSheetWidth = 'compact' | 'regular' | 'large'
|
||||
|
||||
// On a wide window (hooks/sizeClass.ts) a docked or floating sheet becomes
|
||||
// what iPadOS shows there: a form sheet centred over the dimmed page, as wide
|
||||
@@ -72,7 +72,7 @@ const POSITION: Record<MSheetVariant, string> = {
|
||||
* (the trip's More), the way iPadOS shows a menu next to the button that
|
||||
* opened it rather than in the middle of the screen.
|
||||
*/
|
||||
export type MSheetWideAnchor = 'center' | 'rail-foot'
|
||||
type MSheetWideAnchor = 'center' | 'rail-foot'
|
||||
const WIDE_ANCHOR: Record<MSheetWideAnchor, string> = {
|
||||
center: WIDE_POSITION,
|
||||
'rail-foot': 'wide:top-auto wide:translate-y-0 wide:end-auto wide:bottom-[calc(env(safe-area-inset-bottom,0px)+12px)] wide:start-[calc(var(--m-rail-w)+6px)]',
|
||||
|
||||
Reference in New Issue
Block a user