Skip to content

refactor(ui): split the 1,800-line layout by screen half and by widget - #64

Merged
ewanc26 merged 1 commit into
mainfrom
refactor/split-layout-2
Oct 7, 2026
Merged

ewanc26 merged 1 commit into
mainfrom
refactor/split-layout-2

Conversation

@ewanc26

@ewanc26 ewanc26 commented Oct 7, 2026

Copy link
Copy Markdown
Owner

What this changes

src/ui/layout.c was 1,831 lines. It is now 295: where every control is, the hit tests and the palette. The top screens moved to layout_top.c, the bottom (touch) screens to layout_bottom.c, post drawing to layout_post.c and the pieces every screen reuses (a title, a paragraph, a pill, a list row, an avatar) to layout_widgets.c. All the #defines moved to layout_internal.h. Bodies moved verbatim apart from an indigo_layout_ prefix on what crosses files, and the profile screen asks indigo_layout_button_rect for the follow button instead of reading a file-scope constant. Part of the atomic-files rule. Part of #53.

Verification

Host: make test (4019 checks, 0 failures under ASan and UBSan) and make warnings clean. I rendered all 148 snapshots before and after the change and they are byte-identical, so nothing drawn moved. The 3DS build (devkitARM) links with no warnings. Nothing ran on Azahar or a 3DS.

Docs

AGENTS.md names the new files.

Changelog: none — an internal reorganisation; every rendered screen is identical.

Checklist

  • CI is green (CI gate and flow / conventions)
  • No secrets, tokens or signing keys in the diff
  • Tests added or changed with the behaviour; none skipped, disabled or deleted

🤖 Generated with Claude Code

Replaces #63, which conflicted with #62 in mk/host.mk.

layout.c keeps the geometry, the hit tests and the palette; the top and bottom
screens, the post drawing and the shared widgets move to layout_top,
layout_bottom, layout_post and layout_widgets, sharing layout_internal.h. No
change to what is drawn: all 148 snapshots are byte-identical.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ewanc26
ewanc26 merged commit 87c6662 into main Oct 7, 2026
9 checks passed
@ewanc26
ewanc26 deleted the refactor/split-layout-2 branch October 7, 2026 08:44
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