Skip to content

refactor(ui): Split FloatingPanel.swift into 10 organized files - #2

Merged
r3dbars merged 1 commit into
mainfrom
refactor/split-floating-panel
Dec 30, 2025
Merged

r3dbars merged 1 commit into
mainfrom
refactor/split-floating-panel

Conversation

@r3dbars

@r3dbars r3dbars commented Dec 30, 2025

Copy link
Copy Markdown
Owner

Summary

  • Split the monolithic 2,413-line FloatingPanel.swift into 10 organized files
  • Created clean folder structure organized by concern (Components/, Helpers/)
  • Deleted ~250 lines of dead "retro" code that was no longer used
  • Net reduction: 194 lines removed while improving maintainability

New Structure

FloatingPanel/
├── FloatingPanelController.swift   (156 lines) - Window controller
├── FloatingPanelView.swift         (340 lines) - Main SwiftUI view
├── PillStateManager.swift          (130 lines) - State machine
├── Components/
│   ├── WaveformViews.swift         (175 lines) - Audio visualizers
│   ├── PillViews.swift             (340 lines) - Pill state views
│   ├── CelebrationViews.swift      (249 lines) - Success animations
│   ├── ErrorViews.swift            (274 lines) - Error handling UI
│   ├── AttentionPromptView.swift   (189 lines) - Notification prompts
│   └── ReviewTrayView.swift        (76 lines)  - Action item tray
└── Helpers/
    └── LawsComponents.swift        (150 lines) - UI primitives

Dead Code Removed

  • ScrewView - Unused retro screw decoration
  • RetroButton - Old button style
  • StatusTextView - Replaced by LawsStatusTextView
  • MarqueeTextView - Unused scrolling text
  • LEDVisualizer - Old LED-style visualizer
  • CGFloat clamping extension
  • Retro color definitions

Test plan

  • Build succeeds
  • App launches and floating panel displays correctly
  • Recording cycle works (idle → recording → processing → reviewing → idle)
  • Celebrations and error states display properly

🤖 Generated with Claude Code

Break up the monolithic 2,413-line FloatingPanel.swift into a clean
folder structure organized by concern:

FloatingPanel/
├── FloatingPanelController.swift   - Window controller
├── FloatingPanelView.swift         - Main SwiftUI view
├── PillStateManager.swift          - State machine
├── Components/
│   ├── WaveformViews.swift         - Audio visualizers
│   ├── PillViews.swift             - Pill state views (Idle, Recording, Processing, Reviewing)
│   ├── CelebrationViews.swift      - Success animations
│   ├── ErrorViews.swift            - Error handling UI
│   ├── AttentionPromptView.swift   - Notification prompts
│   └── ReviewTrayView.swift        - Action item tray
└── Helpers/
    └── LawsComponents.swift        - UI primitives (buttons, status text)

Also removes ~250 lines of dead "retro" code (ScrewView, RetroButton,
LEDVisualizer, MarqueeTextView, etc.) that was no longer used.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@r3dbars

r3dbars commented Dec 30, 2025

Copy link
Copy Markdown
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Review Summary:

  • ✅ CLAUDE.md compliance: No violations found
  • ✅ Bug scan: No bugs introduced by the refactoring
  • ✅ All 27 types extracted correctly to new files
  • ✅ Dead code removal verified (ScrewView, RetroButton, etc.)
  • ✅ All dependencies properly available across files
  • ✅ Build passes successfully

This is a clean refactoring that improves code organization without changing functionality.

🤖 Reviewed by Claude Code

@r3dbars
r3dbars merged commit 9653818 into main Dec 30, 2025
@r3dbars
r3dbars deleted the refactor/split-floating-panel branch December 30, 2025 11:38
r3dbars added a commit that referenced this pull request Mar 18, 2026
refactor(ui): Split FloatingPanel.swift into 10 organized files
r3dbars added a commit that referenced this pull request Jun 17, 2026
…m (it is NOT a fix)

Wired mean-centering into the matcher side (transform cached dump embeddings, replay
through the REAL clusterer + DB matcher; measurement only, no app code) and tested 4
centering modes x 6 codec arms + an online alpha-sweep + frozen-warmup. Adversarially
verified (3 independent probes recomputing from raw data; baseline==normonly control holds).

Result OVERTURNS the prior report's optimistic "lever 0: mean-center embeddings" claim:
- Global (oracle) centering does NOT reduce real downstream false positives. At profile-
  count-matched operating points, merge-contamination (fp_mass) is within +-0.02 of
  baseline (opus12k actually +0.011, worse); every fp drop is matched by an equal split-
  error (fn) rise. Baseline and global ride the SAME fp-vs-profiles frontier — global just
  slides rightward to more profiles. Clean 1:1 identity recovery never approaches 32.
- The only genuine effect is un-collapsing mega-profiles on heavy codecs (opus8k 5->20
  profiles) — a fragmentation/band-separation move, not precision; people-trapped stays
  ~30/32 through it.
- WHY: ~28/30 trapped speakers and 75-88% of fused pairs are WITHIN-MEETING diarizer
  co-clusters (verified byte-for-byte: centering never alters the diarizer's clusters).
  Only ~2 speakers/arm are matcher-side. A matcher-free floor of ~28-32 trapped exists on
  every arm before matching. The diarizer is the dominant ceiling.
- Deployability: no online/causal estimator approaches the oracle. Best running EMA
  alpha=0.005 recovers ~71%/4% of the oracle band-sep gain (opus12k/opus8k) and over-
  fragments; frozen-warmup matches oracle direction (cos ~0.8) but under-merges. Needs
  out-of-band per-codec calibration, not live-stream estimation.

Report updated: AMI_CODEC_REID_REPORT.md gains §3a + a revised lever ranking (diarizer #1,
codec-augmented embeddings #2; offline mean-centering demoted to a narrow anti-collapse
remedy; online centering not deployable). Tooling: center_dumps.py (normonly/global/
per_meeting/running/frozen), run_centering_experiment.sh, compare_centering.py,
center_purity_analysis.py, q3_{attribution,trapped,floor}.py, dev/run_online_centering_sweep.sh.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
r3dbars added a commit that referenced this pull request Jun 19, 2026
…al verdict + shippable gate)

5-agent parallel analysis of the quality matrix. Refinements:
- Parameter ranking for cross-quality robustness: autoBar #1, marginMin #2 (VoxCeleb only;
  inert on AMI), suggestFloor is the prompts knob. margins 0.00/0.03/0.05 are no-ops (gate
  engages at 0.08); 0.12 cuts worst-channel false-auto ~10x on VoxCeleb at ~2% prompt cost.
- Adversarial verdict: degradation->confusion is ROBUST via suggest-precision (Spearman
  -0.78/-0.71, tight CIs) and strongest in the >=30-auto tier (not small-N). Honest caveats:
  "any degradation" is false (noise/opus_8k/mp3-collapse driven); VoxCeleb autoBar>=0.92
  "0% false-auto" is a denominator-collapse artifact.
- Shippable gate: autoBar 0.83 + margin 0.12 + fixed cc>5 (VoxCeleb); AMI in-room should stay
  SUGGEST-ONLY (no policy clears fa<=0.5% with >=50 degraded autos — all "safe" gates are
  denominator-vacuous). AMI-full N=189 run will certify this.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@claude claude Bot mentioned this pull request Sep 23, 2026
11 of 13 tasks
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