Skip to content

refactor: code smells remediation across audio and ui packages#29

Merged
flexiondotorg merged 1 commit intomainfrom
cleanup
Mar 31, 2026
Merged

refactor: code smells remediation across audio and ui packages#29
flexiondotorg merged 1 commit intomainfrom
cleanup

Conversation

@flexiondotorg
Copy link
Copy Markdown
Contributor

  • Remove FrameAnalysis.BarMagnitudes and Profile.Frames; fields were populated but never read, wasting ~27MB heap for 30-min audio; progress callback bar display preserved via a reusable buffer
  • Extract decodeS16/decodeS32/decodeF32/sampleDecoder/unsafeByteSlice helpers from extractSamples, reducing it from ~189 to ~58 lines; add unit tests with edge cases for each decoder
  • Move fire colour palette from internal/cli to internal/theme as the single source of truth; remove re-aliased vars in ui/progress.go, eliminating ui's dependency on internal/cli
  • Note in AGENTS.md that convertRGBAToYUV/convertRGBAToNV12 duplication is intentional for hot-path performance

Checklist

  • I have performed a self-review of my code
  • I have tested my changes and confirmed there are no regressions

- Remove FrameAnalysis.BarMagnitudes and Profile.Frames; fields were
  populated but never read, wasting ~27MB heap for 30-min audio;
  progress callback bar display preserved via a reusable buffer
- Extract decodeS16/decodeS32/decodeF32/sampleDecoder/unsafeByteSlice
  helpers from extractSamples, reducing it from ~189 to ~58 lines; add
  unit tests with edge cases for each decoder
- Move fire colour palette from internal/cli to internal/theme as the
  single source of truth; remove re-aliased vars in ui/progress.go,
  eliminating ui's dependency on internal/cli
- Note in AGENTS.md that convertRGBAToYUV/convertRGBAToNV12 duplication
  is intentional for hot-path performance

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Refactors core audio decoding logic using unsafe pointers and modifies the primary data structure for audio analysis. These changes to high-performance paths require human validation.

@flexiondotorg flexiondotorg merged commit 9bba424 into main Mar 31, 2026
18 checks passed
@flexiondotorg flexiondotorg deleted the cleanup branch March 31, 2026 11:54
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