Skip to content

Refactor oversized mobile widgets#1401

Merged
wesbillman merged 7 commits into
mainfrom
pinky/mobile-widget-refactor
Jun 30, 2026
Merged

Refactor oversized mobile widgets#1401
wesbillman merged 7 commits into
mainfrom
pinky/mobile-widget-refactor

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

Summary

  • add a mobile Dart file-size guard wired into just mobile-check, mirroring desktop/web
  • split the three oversized mobile widget files into entry files plus sibling Dart part files
  • document the mobile small-widget convention, 1000-line guard, and Riverpod/hooks preference in AGENTS.md

Behavior

This is intended to be behavior-preserving. The widget splits keep the original public entry files and move private widgets/helpers into part files so private names and existing imports continue to work unchanged.

Brain and Pinky independently verified each split as content-identical after stripping only the required part / part of directives.

Validation

  • just mobile-check
  • just mobile-test
  • anti-pattern scan: no StatefulWidget / setState in this refactor's touched widget files; remaining StatefulWidget usage is pre-existing media/emoji viewer debt and should be handled separately

wesbillman and others added 7 commits June 30, 2026 11:17
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
…od preference

Sharpen the Mobile App (Flutter) conventions in AGENTS.md to match the
refactor that just landed: one public widget per file with private
sub-widgets in sibling `part` files, the 1000-line guard enforced via
`just mobile-check`, and an explicit "favor Riverpod for state" note.

Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Convert the two StatefulWidgets that map cleanly to hooks with no
behavior change:
- _MessageImagePreview -> HookWidget with useMemoized hero tag
- _VideoTransportBar -> HookWidget with useListenable(controller)

Leave MediaImageViewerPage and MediaVideoViewerPage as StatefulWidget
(imperative gesture/animation and async controller lifecycles); each now
carries a short comment noting why it's an allowed exception.

Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman wesbillman merged commit 71b2c41 into main Jun 30, 2026
45 of 47 checks passed
@wesbillman wesbillman deleted the pinky/mobile-widget-refactor branch June 30, 2026 19:27
wesbillman added a commit that referenced this pull request Jun 30, 2026
Resolve home_page.dart conflict: adopt main's context.colors /
context.theme / context.textTheme accessors (#1401) while keeping the
PR's reduced-motion and selected-index polish.

Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant