Skip to content

Conversation

@ENvironmentSet
Copy link
Collaborator

@ENvironmentSet ENvironmentSet commented Nov 20, 2025

This PR allows users to customize

  • padding wrapping appbar contents via containerPadding
  • spacing from left/right content area to main title area via itemGap
  • font-size applied to title via fontSize
  • back button touch area expansion via hitSlop

@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2025

🦋 Changeset detected

Latest commit: a9b7d21

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stackflow/plugin-basic-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 20, 2025

Deploying stackflow-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: a9b7d21
Status: ✅  Deploy successful!
Preview URL: https://5ca73574.stackflow-demo.pages.dev
Branch Preview URL: https://expose-appbar-sizing-options.stackflow-demo.pages.dev

View logs

@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • AppBar now exposes additional customizable properties: container padding, item gap, font size, line height, and hit target size, allowing greater flexibility in styling and layout configuration across platforms.

✏️ Tip: You can customize this high-level summary in your review settings.

Summary by CodeRabbit

  • New Features
    • Added customizable AppBar options for container padding, item gap, font size, line height, touch hit‑slop, and minHeight; exposed as GlobalVars and AppBar props and wired to CSS variables.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Adds five new AppBar global vars (containerPadding, itemGap, fontSize, lineHeight, hitSlop) plus minHeight; populates android defaults and cupertino lineHeight; replaces hard-coded AppBar spacing/typography with those vars and exposes them as AppBar props mapped to CSS variables.

Changes

Cohort / File(s) Summary
Global variable definitions
extensions/plugin-basic-ui/src/basicUIPlugin.css.ts
Adds containerPadding, itemGap, fontSize, lineHeight, and hitSlop to GLOBAL_VARS.appBar; sets Android defaults ("1rem", "1rem", "1.125rem", "1.5", "0.5rem" respectively); cupertinoValues.appBar sets lineHeight: "normal" (inherits other values).
Basic UI plugin wiring
extensions/plugin-basic-ui/src/basicUIPlugin.tsx
Maps new appBar options (containerPadding, itemGap, fontSize, lineHeight, hitSlop) into the root inline CSS variables via assignInlineVars, exposing them from _options.appBar.
CSS styling refactor
extensions/plugin-basic-ui/src/components/AppBar.css.ts
Replaces hard-coded paddings/margins/sizes with globalVars.appBar keys (containerPadding, itemGap, hitSlop, fontSize, lineHeight); updates container, left, backButton, centerMain, centerMainEdge, and right rules to consume those vars.
Component props and wiring
extensions/plugin-basic-ui/src/components/AppBar.tsx
Adds minHeight, fontSize, lineHeight, hitSlop, containerPadding, and itemGap to AppBarProps; accepts them and assigns corresponding CSS variables using assignInlineVars.
Release metadata
.changeset/clean-points-cross.md
Adds a changeset documenting a minor release for @stackflow/plugin-basic-ui describing the new AppBar interfaces.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant App as Consumer
  participant AppBar as AppBar component
  participant RootVars as BasicUI root (assignInlineVars)
  participant Styles as AppBar stylesheet

  Note over App,AppBar `#D6EAF8`: Props passed (minHeight, containerPadding, itemGap, fontSize, lineHeight, hitSlop)
  App->>AppBar: render(props)
  AppBar->>RootVars: assignInlineVars(map appBar.* → CSS vars)
  RootVars->>Styles: expose CSS variables to stylesheet
  Styles->>AppBar: compute layout (padding, gaps, font-size, line-height, hit‑slop)
  AppBar-->>App: rendered AppBar with updated layout
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Check type additions in basicUIPlugin.css.ts and ensure GH-compatible typings and defaults align.
  • Verify assignInlineVars includes every new key in basicUIPlugin.tsx and AppBar.tsx.
  • Review CSS calc usage (negative calc for hitSlop) and platform-specific overrides in AppBar.css.ts.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: exposing style customization interfaces for AppBar sizing-related properties.
Description check ✅ Passed The description is related to the changeset, listing customization options (containerPadding, itemGap, fontSize, hitSlop) that align with the exposed AppBar styling interfaces.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch expose-appbar-sizing-options

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5818f44 and a9b7d21.

📒 Files selected for processing (4)
  • extensions/plugin-basic-ui/src/basicUIPlugin.css.ts (3 hunks)
  • extensions/plugin-basic-ui/src/basicUIPlugin.tsx (1 hunks)
  • extensions/plugin-basic-ui/src/components/AppBar.css.ts (7 hunks)
  • extensions/plugin-basic-ui/src/components/AppBar.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • extensions/plugin-basic-ui/src/basicUIPlugin.css.ts
  • extensions/plugin-basic-ui/src/components/AppBar.css.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Write source in TypeScript with strict typing enabled across the codebase

Files:

  • extensions/plugin-basic-ui/src/basicUIPlugin.tsx
  • extensions/plugin-basic-ui/src/components/AppBar.tsx
extensions/plugin-*/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Plugins must implement only the documented lifecycle hooks (onInit, onBeforePush/onPushed, onBeforePop/onPopped, onBeforeReplace/onReplaced, onBeforeStepPush/onStepPushed, onBeforeStepPop/onStepPopped, onBeforeStepReplace/onStepReplaced, onChanged)

Files:

  • extensions/plugin-basic-ui/src/basicUIPlugin.tsx
  • extensions/plugin-basic-ui/src/components/AppBar.tsx
🧬 Code graph analysis (1)
extensions/plugin-basic-ui/src/components/AppBar.tsx (2)
extensions/plugin-basic-ui/src/basicUIPlugin.css.ts (1)
  • globalVars (48-51)
extensions/plugin-basic-ui/src/index.ts (1)
  • globalVars (3-3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Workers Builds: stackflow-docs
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (4)
extensions/plugin-basic-ui/src/basicUIPlugin.tsx (1)

88-93: LGTM! New CSS variable mappings follow the established pattern.

The implementation correctly maps the new AppBar sizing options to CSS variables using the same pattern as existing properties. The use of compactMap ensures undefined values are filtered out.

extensions/plugin-basic-ui/src/components/AppBar.tsx (3)

36-41: LGTM! Type definition properly extends AppBarProps.

The new sizing-related properties are correctly typed using Pick from GlobalVars["appBar"], ensuring type safety and consistency with the CSS contract.


102-107: LGTM! Properties correctly destructured.

All new properties are properly destructured from the component props and subsequently used in the inline style mapping.


338-343: LGTM! CSS variable mapping follows the established pattern.

The new properties are correctly mapped to their corresponding CSS variables using compactMap and assignInlineVars, consistent with the existing implementation for other AppBar properties.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 20, 2025

@stackflow/demo

yarn add https://pkg.pr.new/@stackflow/[email protected]

commit: a9b7d21

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 20, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
stackflow-docs a9b7d21 Commit Preview URL Nov 25 2025, 02:57 AM

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
extensions/plugin-basic-ui/src/components/AppBar.css.ts (2)

230-251: Constrain backButtonTouchAreaExpansion to a single length for safe calc() usage

The pattern of

padding: globalVars.appBar.backButtonTouchAreaExpansion,
margin: `calc(-1 * ${globalVars.appBar.backButtonTouchAreaExpansion})`,

works well for expanding the hit area while keeping visual bounds unchanged, as long as backButtonTouchAreaExpansion is a single length (e.g. 0.75rem, 16px). If a shorthand ("4px 8px") or a calc(...) expression is ever passed in, the resulting calc(-1 * ...) will be invalid CSS.

I’d suggest documenting (and possibly asserting in theme defaults) that backButtonTouchAreaExpansion must be a simple length value to avoid hard‑to‑debug styling issues.


291-309: centerMainEdge sizing from fontSize has same calc() assumption as above

Basing the edge button’s height and maxWidth on globalVars.appBar.fontSize is a nice way to keep the tappable region in proportion to the title text. As with backButtonTouchAreaExpansion, this assumes fontSize is a plain length (e.g. 1rem, 20px); if someone configures it as a calc(...) expression, maxWidth: calc(${globalVars.appBar.fontSize} * 5) would become an invalid nested calc.

Consider documenting that fontSize is expected to be a simple length, or adding a brief comment here pointing back to that constraint.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 73994f6 and c0a06ae.

📒 Files selected for processing (4)
  • extensions/plugin-basic-ui/src/basicUIPlugin.css.ts (3 hunks)
  • extensions/plugin-basic-ui/src/basicUIPlugin.tsx (1 hunks)
  • extensions/plugin-basic-ui/src/components/AppBar.css.ts (7 hunks)
  • extensions/plugin-basic-ui/src/components/AppBar.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • extensions/plugin-basic-ui/src/basicUIPlugin.tsx
  • extensions/plugin-basic-ui/src/basicUIPlugin.css.ts
  • extensions/plugin-basic-ui/src/components/AppBar.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Write source in TypeScript with strict typing enabled across the codebase

Files:

  • extensions/plugin-basic-ui/src/components/AppBar.css.ts
extensions/plugin-*/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Plugins must implement only the documented lifecycle hooks (onInit, onBeforePush/onPushed, onBeforePop/onPopped, onBeforeReplace/onReplaced, onBeforeStepPush/onStepPushed, onBeforeStepPop/onStepPopped, onBeforeStepReplace/onStepReplaced, onChanged)

Files:

  • extensions/plugin-basic-ui/src/components/AppBar.css.ts
🧬 Code graph analysis (1)
extensions/plugin-basic-ui/src/components/AppBar.css.ts (2)
extensions/plugin-basic-ui/src/basicUIPlugin.css.ts (2)
  • globalVars (47-50)
  • cupertino (105-107)
extensions/plugin-basic-ui/src/components/AppScreen.css.ts (1)
  • vars (7-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Workers Builds: stackflow-docs
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (4)
extensions/plugin-basic-ui/src/components/AppBar.css.ts (4)

193-208: Android container padding correctly driven by wrappingInlinePadding

Using globalVars.appBar.wrappingInlinePadding for both paddingLeft and paddingRight on the Android container keeps the outer inline spacing consistent with the new sizing API and looks good.


210-228: Left slot padding now fully theme-driven and coherent across platforms

Wiring Android’s trailing padding and Cupertino’s leading/trailing paddings to globalVars.appBar.wrappingInlinePadding makes the left slot respect the same configurable inline gutter as the container/right side. Layout-wise this should keep left/center/right alignment consistent as the value changes.


257-289: Center title typography and layout correctly hooked to theme vars

Making centerMain a flex container and sourcing fontSize/lineHeight from globalVars.appBar plus width from vars.appBar.center.mainWidth (for Cupertino) cleanly connects the title’s sizing/width to the new configuration surface. This should make typography and centering respond predictably to theme changes.


322-341: Right slot padding symmetric with left and container

Using globalVars.appBar.wrappingInlinePadding for Android’s leading padding and both sides on Cupertino keeps the right slot aligned with the left/container gutters and respects the new sizing option. This is consistent with the rest of the AppBar layout.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
extensions/plugin-basic-ui/src/components/AppBar.css.ts (1)

227-248: Hit area and typography vars are wired correctly; fontWeight could be made themeable later

  • backButton/closeButton using padding: globalVars.appBar.hitSlop with a matching negative margin (Lines 238-240) correctly enlarge the touch area without affecting layout flow.
  • centerMain consuming fontSize and lineHeight (Lines 257-259), plus centerText inheriting them, ensures title sizing is fully driven by the new vars.
  • centerMainEdge basing its height and maxWidth on fontSize (Lines 295-298) keeps the iOS-style tap target aligned with the visible label.

If you expect themes that want a non‑bold title, consider promoting fontWeight: "bold" (Line 259) to a globalVars.appBar token as a future enhancement, but it’s fine as‑is.

Also applies to: 254-286, 288-306

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c0a06ae and 5818f44.

📒 Files selected for processing (4)
  • extensions/plugin-basic-ui/src/basicUIPlugin.css.ts (3 hunks)
  • extensions/plugin-basic-ui/src/basicUIPlugin.tsx (1 hunks)
  • extensions/plugin-basic-ui/src/components/AppBar.css.ts (7 hunks)
  • extensions/plugin-basic-ui/src/components/AppBar.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • extensions/plugin-basic-ui/src/basicUIPlugin.css.ts
  • extensions/plugin-basic-ui/src/basicUIPlugin.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Write source in TypeScript with strict typing enabled across the codebase

Files:

  • extensions/plugin-basic-ui/src/components/AppBar.css.ts
  • extensions/plugin-basic-ui/src/components/AppBar.tsx
extensions/plugin-*/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Plugins must implement only the documented lifecycle hooks (onInit, onBeforePush/onPushed, onBeforePop/onPopped, onBeforeReplace/onReplaced, onBeforeStepPush/onStepPushed, onBeforeStepPop/onStepPopped, onBeforeStepReplace/onStepReplaced, onChanged)

Files:

  • extensions/plugin-basic-ui/src/components/AppBar.css.ts
  • extensions/plugin-basic-ui/src/components/AppBar.tsx
🧬 Code graph analysis (1)
extensions/plugin-basic-ui/src/components/AppBar.tsx (2)
extensions/plugin-basic-ui/src/basicUIPlugin.css.ts (1)
  • globalVars (48-51)
extensions/plugin-basic-ui/src/index.ts (1)
  • globalVars (3-3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Workers Builds: stackflow-docs
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
extensions/plugin-basic-ui/src/components/AppBar.tsx (1)

19-42: AppBar sizing props are consistently threaded from type to CSS variables

The newly added sizing props (minHeight, wrappingInlinePadding, fontSize, lineHeight, hitSlop, surroundingContentSpacing) are correctly:

  • included in AppBarProps via Pick<GlobalVars["appBar"], ...> (Line 36-41),
  • destructured from the component props (Line 102-107),
  • and mapped into the corresponding globalVars.appBar.* CSS vars via assignInlineVars with compactMap (Line 338-344),

which keeps the runtime behavior aligned with the theme contract in basicUIPlugin.css.ts. I don’t see any typing or wiring gaps here.

Also applies to: 102-107, 338-344

extensions/plugin-basic-ui/src/components/AppBar.css.ts (1)

193-208: Spacing tokens for padding vs gaps look coherent across themes

wrappingInlinePadding is now used for the outer container padding (container on Android, left/right Cupertino side paddings), while surroundingContentSpacing is used as the horizontal gap between edge content and the title (left/right padding on Lines 215 and 325). This gives a clear, symmetric separation between “outer padding” and “intra-content spacing” on both Android and Cupertino without any obvious layout regressions in the code.

Also applies to: 210-225, 319-335

@ENvironmentSet ENvironmentSet merged commit a136f96 into main Nov 25, 2025
7 of 9 checks passed
@ENvironmentSet ENvironmentSet deleted the expose-appbar-sizing-options branch November 25, 2025 02:54
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.

3 participants