Repository navigation
refactor(ui): text styles from QueryaTextStyles, shadcn TextExtension hidden - #1468
Merged
Merged
Conversation
…xtension hidden xSmall / small / base / large / medium / semiBold / bold / muted / foreground are a kit extension over DefaultTextStyle with the sizes the app already used. The widgets.dart barrel and every direct shadcn import hide shadcn's TextExtension, so call sites are unchanged. Refs #1465
An extension from a prefixed import still applies implicitly, so the 27 files importing shadcn as shadcn saw both extensions and every chained modifier was ambiguous. They now hide it too. QueryaTextStyles also gets ellipsis() (one line, cut), which one call site used.
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 2a of #1465 (text styles;
Gapis the next PR).shadcn's
TextExtension(Text('x').small().muted(), ~1000 call sites) is replaced byQueryaTextStylesinlib/shared/widgets/querya_text.dart:xSmall,small,base,large,medium,semiBold,bold,muted,foreground. They merge aTextStyleinto the ambientDefaultTextStyleexactly as shadcn'sWrappedTextdid, with the sizes the app already used (12 / 14 / 16 / 18); the UI scale still comes through theMediaQuerytext scaler. Colours are read from the theme colour scheme for now (step 3 moves them to our own types).Call sites do not change. To avoid an ambiguous extension,
widgets.dartand every unprefixedpackage:shadcn_flutter/shadcn_flutter.dartimport (91 files incl. tests) now sayhide TextExtension; files that used the extensions through a direct shadcn import got an import ofquerya_text.dart.Tests:
querya_text_test.dart(sizes, weights, chaining, colours).