Skip to content

feat: add titleSuffix and inlineActions to MagicStarterPageHeader#25

Merged
anilcancakir merged 3 commits intomainfrom
feat/page-header-title-suffix-inline-actions
Apr 7, 2026
Merged

feat: add titleSuffix and inlineActions to MagicStarterPageHeader#25
anilcancakir merged 3 commits intomainfrom
feat/page-header-title-suffix-inline-actions

Conversation

@anilcancakir
Copy link
Copy Markdown
Contributor

Summary

  • titleSuffix (Widget?) — renders inline after the title column inside the title+leading row (e.g. status badges)
  • inlineActions (bool, default false) — forces single-row layout on all screen sizes, no mobile stacking

Test plan

  • 6 new tests: titleSuffix renders, titleSuffix null, inlineActions true, inlineActions false (default), combined all params
  • 8 existing tests unmodified and passing
  • Full suite: 584 tests pass
  • flutter analyze: 0 issues
  • CHANGELOG + doc/basics/views-and-layouts.md updated

Closes #24

- titleSuffix (Widget?) renders inline after the title column inside
  the title+leading row — uses if-spread pattern, no SizedBox fallback
- inlineActions (bool, default false) forces single-row layout on all
  screen sizes by switching outer WDiv from flex-col sm:flex-row to
  flex-row items-center justify-between

Closes #24
Copilot AI review requested due to automatic review settings April 7, 2026 01:13
@sentry
Copy link
Copy Markdown

sentry bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds two new customization points to MagicStarterPageHeader to better support detail-view headers (e.g., inline status badges and always-inline actions on mobile), along with tests and documentation updates.

Changes:

  • Added titleSuffix: Widget? to render an inline widget after the title column.
  • Added inlineActions: bool to force a single-row header layout across all breakpoints.
  • Updated docs and CHANGELOG; extended widget tests for the new behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
lib/src/ui/widgets/magic_starter_page_header.dart Introduces titleSuffix and inlineActions and updates header layout classes accordingly.
test/ui/widgets/magic_starter_page_header_test.dart Adds new widget tests covering titleSuffix and inlineActions behavior.
doc/basics/views-and-layouts.md Documents the new parameters and provides a detail-view usage example.
CHANGELOG.md Notes the new MagicStarterPageHeader features under Unreleased.
Comments suppressed due to low confidence (1)

lib/src/ui/widgets/magic_starter_page_header.dart:48

  • When inlineActions is true, the outer container is flex-row on small screens, but the left (title/leading) row only becomes flexible at sm: (sm:flex-1). On mobile this can prevent the title column from receiving a width constraint (so truncate won’t behave) and can cause the actions to overflow off-screen. Consider making the left row flex-1 (not only sm:flex-1) when inlineActions is enabled so the title can shrink/truncate and the actions stay visible.
      className: inlineActions
          ? 'w-full flex flex-row items-center justify-between gap-4 p-2 lg:p-4 border-b border-gray-200 dark:border-gray-700'
          : 'w-full flex flex-col sm:flex-row items-start sm:items-center sm:justify-between gap-4 p-2 lg:p-4 border-b border-gray-200 dark:border-gray-700',
      children: [
        WDiv(
          className: 'flex flex-row items-center gap-3 sm:flex-1 min-w-0',
          children: [

Comment thread lib/src/ui/widgets/magic_starter_page_header.dart Outdated
Comment thread test/ui/widgets/magic_starter_page_header_test.dart
Comment thread doc/basics/views-and-layouts.md Outdated
…est, Wind UI doc example

- Wrap titleSuffix in WDiv(className: 'flex-shrink-0') to prevent badge
  compression in tight layouts
- Replace vacuous null test with WDiv count assertion (3 WDivs when no
  suffix, confirming no wrapper is rendered)
- Replace Material IconButton in doc example with WButton/WText per
  Wind UI convention
Inner title row uses flex-1 (no sm: prefix) when inlineActions is true
so the title claims available space at all screen sizes, not just sm+.
@anilcancakir anilcancakir merged commit ccc7cca into main Apr 7, 2026
1 check passed
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.

MagicStarterPageHeader: support inline title+actions on mobile & widget title

2 participants