Skip to content

feat: Phase 1 Foundation - theme, navigation, entry point, installer - #1

Merged
juandagalo merged 30 commits into
mainfrom
feat/phase1-foundation
Mar 21, 2026
Merged

feat: Phase 1 Foundation - theme, navigation, entry point, installer#1
juandagalo merged 30 commits into
mainfrom
feat/phase1-foundation

Conversation

@juandagalo

@juandagalo juandagalo commented Mar 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Warm Ember theme: Replace Catppuccin/cyan with amber accent (#F59E0B), teal secondary (#2DD4BF), warm charcoal base (#1C1917). ~10% orange coverage.
  • Hub navigation: Replace flat 3-tab layout with hub-and-spoke menu. View stack with push/pop, numbered menu with system summary.
  • Smart entry point: Startup state machine detects nbfc status and routes to installer, config wizard, service start prompt, or hub.
  • Installer wizard: Distro-aware (Debian/Ubuntu/Arch) 7-step installer with config safety scoring, sensor verification, and service management.

Commits (separated by concern)

  1. feat(styles) — Warm Ember palette + style renames
  2. refactor(tui) — View stack + hub model
  3. feat(tui) — Smart entry point state machine
  4. feat(tui) — Installer wizard + nbfc/system enhancements

Test plan

  • Build passes: go build -o freshMango .
  • go vet ./... clean
  • Launch app without nbfc installed → shows installer
  • Launch with nbfc installed + configured → shows hub
  • Hub menu navigates to Dashboard and Curve Editor
  • Esc returns to hub from spoke views
  • Warm Ember palette renders correctly (no cyan remnants)
  • Installer detects distro family correctly

Replace Catppuccin/cyan theme with Warm Ember palette. Amber (#F59E0B)
as accent, teal (#2DD4BF) as secondary, warm charcoal (#1C1917) base.
Rename cyanStyle to accentStyle across all view files. Add new styles:
secondaryStyle, accentDimStyle, bgStyle.
Replace flat 3-tab cycling with hub-and-spoke navigation. Add viewID
enum, push/pop view stack, and hub model with system summary and
numbered menu. Dashboard and Curve Editor accessible as spoke views,
Esc returns to hub. Placeholder entries for upcoming views.
Add startup state machine that detects nbfc status on launch.
Routes to installer stub if not installed, config wizard if
unconfigured, service start prompt if stopped, or hub if ready.
Async detection runs without blocking the UI.
Replace setup.go with enhanced installer supporting Debian/Ubuntu/Arch.
Add distro family detection via /etc/os-release ID field. Add nbfc
wrappers for RecommendConfigs, ListSensors, ShowSensors, RateConfig,
InstallDebian, InstallArch. Installer has 7 steps: install, detect,
configure (with safety scores), sensors, start, enable, done. Wire
installer into smart entry point routing.
Add tea.ClearScreen on every view push/pop/transition to prevent
ghost artifacts from previous frames. Replace bgStyle full-screen
wrapper with padToTerminal() that explicitly paints every terminal
cell. Remove background color from breadcrumb bar.
Give each fan its own bordered box with clean layout, placed
side-by-side when terminal is wide enough. Replace mini curve
rendering with column-based approach matching the curve editor.
Sort thresholds by UpThreshold ascending after add or edit to
prevent new rows from overwriting the fan curve. Rename column
headers from Up/Down/Fan to Start/Stop/Speed for clarity.
Increase column widths from 8 to 10 chars and widen separator
line and box to prevent header text from running together.
Show all available fans as a tab-like bar above the table with the
active fan highlighted in amber. Support 1-9 number keys to jump
directly to a specific fan in addition to the f key for cycling.
Set consistent height on Temperature and Fan boxes so the top row
aligns. Stretch the Fan Curve box to fill the available terminal
width instead of a narrow fixed size.
Replace separate Temperature and Fans boxes with unified per-fan
cards showing temp, speed bar, mode, and target. Cards divide width
equally and scale to any number of fans. Fan curve chart stretches
to match the full content width with dynamic column scaling.
Scale curve editor chart width based on terminal size to match
dashboard rendering. Add 'b' key to restore config from backup
file. Wire save flow through SaveAndRestart for auto-recovery.
…/restore

Capture all exec.Command stdout/stderr to prevent nbfc logs from
corrupting the TUI. Remove omitempty from required config struct
fields to prevent nbfc parse errors. Add config backup before write,
auto-restore on failed restart, and manual RestoreBackup function.
Preserve unknown JSON fields during config round-trip.
Replace single fan curve with one chart per fan, side by side,
aligned with fan cards above. Add crosshair marker showing current
temperature (vertical teal line) and speed (horizontal teal line)
with green intersection point. Fix column count overflow that
caused line wrapping (account for box padding in width calc).
Change Settings menu item to show 'coming soon' placeholder instead
of opening the installer wizard. Filter ERROR/INFO lines from
nbfc config -r output so error messages aren't shown as selectable
config options.
Replace bright teal crosshair with muted faded teal (#4A7C75).
Use lighter characters: ┊ for vertical, ╌ for horizontal, ◆ for
intersection point. Reduces visual noise on the fan curve charts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Introduces the Phase 1 TUI foundation for freshMango by updating the theme, replacing the old tab-based navigation with a hub-and-spoke view stack, adding a smart startup routing flow, and implementing a distro-aware installer wizard for nbfc.

Changes:

  • Implement Warm Ember theme palette and style renames (cyan → amber accent, added secondary/border colors).
  • Replace tab navigation with a hub menu + push/pop view stack and breadcrumb/status UI.
  • Add a startup detection state machine that routes to installer/config/start prompts or the hub, plus a new installer wizard with distro detection, config scoring, and sensor verification.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
internal/tui/styles.go Replaces the old palette with Warm Ember colors and updates shared styles (accent/border/etc.).
internal/tui/setup.go Removes the previous Setup wizard model (replaced by the new installer + startup routing).
internal/tui/installer.go Adds a new multi-step, distro-aware installer/config wizard with scoring and sensor verification.
internal/tui/hub.go Adds a hub-and-spoke main menu model (numbered navigation + system summary).
internal/tui/dashboard.go Refactors dashboard layout into fan “cards” and per-fan curve charts with live marker.
internal/tui/curve.go Adds sorting of thresholds, backup restore, fan selection shortcuts, and responsive chart sizing.
internal/tui/app.go Implements view stack navigation, breadcrumb/status bars, and the startup detection state machine.
internal/system/system.go Enhances distro detection via os-release ID/ID_LIKE and provides DistroFamily().
internal/nbfc/nbfc.go Adds installer helpers, sensor discovery, config scoring, and a save/restart flow with backups.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/nbfc/nbfc.go Outdated
Comment thread internal/nbfc/nbfc.go
Comment thread internal/tui/curve.go Outdated
Comment thread internal/tui/installer.go
Comment thread internal/tui/app.go Outdated
Comment thread internal/tui/hub.go
Comment thread internal/tui/installer.go Outdated
Comment thread internal/nbfc/nbfc.go Outdated
Comment thread internal/tui/installer.go
…errors

Split runSilent into runSilent/runSudo so sudo commands can prompt
for passwords without corrupting the TUI. WriteConfigFile now only
updates TemperatureThresholds, preserving all other original fields.
SaveAndRestart returns accurate error messages for each failure mode.
Block Esc on first installer step to prevent bypassing setup. Guard
sensor check results to only apply when on sensor step. Block Enter
on sensor step while check is still running. Move AUR helper
detection from render to update to avoid per-frame filesystem scans.
Add defense-in-depth check in popViewMsg to prevent leaving
incomplete installer. Fix x-axis label builder to use []rune
instead of []byte to preserve multi-byte UTF-8 characters.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/tui/curve.go Outdated
Comment thread internal/tui/curve.go Outdated
Comment thread internal/tui/app.go Outdated
Comment thread internal/tui/installer.go
Comment thread internal/tui/installer.go Outdated
Comment thread internal/tui/installer.go
Comment thread internal/nbfc/nbfc.go
Comment thread internal/nbfc/nbfc.go
Comment thread internal/tui/dashboard.go Outdated
Comment thread internal/nbfc/nbfc.go Outdated
Install(), InstallDebian(), and InstallArch() already run via
runSudo() which elevates to root. Remove nested sudo calls inside
the bash scripts to avoid failures in restricted sudo configs.
…uting

Block Enter on unsupported distros with manual install instructions
and re-check option. Remove misleading 'Esc: back' from first step
help text. Force step back to install if nbfc not found when starting
at a later step.
Share nbfc.Status() result from app to dashboard instead of calling
twice per tick. Add 'Save failed:' prefix to curve editor error
messages. Use consistent °C units on all x-axis chart labels.
Remove 26 unnecessary comments that restate code, trivial section
markers, obvious function docstrings, and decorative dividers.
Preserve comments that explain non-obvious logic or design decisions.
Replace hardcoded x-axis label string with dynamically positioned
labels proportional to the actual column count. Labels now align
correctly regardless of chart width.

This comment was marked as outdated.

- Add Makefile with build, test, lint, vet, check, clean, install targets
- Add .golangci.yml with curated linter set (govet, errcheck, staticcheck, gocritic, misspell)
- Update .gitignore with coverage.out
- Add testify dependency to go.mod
- nbfc: 26 subtests covering parseStatus, RateConfig, WriteConfigFile
- system: 29 subtests covering parseOsRelease, DistroFamily, parseCPUInfo, FindMatchingConfigs
- tui: 18 tests covering startup state machine, view stack, key bindings
- Refactor system.go to extract testable helpers (parseOsRelease, parseCPUInfo)
- Add test hooks in nbfc.go for filesystem isolation (backupFn, writeFn)
- Create RenderCurveChart() with ChartOptions and ChartMarker structs
- Dashboard and curve editor now use shared renderer
- Eliminate ~185 lines of duplicated rendering code
- Fix pre-existing chart overflow bug at degenerate terminal widths
- 3 parallel CI jobs: lint (golangci-lint), test (with race detector + coverage), build
- Triggers on push to main and PRs to main
- PR template with type checkboxes, phase selection, and quality checklist
- README with features, installation, architecture, and 4-phase roadmap
- CONTRIBUTING with branch naming conventions, conventional commits, and PR workflow
- Semver strategy aligned to phases (v0.1.0 = Phase 1, v0.2.0 = Phase 2, etc.)
- MIT license
- Fix unused style vars with nolint annotations (reserved for Phase 2)
- Replace deprecated lipgloss .Copy() calls (staticcheck)
- Fix unchecked type assertions in tests (errcheck)
- Apply gocritic suggestions: switch rewrites, param combine, octal literals
- Fix gofmt alignment in const blocks
- Fix err shadow in nbfc.go (govet)
- Add nolint:misspell for HP Spectre product name
@juandagalo
juandagalo merged commit b482097 into main Mar 21, 2026
3 checks passed
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