fix(#610): scale the card chip width off the viewport

Gemini recheck: a hardcoded 260px ceiling ellipsizes prematurely when a
large accessibility font is set, even on a wide screen, and looks oddly
constrained on desktop. Now 70% of viewport width, which keeps the
overflow bound on a narrow phone and gives room where there is room.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pull/744/head
Strycher 2 months ago
parent 15e4917e12
commit 2c7e21e484

@ -54,9 +54,14 @@ class ContactCardChip extends StatelessWidget {
// A WidgetSpan gives its child unbounded width, so Flexible needs a real
// ceiling to ellipsize against. Without this the chip grows to whatever
// name the sender chose.
// name the sender chose, which overflowed the message layout.
//
// Scaled off the viewport rather than a fixed pixel count, so a large
// accessibility font on a wide screen is not ellipsized while space
// remains, and a narrow phone still gets a sane bound. (Gemini recheck)
final maxChipWidth = MediaQuery.sizeOf(context).width * 0.7;
final chip = ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 260),
constraints: BoxConstraints(maxWidth: maxChipWidth),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
decoration: BoxDecoration(

Loading…
Cancel
Save

Powered by TurnKey Linux.