Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.

### 🐛 Bug Fixes
- **Mobile Header Brand**: `MagicStarterAppLayout` mobile topbar now honors `navigationTheme.brandBuilder`, so custom brand widgets render consistently across breakpoints when provided ([#65](https://github.com/fluttersdk/magic_starter/issues/65))
- **Page Header Title Truncation**: `MagicStarterPageHeaderTheme` defaults now use `line-clamp-2` instead of `truncate` for `titleClassName` and `subtitleClassName`, so long titles wrap to a second line on narrow viewports (e.g. iPhone-width screens) instead of clipping to "AI sett..." ([#67](https://github.com/fluttersdk/magic_starter/issues/67))

## [0.0.1-alpha.14] - 2026-04-16

Expand Down
10 changes: 6 additions & 4 deletions lib/src/configuration/magic_starter_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,14 @@ class MagicStarterPageHeaderTheme {

/// Title text className.
///
/// Defaults to `'text-2xl font-bold text-gray-900 dark:text-white truncate'`.
/// Defaults to `'text-2xl font-bold text-gray-900 dark:text-white line-clamp-2'`.
/// Uses `line-clamp-2` instead of `truncate` so long titles wrap to a second
/// line on narrow viewports (e.g. iPhone-width screens) instead of clipping.
final String titleClassName;

/// Subtitle text className.
///
/// Defaults to `'text-sm text-gray-600 dark:text-gray-400 truncate'`.
/// Defaults to `'text-sm text-gray-600 dark:text-gray-400 line-clamp-2'`.
final String subtitleClassName;

/// Action buttons container className.
Expand All @@ -418,9 +420,9 @@ class MagicStarterPageHeaderTheme {
this.containerInlineClassName =
'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',
this.titleClassName =
'text-2xl font-bold text-gray-900 dark:text-white truncate',
'text-2xl font-bold text-gray-900 dark:text-white line-clamp-2',
this.subtitleClassName =
'text-sm text-gray-600 dark:text-gray-400 truncate',
'text-sm text-gray-600 dark:text-gray-400 line-clamp-2',
this.actionContainerClassName = 'flex flex-row items-center gap-2',
});
}
Expand Down
14 changes: 14 additions & 0 deletions test/configuration/magic_starter_theme_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,20 @@ void main() {
expect(theme.subtitleClassName, contains('text-sm'));
});

test('titleClassName uses line-clamp-2 instead of truncate', () {
const theme = MagicStarterPageHeaderTheme();

expect(theme.titleClassName, contains('line-clamp-2'));
expect(theme.titleClassName, isNot(contains('truncate')));
});

test('subtitleClassName uses line-clamp-2 instead of truncate', () {
const theme = MagicStarterPageHeaderTheme();

expect(theme.subtitleClassName, contains('line-clamp-2'));
expect(theme.subtitleClassName, isNot(contains('truncate')));
});

test('containerClassName contains border-b', () {
const theme = MagicStarterPageHeaderTheme();

Expand Down
2 changes: 1 addition & 1 deletion test/magic_starter_manager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void main() {
);
expect(
manager.pageHeaderTheme.titleClassName,
'text-2xl font-bold text-gray-900 dark:text-white truncate',
'text-2xl font-bold text-gray-900 dark:text-white line-clamp-2',
);
expect(manager.layoutTheme.sidebarWidth, 256);
});
Expand Down