Skip to content

feat: improve template and component responsiveness#391

Draft
pkosiec wants to merge 4 commits into
mainfrom
pkosiec/responsiveness
Draft

feat: improve template and component responsiveness#391
pkosiec wants to merge 4 commits into
mainfrom
pkosiec/responsiveness

Conversation

@pkosiec
Copy link
Copy Markdown
Member

@pkosiec pkosiec commented May 19, 2026

Summary

Audit and improve responsiveness across the AppKit template and appkit-ui components so that scaffolded apps are mobile-friendly out of the box.

What was fixed

Template (affects every databricks apps init app):

  • Mobile navigation: Added Sheet/drawer nav with hamburger menu on mobile (<768px), horizontal nav on desktop. Uses useIsMobile hook and Sheet component from appkit-ui.
  • Viewport-relative chat heights: Replaced fixed h-[600px] with h-[min(600px,70vh)] on AgentChat, GeniePage, and ServingPage — prevents clipping on short mobile viewports.
  • Files page stacking: Directory list + preview panel now stack vertically on mobile (flex-col md:flex-row). Toolbar wraps responsively.
  • Jobs page wrapping: Controls use flex-wrap and input uses w-full sm:w-48 so they don't overflow on narrow screens.
  • Responsive padding: Header and main content use px-4 sm:px-6 / p-4 sm:p-6.

appkit-ui:

  • DataTable pagination: Footer stacks on mobile (flex-col-reverse sm:flex-row) so controls don't squish together.
  • Chart label overlap: Added containLabel: true to cartesian chart grid config. This makes ECharts auto-size the grid to include rotated axis labels, preventing them from overlapping the bottom legend.
  • Export useIsMobile hook: Now exported from @databricks/appkit-ui/react for consumer use.

Tooling:

  • Fix generate-app-templates: Added missing genie.genie-space.name field for genie templates.

What was already responsive (no changes needed)

  • Charts (width): echarts-for-react auto-resizes width; height is consumer-configurable via prop.
  • Genie components: Well-structured flexbox layout with ScrollArea and ResizeObserver. Message bubbles use max-w-[80%] + break-words.
  • File browser components: DirectoryList, FileEntry, FilePreviewPanel already handle overflow and truncation.
  • shadcn/ui primitives: Dialog, Sheet, Drawer, Breadcrumb, Pagination, etc. all use Radix viewport-aware positioning and Tailwind responsive classes.

Screenshots

Screenshots taken from the generated appkit-all-in-one template using Chrome DevTools MCP.
desktop-analytics
desktop-files
desktop-genie
desktop-home
mobile-analytics
mobile-files
mobile-genie-messages
mobile-home
mobile-nav-open
mobile-serving

Desktop (1440x900)

Home Analytics Files Genie
Horizontal nav 3-column grid, charts Side-by-side layout Chat container

Mobile (375x812)

Home Nav Open Genie Messages Files Serving Analytics
Hamburger menu Sheet with vertical links User/AI bubbles at max-w-80% Stacked vertically Viewport-relative height Single-column cards

Test plan

  • pnpm build passes
  • pnpm test passes (3 pre-existing telemetry test failures, unrelated)
  • pnpm -r typecheck passes
  • Generated appkit-all-in-one template with DATABRICKS_CLI=dbx pnpm generate:app-templates
  • Installed local SDK tarballs and ran dev server
  • Chrome DevTools MCP visual verification at 375px (mobile) and 1440px (desktop)
    • Mobile: hamburger nav with Sheet, viewport-relative heights, stacked Files, Genie message bubbles responsive
    • Desktop: horizontal nav, multi-column grids, side-by-side Files layout, charts with proper label spacing

pkosiec added 4 commits May 19, 2026 20:05
- Add responsive mobile navigation with Sheet/drawer (hamburger menu on
  mobile, horizontal nav on desktop) to the template shell
- Replace fixed h-[600px] with h-[min(600px,70vh)] on chat containers
  (AgentChat, GeniePage, ServingPage) so they don't clip on short viewports
- Make FilesPage stack vertically on mobile with responsive toolbar
- Make JobsPage controls wrap on narrow screens
- Export useIsMobile hook from appkit-ui for consumer use
- Make DataTable pagination footer responsive (stacks on mobile)
- Fix generate-app-templates genie-space missing name field

Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
Add containLabel: true to ECharts grid config in all chart option
builders. This makes ECharts auto-size the grid to include rotated
axis labels, preventing them from overlapping the bottom legend.

Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
Add containLabel: true to the cartesian chart grid config only.
When x-axis has >10 items, labels rotate 45deg and can extend into
the legend area. containLabel makes ECharts auto-size the grid to
include axis labels, preventing the overlap.

Only applied to buildCartesianOption (line/bar/area/scatter) where
rotated labels cause the issue. Horizontal bar and heatmap grids
are left unchanged — their label layouts don't have this problem.

Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
SheetContent already provides gap-4 between its children,
so the extra mt-4 on NavLinks was doubling the spacing.

Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant