1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 22:30:08 +00:00
Commit Graph

14 Commits

Author SHA1 Message Date
tw93
8e4b8a5e0d Improve update checks and cleanup UX, add timeout regressions 2026-03-05 12:00:07 +08:00
Noah Qin
fbaf5e7c91 fix(status): enable network data in JSON mode (#532)
Network rate calculation requires two samples to compute the delta.
In JSON mode, the collector was only called once, causing the network
field to always return nil.

This change adds a second collection call with a 1-second interval,
allowing the network rates to be calculated properly.
2026-03-04 02:59:01 +08:00
Noah Qin
2a4eaf007b feat(status): add --json flag for programmatic access (#529)
Add --json command-line flag to mo status that outputs system metrics
in JSON format without requiring a TTY environment.

This enables:
- Integration with GUI applications (e.g., native macOS apps)
- Use in automation scripts and monitoring systems
- Piping output to tools like jq for data extraction
- Recording metrics for analysis

Implementation:
- Add JSON struct tags to all metric types
- Add --json flag using Go's flag package
- Implement runJSONMode() for one-time metric collection
- Refactor main() to support both TUI and JSON modes
- Maintain 100% backward compatibility (default TUI unchanged)

Testing:
- All 454 existing tests pass
- JSON output validated with jq and python json.tool
- Pipeline and redirection work correctly
- No breaking changes to existing functionality
2026-03-03 16:05:55 +08:00
tw93
9056ce5b38 fix(status): adapt single-column width calculation 2026-02-27 09:53:18 +08:00
tw93
8e8059b0aa fix(status): resolve layout issue when stretching terminal window (#467)
When the terminal is stretched wide, the header info line may wrap to
multiple lines but the mole position was calculated independently based
on terminal width, causing vertical misalignment.

Separate header and mole rendering so mole always appears on dedicated
lines below the header regardless of terminal width.
2026-02-16 19:07:42 +08:00
Oleksandr Redko
599b39a3fb refactor: use builtin max instead of maxInt (#430) 2026-02-10 14:27:00 +08:00
Tw93
180037c22b feat(status): persist cat visibility preference
- Add loadCatHidden/saveCatHidden functions
- Save preference to ~/.config/mole/status_prefs
- Load preference on startup
2026-01-08 15:58:50 +08:00
Tw93
64a580b3a7 feat: cat hide toggle and critical fixes (#272)
- Add 'k' key to hide/show cat in mo status
- Hand-crafted mirror frames for better left-walking animation
- Fix extra blank lines bug (strings.Lines → strings.Split)
- Fix battery power overflow (ParseInt for negative values)
- Optimize README Tips section (8 → 5 items)
2026-01-08 11:27:47 +08:00
Tw93
c2c589ac81 Merge pull request #264 from alexandear-org/refactor/do-not-use-deprecated-funcs
refactor: replace deprecated `Start` with `Run`
2026-01-06 21:05:10 +08:00
Oleksandr Redko
158af1e1ba refactor: modernize Go code 2026-01-06 12:04:27 +02:00
Oleksandr Redko
80757ec074 refactor: replace deprecated Start with Run 2026-01-06 11:46:59 +02:00
Tw93
9aa569cbb6 feat: Enhance clean, optimize, analyze, and status commands, and update security audit documentation. 2025-12-31 16:23:31 +08:00
Tw93
f858d43b88 There is no blank line at the end of status 2025-12-12 10:49:57 +08:00
Tw93
45d31e880c Add System Status Dashboard 2025-11-21 17:58:31 +08:00