Keep chat titles readable in narrow headers

Prioritize the conversation title on narrow chat bars, move compact controls and overflow actions into More, and omit the duplicate title in floating windows. Add focused widget coverage for title sizing, icon dimensions, menus, and floating chrome.
This commit is contained in:
2026-11-12 10:42:43 +00:00
parent 24618964ce
commit 7d9b6c1d1b
9 changed files with 431 additions and 85 deletions
+12 -3
View File
@@ -69,8 +69,14 @@ class SegmentedBar extends StatefulWidget implements PreferredSizeWidget {
this.foregroundColor,
this.bottomPadding = 8,
this.backdrop,
this.titleShare,
});
/// The share of the bar the title always keeps beside the actions, when it
/// must hold more than the default (a long conversation name in a narrow
/// bar). Null keeps the default shares.
final double? titleShare;
/// The title; empty shows no title pill unless there is a [subtitle].
final String title;
@@ -390,8 +396,11 @@ class _SegmentedBarState extends State<SegmentedBar> {
// width (a destination's name) up to [SegmentedBar.maxTitleShare];
// actions that do not fit beside it move into the More menu.
final width = constraints.maxWidth;
final titleShare = widget.titleShare;
final titleMinimum = titleWidget != null || !showTitle
? width * SegmentedBar.minTitleShare
: titleShare != null
? width * titleShare
: math.max(
width * SegmentedBar.minTitleShare,
math.min(
@@ -405,9 +414,9 @@ class _SegmentedBarState extends State<SegmentedBar> {
width * SegmentedBar.maxTitleShare,
),
);
final minimumTitleShare = widget.separateActionIslands
? .10
: SegmentedBar.minTitleShare;
final minimumTitleShare =
titleShare ??
(widget.separateActionIslands ? .10 : SegmentedBar.minTitleShare);
final besideTitle =
width - (leading == null ? 0 : segmentedPieceHeight() + 8) - 8;
// Actions that cannot move (a model picker) may take the room down