zulip-flutter icon indicating copy to clipboard operation
zulip-flutter copied to clipboard

content: Consolidate message-content base style and apply it more accurately

Open chrisbobbe opened this issue 3 months ago • 2 comments

I have four main goals for this PR:

  • Stop applying the Zulip-message text color to things that aren't Zulip-message text (and refactor to make these errors easy to avoid)
  • Don't regress on performance in the message list (for example by making a DefaultTextStyle for every message)
  • Define and use a consolidated "base message text style" for content widgets to inherit from (which I do by lumping together the text color and the Paragraph styles)
  • Add a ThemeExtension to our app's ThemeData, as a home for certain content styles (that we don't want to recompute for each message, or that differ between light and dark theme and will need to be lerped for the fade animation)

Along the way, I make some small changes/fixes:

  • Message sender name was hsl(0deg 0% 15%); it now matches web at hsl(0deg 0% 20%)
  • #697 (which I filed just now)
  • <br> in a block context, a.k.a. LineBreakNode, has the proper/expected font size and line height, instead of values from a Material default. (Inconspicuous and not worth filing an issue for; I don't know how to make one of these except with help from the server bug that causes #641.)
  • Code blocks, and our basic math-block implementation, now have 1.4x line height instead of 1.43x. (This is to match web instead of a Material default, and is inconspicuous.)
Before After
40EA6082-4FC4-4C7E-ADCA-08C98AE28BC8 5393B6C6-8691-491D-9775-2711AF4C0C5E

Fixes: #697 Related: #95

chrisbobbe avatar May 22 '24 01:05 chrisbobbe