B3: Split engine_rendering.go (2218L) into engine_rendering.go (400L) + engine_render_advanced.go (1829L)#40
Merged
Conversation
Pure file reorganization; no function bodies changed. The old
engine_rendering.go was ~2218 lines mixing core UI rendering with
hundreds of analysis, infrastructure, and stub functions.
After split:
engine_rendering.go 2218L -> 400L (core UI rendering)
engine_render_advanced.go NEW -> 1829L (advanced analysis, optimization, integration)
Grouping rationale:
engine_rendering.go: Core rendering functions for commit lists, diff views,
stash/reflog, graph visualization, bookmarks, and comment mode. Uses
consolidated UI templates for consistent terminal output.
engine_render_advanced.go: Advanced operational functions including performance
optimization, filtering operations, collaboration metrics, analysis algorithms,
compliance features, data export, and realtime functionality.
All 914 tests pass (100% coverage maintained at 79.6%).
Refs: CLEANUP_PLAN.md task B3
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.
Summary
Task B3 from
CLEANUP_PLAN.md. Splitsengine_rendering.go(was 2218 lines, now 400) into two files. Pure file reorganization — no function bodies changed, no logic touched.What's split
engine_rendering.go(400 lines) — coherent core UI rendering: commit list helpers (badges, bookmark/comment markers), graph visualization (parseCommitGraph,detectBranches,renderAsciiGraph), file-centric views (timeline, blame, file filtering), stash/reflog parsing.engine_render_advanced.go(1829 lines, NEW, 144 functions) — everything else.Honest note on the "advanced" file
The new file is a kitchen sink. The Haiku tried to find natural sub-groupings within the 1829 lines and couldn't, because the original file had collected loosely-related functions across many concerns (performance, filtering, workflows, signing, collab, viz, analytics, diff analysis, ML/AI placeholders, git ops, repo mgmt, dev experience, integration, team, compliance, export, realtime/WS).
What this signals: a meaningful chunk of these 144 functions are likely never called from live code — they look like prior aspirational features dumped into engine_rendering.go without being wired up. A natural follow-up task (call it B5) would be: run
grep-based liveness checks over each function inengine_render_advanced.goand delete the orphans. Many of these functions probably don't have correspondingshow*flags or dispatch entries.For now the split still helps —
engine_rendering.gois finally navigable.Coverage
Unchanged: 79.6% (root) / 89.3% (core). Pure refactor.
Test plan
go build ./cmd/gritpassesgo vet ./...cleango test ./...passes (914 tests)🤖 Executed by Haiku subagent per the cleanup plan in #27.
https://claude.ai/code/session_01LtDEmp1JiMecLNhq8YqKP2
Generated by Claude Code