Skip to content

Commit 3740319

Browse files
More responsiveness touch-ups (#3361)
Adding back some fixes from the very first PR (#2087) and more general improvements. We can also log any other responsive funkiness to fix here. --- **1. Date range picker** — below 1000px the date text is screen-reader-only and the control is the calendar icon. <img width="483" height="554" alt="image" src="https://github.com/user-attachments/assets/52f8a405-8d28-4132-95c9-3abeca300e4d" /> **2. Properties table** — labels stack above values so long IDs don’t overflow. Two-column tables still sit side-by-side from 1000px up. <img width="480" height="236" alt="image" src="https://github.com/user-attachments/assets/5f03f75d-4d26-4098-94dd-d0d0b4cc1a7b" /> **4. Sticky tabs** — page tab lists stick under the top bar. Sticky is on a wrapper so it doesn’t fight horizontal scroll. Form tab lists (instance create) stay in flow. <img width="484" height="225" alt="image" src="https://github.com/user-attachments/assets/5346d7d4-4834-44b2-9a12-adcfcb03c80b" /> **5. Metrics / utilization filters** — toolbars stack and listboxes go full width. Instance metrics side tabs (CPU / Disk / Network) move to a horizontal row so they don’t eat half the phone. **6. CLI command** — hidden below 1000px on Connect and the serial console footer. **7. Adjust menu icon button size** — fills cell and narrower <img width="431" height="87" alt="image" src="https://github.com/user-attachments/assets/6e4b0a4b-969c-47d0-879a-cfa9423be9ab" /> **8. Fix error message container width** **9. Tighter pagination footer density** **10. Improve card header button wrapping** <img width="481" height="349" alt="image" src="https://github.com/user-attachments/assets/09dd3154-9fe9-40de-8d42-8547e6942f9f" /> **11. Improve page header wrapping and truncation** <img width="506" height="162" alt="image" src="https://github.com/user-attachments/assets/34f73385-0c9f-4beb-9b46-74eebee92d00" /> <img width="472" height="148" alt="image" src="https://github.com/user-attachments/assets/1ae99998-a091-426b-829e-4ff683adc8da" /> **12. Avoid sticky tab bar overlapping main top bar and disable overscroll bounce** --- Todo: - [ ] Can't see disk name in mini-table (additional disks) --------- Co-authored-by: David Crespo <[email protected]>
1 parent 5f7377b commit 3740319

27 files changed

Lines changed: 257 additions & 87 deletions

‎app/components/CopyCode.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ export function EquivalentCliCommand({ project, instance }: EquivProps) {
9898

9999
return (
100100
<>
101-
<Button variant="secondary" size="sm" onClick={() => setIsOpen(true)}>
101+
<Button
102+
variant="secondary"
103+
size="sm"
104+
className="max-1000:hidden"
105+
onClick={() => setIsOpen(true)}
106+
>
102107
CLI Command
103108
</Button>
104109
<CopyCodeModal

‎app/components/DocsPopover.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const DocsPopover = ({ heading, icon, summary, links }: DocsPopoverProps)
5454
</PopoverButton>
5555
<PopoverPanel
5656
// popover-panel needed for enter animation
57-
className="popover-panel bg-raise light:bg-default shadow-menu z-10 w-96 rounded-lg"
57+
className="popover-panel bg-raise light:bg-default shadow-menu z-(--z-popover) w-96 rounded-lg"
5858
anchor={{ to: 'bottom end', gap: 12, padding: 16 }}
5959
>
6060
<div className="px-4">

‎app/components/ErrorPage.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function ErrorPage({ children }: Props) {
4040
</Link>
4141
<SignOutButton className="mt-4 mr-6" />
4242
</div>
43-
<div className="bg-raise! shadow-modal max-1000:w-[calc(100%-var(--content-gutter)*2)] absolute top-1/2 left-1/2 flex w-96 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center space-y-4 rounded-lg p-8">
43+
<div className="bg-raise! shadow-modal max-1000:w-[calc(100%-var(--content-gutter)*2)] absolute top-1/2 left-1/2 flex max-w-96 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center space-y-4 rounded-lg p-8">
4444
<div className="my-2 flex h-12 w-12 items-center justify-center">
4545
<div className="bg-destructive-inverse absolute h-10 w-10 rounded-full opacity-40 motion-safe:animate-[ping_2s_cubic-bezier(0,0,0.2,1)_infinite]" />
4646
<Error12Icon className="text-error light:text-error-secondary relative h-8 w-8" />

‎app/components/FilterPopover.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function FilterPopover<TFieldValues extends FieldValues>({
9595
</div>
9696
</PopoverButton>
9797
<PopoverPanel
98-
className="popover-panel bg-raise light:bg-default shadow-menu z-10 w-96 rounded-lg"
98+
className="popover-panel bg-raise light:bg-default shadow-menu z-(--z-popover) w-96 rounded-lg"
9999
anchor={{ to: 'bottom end', gap: 12, padding: 16 }}
100100
>
101101
<FilterForm

‎app/components/InstanceAutoRestartPopover.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const InstanceAutoRestartPopover = ({ instance }: { instance: Instance })
5050
</PopoverButton>
5151
<PopoverPanel
5252
// popover-panel needed for enter animation
53-
className="popover-panel bg-raise light:bg-default shadow-menu z-10 w-96 rounded-lg"
53+
className="popover-panel bg-raise light:bg-default shadow-menu z-(--z-popover) w-96 rounded-lg"
5454
anchor={{ to: 'bottom start', gap: 12 }}
5555
>
5656
<PopoverRow label="Auto Restart">

‎app/components/Pagination.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { PageFooter } from './PageFooter'
1515
export function Pagination(props: UIPaginationProps) {
1616
return (
1717
<PageFooter>
18-
<UIPagination className="gutter h-14 py-5" {...props} />
18+
<UIPagination className="gutter py-4" {...props} />
1919
</PageFooter>
2020
)
2121
}

‎app/components/QueryParamTabs.tsx‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import cn from 'classnames'
12
/*
23
* This Source Code Form is subject to the terms of the Mozilla Public
34
* License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -32,5 +33,12 @@ export function QueryParamTabs(props: TabsRootProps) {
3233
setSearchParams(nextParams, { replace: true })
3334
}
3435

35-
return <Tabs.Root {...props} value={value} onValueChange={onValueChange} />
36+
return (
37+
<Tabs.Root
38+
{...props}
39+
className={cn('ox-tabs-sticky', props.className)}
40+
value={value}
41+
onValueChange={onValueChange}
42+
/>
43+
)
3644
}

‎app/components/RouteTabs.tsx‎

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ const selectTab = (e: React.KeyboardEvent<HTMLDivElement>) => {
3838
}
3939
}
4040

41+
function RouteTabList({
42+
className,
43+
children,
44+
}: {
45+
className?: string
46+
children: ReactNode
47+
}) {
48+
return (
49+
// Keyboard nav is handled on the tablist; individual tabs take focus.
50+
// oxlint-disable-next-line jsx-a11y/interactive-supports-focus
51+
<div role="tablist" className={className} onKeyDown={selectTab}>
52+
{children}
53+
</div>
54+
)
55+
}
56+
4157
export interface RouteTabsProps {
4258
children: ReactNode
4359
fullWidth?: boolean
@@ -54,23 +70,24 @@ export function RouteTabs({
5470
tabListClassName,
5571
}: RouteTabsProps) {
5672
/* TODO: Add aria-describedby for active tab */
73+
const tabList = (
74+
<RouteTabList
75+
className={cn(sideTabs ? 'ox-side-tabs-list' : 'ox-tabs-list', tabListClassName)}
76+
>
77+
{children}
78+
</RouteTabList>
79+
)
80+
5781
return (
5882
<div
59-
className={cn(sideTabs ? 'ox-side-tabs flex' : 'ox-tabs', {
83+
className={cn(sideTabs ? 'ox-side-tabs flex' : 'ox-tabs ox-tabs-sticky', {
6084
'full-width': !sideTabs && fullWidth,
6185
})}
6286
>
63-
{/* eslint-disable-next-line jsx-a11y/interactive-supports-focus */}
64-
<div
65-
role="tablist"
66-
className={cn(sideTabs ? 'ox-side-tabs-list' : 'ox-tabs-list', tabListClassName)}
67-
onKeyDown={selectTab}
68-
>
69-
{children}
70-
</div>
87+
{sideTabs ? tabList : <div className="ox-tabs-list-wrap">{tabList}</div>}
7188

7289
<div
73-
className={cn('ox-tabs-panel @container', { 'ml-5 grow': sideTabs })}
90+
className={cn('ox-tabs-panel @container', { 'grow 1000:ml-5': sideTabs })}
7491
role="tabpanel"
7592
tabIndex={0}
7693
>

‎app/components/TopBar.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ function MobileNavToggle() {
6262
return (
6363
// full-height cell with a right border so the toggle reads as its own
6464
// region, mirroring the desktop home button cell
65-
<div className="border-secondary 1000:hidden -ml-3 flex h-(--top-bar-height) shrink-0 items-center border-r px-1.5">
65+
<div className="border-secondary 1000:hidden -ml-3 flex h-(--top-bar-height) shrink-0 items-center border-r">
6666
<button
6767
type="button"
6868
onClick={toggleMobileNav}
6969
aria-label="Toggle sidebar"
7070
aria-expanded={isOpen}
71-
className="hover:bg-hover flex h-10 w-10 items-center justify-center rounded-md"
71+
className="hover:bg-hover flex h-full w-10 items-center justify-center"
7272
>
7373
<Icon className="text-secondary" />
7474
</button>

‎app/components/form/fields/DisksTableField.tsx‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function DisksTableField({
6464

6565
return (
6666
<>
67-
<div className="flex max-w-lg flex-col items-end gap-3">
67+
<div className="flex max-w-lg flex-col gap-3">
6868
<MiniTable
6969
ariaLabel="Disks"
7070
items={items}
@@ -75,19 +75,13 @@ export function DisksTableField({
7575
emptyState={{ title: 'No disks', body: 'Add a disk to see it here' }}
7676
/>
7777

78-
<div className="max-1000:flex-col flex gap-3">
79-
<Button
80-
size="sm"
81-
className="max-1000:w-full"
82-
onClick={() => setShowDiskCreate(true)}
83-
disabled={disabled}
84-
>
78+
<div className="max-1000:flex-col 1000:justify-end flex gap-3">
79+
<Button size="sm" onClick={() => setShowDiskCreate(true)} disabled={disabled}>
8580
Create new disk
8681
</Button>
8782
<Button
8883
variant="secondary"
8984
size="sm"
90-
className="max-1000:w-full"
9185
onClick={() => setShowDiskAttach(true)}
9286
disabled={disabled}
9387
>

0 commit comments

Comments
 (0)