Skip to content

fix(F0Wizard): make wizard dialog full height to fix broken scroll#4737

Closed
martin1740 wants to merge 8 commits into
mainfrom
feat/wizard
Closed

fix(F0Wizard): make wizard dialog full height to fix broken scroll#4737
martin1740 wants to merge 8 commits into
mainfrom
feat/wizard

Conversation

@martin1740

Copy link
Copy Markdown

Summary

  • F0Wizard rendered its step content in a hardcoded h-[58vh] overflow-y-auto column, nested inside F0Dialog's own ScrollArea-managed content region — which never had a fixed height (only max-h-full unless fullHeight is passed).
  • With two independently-managed scroll containers and no bounded outer height, a step with enough fields to exceed 58vh (e.g. Factorial's it_management "new device" wizard, ~13 fields on its first step) got visually clipped instead of scrolling — users reported being unable to scroll down.
  • Threads the existing (but previously unwired) fullHeight prop from DialogWrapper up through F0Dialog's public props (DialogAlikeInternalPropsDialogInternal), and has F0Wizard opt into it so the dialog gets a real, fixed height. The step content now fills it via h-full instead of an arbitrary 58vh.
  • fullHeight defaults to false, so this is additive and doesn't change any other F0Dialog consumer. F0Drawer already relies on the same DialogWrapper.fullHeight mechanism, so this follows an established pattern.

Test plan

  • pnpm tsc on packages/react — no new errors introduced (pre-existing unrelated errors only, none in touched files)
  • pnpm lint (oxlint) on touched files — 0 warnings/errors
  • vitest run src/ui/F0Wizard src/components/dialog-alike — 100/100 tests passing, no regressions
  • Manual verification in a consuming app (e.g. Factorial's it_management new-device wizard) that the step content scrolls correctly with many fields

🤖 Generated with Claude Code

F0Wizard hardcoded its step-content column to h-[58vh], nested inside
F0Dialog's own ScrollArea-managed content region. Since F0Dialog never
had a fixed height (only max-h-full), the two independently-managed
scroll containers could clip content instead of scrolling it once a
step had enough fields to exceed 58vh (e.g. the it_management
new-device form).

Thread the existing (but previously unwired) fullHeight prop from
DialogWrapper up through F0Dialog's public props, and have F0Wizard
opt into it so the dialog gets a real fixed height and its step
content fills it via h-full instead of an arbitrary viewport fraction.
@github-actions github-actions Bot added fix react Changes affect packages/react labels Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

📦 Alpha Package Version Published

Use pnpm i github:factorialco/f0#npm/alpha-pr-4737 to install the package

Use pnpm i github:factorialco/f0#8d835f63296f6c73345dfcc78662f7682e16279d to install this specific commit

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

⚠️ Breaking public API changes (1)

These public exports were renamed/removed, or had a property/parameter removed, retyped, or newly required compared to main — that breaks consumers. Adding new exports or new optional props is always safe and is not flagged. If a breaking change is intentional, note it in the PR description and use a feat!:/BREAKING CHANGE commit so the release is a major bump.

Comparing f0, experimental and ai against main. Adding components, types, or optional props is safe. This check is non-blocking.

f0

  • ✏️ useF0DialogAlikeContextbreaking change

    • required return.fullHeight was added
    before → after
    // before
    () => DialogWrapperContextType
    // after
    () => DialogWrapperContextType

⚠️ Could not analyze component-status (no-base) — a build may have failed; results may be incomplete.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 59.62% 20932 / 35104
🔵 Statements 58.67% 21948 / 37409
🔵 Functions 51.85% 4877 / 9405
🔵 Branches 52.63% 15215 / 28909
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/components/dialog-alike/F0Dialog/internal/DialogInternal.tsx 87.5% 100% 75% 87.5% 60
packages/react/src/components/dialog-alike/common/Content.tsx 88.88% 87.5% 83.33% 100% 51, 59, 63
packages/react/src/components/dialog-alike/common/DialogWrapperProvider.tsx 100% 100% 66.66% 100%
packages/react/src/components/dialog-alike/common/Wrapper.tsx 93.1% 82.14% 87.5% 93.1% 129, 159-161
packages/react/src/components/dialog-alike/common/types.ts 100% 100% 100% 100%
packages/react/src/ui/F0Wizard/F0Wizard.tsx 100% 100% 85.71% 100%
Generated in workflow #15818 for commit f3870bb by the Vitest Coverage Report Action

@martin1740
martin1740 marked this pull request as ready for review July 20, 2026 12:13
@martin1740
martin1740 requested a review from a team as a code owner July 20, 2026 12:13
martin1740 and others added 7 commits July 20, 2026 14:35
Add tests for both the symptom (F0Wizard step content sizes to h-full
instead of a fixed viewport fraction) and the mechanism (fullHeight now
threads through DialogWrapper to DialogContent), so a future regression
in either spot is caught.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…d of clipping

Content's flex-1 wrapper had no min-h-0, so under the default flex
min-height:auto it never shrank below its content size. With fullHeight
set (F0Wizard), the parent's fixed height plus overflow-hidden meant
content taller than the dialog got clipped instead of scrolled, since
the ScrollArea never actually got constrained.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Simulate scrollHeight/clientHeight (jsdom does no real layout) and
assert the bottom scroll-shadow only disappears once the viewport has
actually reached the end of the content, so the fix is verified at a
behavioral level and not just via className assertions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…lly gets a real height

min-h-0 alone wasn't enough: Radix's ScrollArea wraps children in an
auto-height div, so a fullHeight consumer's own h-full (e.g. F0Wizard's
step row) had no definite ancestor height to resolve against and never
actually overflowed — nothing to scroll, so the outer dialog just
clipped it instead.

Content only reacted to position === "fullscreen" to force that
wrapper's height; fullHeight (position="center") never reached it since
DialogWrapperProvider didn't carry it. Thread fullHeight through the
context so Content applies the same h-full wrapper fix whenever the
dialog is fullHeight, not just when it's a fullscreen drawer.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes fix react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant