Skip to content

feat: add landscape-optimized layouts for analytics charts - #1111

Open
onajidavid87-web wants to merge 2 commits into
Nanle-code:masterfrom
onajidavid87-web:Add-landscape-optimized-layouts-for-analytics-charts
Open

onajidavid87-web wants to merge 2 commits into
Nanle-code:masterfrom
onajidavid87-web:Add-landscape-optimized-layouts-for-analytics-charts

Conversation

@onajidavid87-web

@onajidavid87-web onajidavid87-web commented Sep 28, 2026 •

Copy link
Copy Markdown

Summary

Adds landscape-optimized compositions for key analytics charts on tablets and mobile devices.

  • Orientation Detection (src/hooks/useResponsive.ts): Added isLandscape, isTabletLandscape, orientation, and windowHeight state with window resize and orientation change listeners.
  • Landscape Composition Layout (src/components/charts/LandscapeAnalyticsLayout.tsx): Renders a side-by-side split grid for charts and metric panels in landscape mode, constrains chart height (maxHeight="min(360px, 55vh)") to prevent vertical scrolling overflow, provides an orientation badge with manual view toggles, and includes input validation and localized ErrorBoundary recovery.
  • Analytics Views Integration: Integrated LandscapeAnalyticsLayout into AnalyticsChart.tsx, TransactionAnalyticsDashboard.tsx, and updated MobileChartContainer.tsx for dynamic landscape height scaling.
  • Documentation: Updated MOBILE_OPTIMIZATION_GUIDE.md and RESPONSIVE_FEATURES.md with usage guidance, compatibility, security, and migration notes.

How was this tested?

Tested with Vitest unit tests (npx vitest run src/components/charts/__tests__/LandscapeAnalyticsLayout.test.tsx src/hooks/__tests__/useResponsive.test.ts), ESLint (npx eslint), Prettier formatting (npx prettier --check), and TypeScript type checks (pnpm run type-check).

  • Primary Flow: Verified side-by-side rendering in tablet landscape viewports, tablet orientation badge display, and manual view mode toggling (Side-by-Side vs. Stacked).
  • Boundary Case: Verified behavior at exact breakpoint boundaries (768px × 600px landscape viewport), 1:1 aspect ratio, and empty datasets ([]).
  • Failure Case: Verified handling of corrupt/invalid dataset inputs (data={null}, data={NaN}), missing window.matchMedia/SSR fallback, and error boundary recovery when child chart components throw rendering errors.

Merge requirements

A PR is merged only when every box below is true. See
Merge requirements for the full policy.

  • All required CI checks pass on the latest commit (not just an earlier push).
  • No required checks are failing, pending, or skipped — re-run or fix them; do not ask for a merge while any are outstanding.
  • The branch has no merge conflicts with the target branch (rebase or merge master if GitHub shows "This branch has conflicts").
  • Tests were added or updated for the change (primary flow, a boundary case, and a failure case).
  • Docs were updated where behaviour, configuration, or security posture changed.

Closes #889

@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

@onajidavid87-web is attempting to deploy a commit to the nanle-code's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 28, 2026

Copy link
Copy Markdown

@onajidavid87-web Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Manuelshub

Copy link
Copy Markdown
Collaborator

@onajidavid87-web Please resolve conflicts

@onajidavid87-web

Copy link
Copy Markdown
Author

@onajidavid87-web Please resolve conflicts

Resolved

This branch has not been deployed

No deployments
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.

[2026 Mobile] Add landscape-optimized layouts for analytics charts

2 participants