Skip to content

B3: Split engine_rendering.go (2218L) into engine_rendering.go (400L) + engine_render_advanced.go (1829L)#40

Merged
zpenka merged 1 commit into
mainfrom
wave5-B3-split-rendering-clean
Apr 30, 2026
Merged

B3: Split engine_rendering.go (2218L) into engine_rendering.go (400L) + engine_render_advanced.go (1829L)#40
zpenka merged 1 commit into
mainfrom
wave5-B3-split-rendering-clean

Conversation

@zpenka

@zpenka zpenka commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Summary

Task B3 from CLEANUP_PLAN.md. Splits engine_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 in engine_render_advanced.go and delete the orphans. Many of these functions probably don't have corresponding show* flags or dispatch entries.

For now the split still helps — engine_rendering.go is finally navigable.

Coverage

Unchanged: 79.6% (root) / 89.3% (core). Pure refactor.

Test plan

  • go build ./cmd/grit passes
  • go vet ./... clean
  • go test ./... passes (914 tests)
  • Coverage unchanged

🤖 Executed by Haiku subagent per the cleanup plan in #27.

https://claude.ai/code/session_01LtDEmp1JiMecLNhq8YqKP2


Generated by Claude Code

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
@zpenka zpenka merged commit b504216 into main Apr 30, 2026
1 check passed
@zpenka zpenka deleted the wave5-B3-split-rendering-clean branch April 30, 2026 12:59
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.

2 participants