Skip to content

Commit 8df2e90

Browse files
committed
UI finish pass + visual polish: layout, states, accessibility, design tokens
1 parent 6afd99c commit 8df2e90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5071
-2299
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.x86_64-pc-windows-msvc]
2+
linker = "rust-lld.exe"

README.md

Lines changed: 128 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# System Health Tool
88

9-
Scan, diagnose, and clean up Windows system issues<br>from a single native desktop app.
9+
Reclaim disk space, inspect memory pressure, trim startup load, and act on system recommendations from one native desktop app.
1010

1111
<br>
1212

@@ -22,198 +22,208 @@ Scan, diagnose, and clean up Windows system issues<br>from a single native deskt
2222

2323
<br>
2424

25-
`~2.5 MB installer` &middot; `No bloat` &middot; `No telemetry` &middot; `Open source`
25+
`No telemetry` &middot; `Native desktop shell` &middot; `Safe-by-default cleanup` &middot; `Open source`
2626

2727
<br>
2828

29-
[Download](https://github.com/TMHSDigital/system-cleaner/releases) &nbsp;&nbsp;|&nbsp;&nbsp; [Architecture](#system-architecture) &nbsp;&nbsp;|&nbsp;&nbsp; [Build from source](#build-from-source) &nbsp;&nbsp;|&nbsp;&nbsp; [Contributing](docs/CONTRIBUTING.md)
29+
[Download](https://github.com/TMHSDigital/system-cleaner/releases) &nbsp;&nbsp;|&nbsp;&nbsp; [Architecture](docs/ARCHITECTURE.md) &nbsp;&nbsp;|&nbsp;&nbsp; [Build from source](#build-from-source) &nbsp;&nbsp;|&nbsp;&nbsp; [Contributing](docs/CONTRIBUTING.md)
3030

3131
</div>
3232

33-
<br>
34-
3533
---
3634

37-
<br>
38-
39-
### What it does
35+
## What it does
4036

4137
| Module | Capabilities |
4238
|:-------|:-------------|
43-
| **Dashboard** | Compute a real-time health score (0-100). Visualize drive capacity, RAM usage, and surface a one-click **Quick Clean** that only touches safe items. |
44-
| **Disk Cleanup** | Scan temp files, browser caches, crash dumps, dev caches, and the recycle bin. Tag every item with a color-coded risk level before deletion. |
45-
| **Memory** | Monitor live RAM pressure. Detect runaway processes, Hyper-V VMs, and WSL instances. Kill non-system processes directly from the panel. |
46-
| **Startup** | Toggle startup entries on/off via registry and shell folders. Display impact ratings (High / Medium / Low) and recommended-to-disable flags. |
47-
| **Recommendations** | Generate contextual tips (e.g. *"Pagefile is on a full drive"*) and expose a **Fix It** action that navigates to the responsible panel. |
39+
| **Overview** | Desktop-style summary shell with health score, reclaimable space, memory pressure, startup load, and capacity tracking. |
40+
| **Disk Cleanup** | Review workflow for temp files, browser caches, crash dumps, Windows Update leftovers, and developer caches. Filtering never mutates selection. |
41+
| **Memory** | Inspector for RAM pressure, top memory consumers, grouped process table, VM inventory, and problem-process heuristics. |
42+
| **Startup** | Grouped startup manager with impact tiers, recommendation badges, and reversible enable/disable switches. |
43+
| **Recommendations** | Priority-sorted action queue with direct navigation into the relevant screen. |
4844

49-
<br>
45+
## UI architecture
5046

51-
### Safety model
47+
The current frontend is built around a labeled nav rail, per-screen command bars, shared UI primitives, and screen hooks:
48+
49+
- `App.tsx` is a thin composition layer that switches tabs and renders the shell.
50+
- `src/components/ErrorBoundary.tsx` catches render crashes and shows a styled recovery screen.
51+
- `src/components/layout/` contains shell-level pieces such as the nav rail.
52+
- `src/components/ui/` contains reusable cards, rows, badges, buttons, progress bars, tooltips, and loading/empty states.
53+
- `src/hooks/` owns screen data and side effects so the screen components stay mostly presentational.
54+
55+
Every screen explicitly handles loading, empty, error, and healthy states. Hooks expose an `error` field so screens can render retry surfaces instead of silently dropping failures.
56+
57+
## Safety model
5258

5359
> [!IMPORTANT]
54-
> No files are deleted without explicit user confirmation. Every cleanable item is displayed with its full path and risk classification before any action is taken.
60+
> Cleanup always stays review-first. Every target is listed with a path, category, size, and risk level before deletion.
5561
5662
| Risk | Policy |
5763
|:-----|:-------|
58-
| **Safe** | Temp files, caches, crash dumps. Regenerated automatically. Quick Clean only touches this tier. |
59-
| **Moderate** | Dev caches (npm, pip, cargo), Windows Update files. Re-downloaded on demand. Requires manual selection. |
60-
| **Advanced** | Reserved for future surface area. Will require explicit opt-in confirmation. |
61-
62-
> [!CAUTION]
63-
> Locked files are silently skipped. System-critical processes are protected and cannot be killed from the Memory panel.
64+
| **Safe** | Temp files, caches, crash dumps, and similar data that can be regenerated automatically. Quick Clean only uses this tier. |
65+
| **Moderate** | Developer caches and Windows Update leftovers that can be re-downloaded or rebuilt later. These require explicit selection. |
66+
| **Advanced** | Reserved for future cleanup targets. The filter exists in the UI today, but the current backend does not emit Advanced items. |
6467

65-
Full policy documented in [`docs/SAFETY.md`](docs/SAFETY.md).
68+
Additional guarantees:
6669

67-
<br>
70+
- Safe items are preselected in Disk Cleanup.
71+
- Switching filters does not change the current selection.
72+
- Quick Clean on the Overview screen only submits Safe items.
73+
- System processes stay protected in the Memory screen.
74+
- Startup changes are reversible because they only change launch-on-sign-in behavior.
6875

69-
---
76+
Full policy: [`docs/SAFETY.md`](docs/SAFETY.md)
7077

71-
<br>
78+
## Install
7279

73-
### Install
80+
Grab the latest build from [Releases](https://github.com/TMHSDigital/system-cleaner/releases).
7481

75-
Grab the latest build from [**Releases**](https://github.com/TMHSDigital/system-cleaner/releases):
76-
77-
| Artifact | Size |
78-
|:---------|:-----|
79-
| `System Cleaner_x.x.x_x64-setup.exe` (NSIS) | ~2.5 MB |
80-
| `System Cleaner_x.x.x_x64_en-US.msi` | ~3.8 MB |
82+
| Artifact | Notes |
83+
|:---------|:------|
84+
| `System Cleaner_x.x.x_x64-setup.exe` | NSIS installer |
85+
| `System Cleaner_x.x.x_x64_en-US.msi` | MSI package |
8186

8287
> [!NOTE]
83-
> Admin elevation is requested on launch. Required for accessing system temp directories, enumerating all processes, and managing startup registry keys.
88+
> Admin elevation is requested on launch because the app reads protected temp locations, enumerates system processes, and manages startup entries.
8489
85-
<br>
86-
87-
### Build from source
90+
## Build from source
8891

8992
`Node.js >= 18` &middot; `Rust >= 1.85` &middot; `Windows 10/11` &middot; `WebView2 Runtime`
9093

9194
```bash
9295
git clone https://github.com/TMHSDigital/system-cleaner.git
93-
cd system-cleaner && npm install
96+
cd system-cleaner
97+
npm install
9498

95-
npm run tauri:dev # dev mode with hot reload
96-
npm run tauri:build # production build → src-tauri/target/release/bundle/
99+
npm run dev # browser preview with mock API data
100+
npm run tauri:dev # real desktop app with Rust backend + hot reload
101+
npm run tauri:build # production bundle
97102
```
98103

99-
<br>
104+
## Development modes
100105

101-
---
106+
| Command | Mode | Notes |
107+
|:--------|:-----|:------|
108+
| `npm run dev` | Browser preview | Uses `src/lib/mockApi.ts` when Tauri runtime is unavailable. Useful for UI iteration and browser automation. |
109+
| `npm run tauri:dev` | Real desktop app | Uses the real Rust backend via Tauri `invoke()` calls. Use this before shipping cleanup, memory, or startup changes. |
110+
| `npm run tauri:build` | Production build | Outputs installers and release binaries under `src-tauri/target/release/bundle/`. |
102111

103-
<br>
104-
105-
### System architecture
112+
## System architecture
106113

107114
```mermaid
108115
flowchart TD
109116
subgraph Frontend ["React 19 + TypeScript + Tailwind v4"]
110-
UI["Dashboard / Disk / Memory / Startup / Tips"]
111-
API["api.ts — typed invoke() wrappers"]
112-
UI --> API
117+
App["App shell + Nav rail"]
118+
UI["Shared UI primitives"]
119+
Hooks["Screen hooks"]
120+
Api["api.ts"]
121+
Mock["mockApi.ts (dev browser only)"]
122+
123+
App --> UI
124+
App --> Hooks
125+
Hooks --> Api
126+
Api --> Mock
113127
end
114128
115-
subgraph Backend ["Rust Backend — Tauri 2"]
116-
DISK["disk.rs — drive info, temp/cache scanning"]
117-
MEM["memory.rs — RAM stats, process list, VM detection"]
118-
START["startup.rs — registry + shell folder management"]
119-
CLEAN["cleanup.rs — safe deletion with progress tracking"]
120-
REC["recommendations.rs — contextual system tips"]
129+
subgraph Backend ["Rust backend — Tauri 2"]
130+
Disk["disk.rs"]
131+
Memory["memory.rs"]
132+
Startup["startup.rs"]
133+
Cleanup["cleanup.rs"]
134+
Recommendations["recommendations.rs"]
121135
end
122136
123-
API -- "IPC (JSON)" --> DISK
124-
API -- "IPC (JSON)" --> MEM
125-
API -- "IPC (JSON)" --> START
126-
API -- "IPC (JSON)" --> CLEAN
127-
API -- "IPC (JSON)" --> REC
128-
129-
subgraph OS ["Windows OS Layer"]
130-
WIN32["Win32 API"]
131-
PS["PowerShell"]
132-
REG["Registry"]
133-
end
134-
135-
DISK --> WIN32
136-
MEM --> WIN32
137-
START --> REG
138-
CLEAN --> PS
139-
REC --> WIN32
140-
REC --> REG
137+
Api -- "invoke() in Tauri runtime" --> Disk
138+
Api -- "invoke() in Tauri runtime" --> Memory
139+
Api -- "invoke() in Tauri runtime" --> Startup
140+
Api -- "invoke() in Tauri runtime" --> Cleanup
141+
Api -- "invoke() in Tauri runtime" --> Recommendations
141142
```
142143

143144
Full architecture docs: [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md)
144145

145-
<br>
146-
147-
### Tech stack
146+
## Tech stack
148147

149148
| | |
150149
|:--|:--|
151-
| **Frontend** | React 19 &middot; TypeScript 5.9 &middot; Tailwind CSS v4 &middot; Recharts |
150+
| **Frontend** | React 19 &middot; TypeScript 5.9 &middot; Tailwind CSS v4 |
151+
| **UI** | Framer Motion &middot; Radix UI primitives &middot; Lucide React &middot; clsx &middot; tailwind-merge |
152152
| **Backend** | Tauri 2 &middot; Rust &middot; sysinfo &middot; winreg &middot; windows-rs |
153153
| **Build** | Vite 7 &middot; Cargo &middot; tauri-cli |
154-
| **UI** | Lucide React &middot; Custom design tokens |
155-
156-
<br>
157154

158155
<details>
159156
<summary><strong>Project structure</strong></summary>
160157

161158
<br>
162159

163-
```
160+
```text
164161
src/
165-
├── App.tsx # Sidebar nav + tab routing
166-
├── index.css # Global styles + scrollbar
167-
├── main.tsx # React DOM entry point
162+
├── App.tsx
163+
├── index.css
164+
├── main.tsx
165+
├── vite-env.d.ts
168166
├── components/
169-
│ ├── Dashboard.tsx # Health score, drives, RAM, Quick Clean
170-
│ ├── DiskCleanup.tsx # Scan → Review → Clean workflow
171-
│ ├── MemoryPanel.tsx # RAM chart, processes, VM detection
172-
│ ├── StartupManager.tsx # Toggle switches + impact ratings
173-
│ └── Recommendations.tsx # Auto-tips with Fix It navigation
167+
│ ├── Dashboard.tsx
168+
│ ├── DiskCleanup.tsx
169+
│ ├── ErrorBoundary.tsx
170+
│ ├── MemoryPanel.tsx
171+
│ ├── Recommendations.tsx
172+
│ ├── StartupManager.tsx
173+
│ ├── layout/
174+
│ │ └── NavRail.tsx
175+
│ └── ui/
176+
│ ├── AppCheckbox.tsx
177+
│ ├── AppSwitch.tsx
178+
│ ├── Button.tsx
179+
│ ├── DataRow.tsx
180+
│ ├── EmptyState.tsx
181+
│ ├── LoadingState.tsx
182+
│ ├── MetricCard.tsx
183+
│ ├── PageHeader.tsx
184+
│ ├── ProgressBar.tsx
185+
│ ├── SectionCard.tsx
186+
│ ├── StatusBadge.tsx
187+
│ ├── StickyActionBar.tsx
188+
│ └── Tooltip.tsx
189+
├── hooks/
190+
│ ├── useDashboardData.ts
191+
│ ├── useDiskCleanup.ts
192+
│ ├── useMemoryData.ts
193+
│ ├── useRecommendations.ts
194+
│ └── useStartupData.ts
174195
├── lib/
175-
│ ├── api.ts # Typed Tauri invoke() wrappers
176-
│ ├── types.ts # Shared TypeScript interfaces
177-
│ └── format.ts # Byte/percent formatting utils
196+
│ ├── api.ts
197+
│ ├── cn.ts
198+
│ ├── format.ts
199+
│ ├── mockApi.ts
200+
│ └── types.ts
178201
└── styles/
179-
└── tokens.css # Design tokens, component classes, animations
202+
└── tokens.css
180203
181204
src-tauri/
182205
├── src/
183-
│ ├── lib.rs # Tauri bootstrap + command registration
184-
│ ├── main.rs # Windows entry point (#![windows_subsystem])
206+
│ ├── lib.rs
207+
│ ├── main.rs
185208
│ └── commands/
186-
│ ├── disk.rs # get_drive_info, scan_disk
187-
│ ├── memory.rs # get_memory_info, get_processes, kill_process, get_vm_info
188-
│ ├── startup.rs # get_startup_items, toggle_startup_item
189-
│ ├── cleanup.rs # clean_items
190-
│ └── recommendations.rs # get_recommendations
191-
├── tauri.conf.json # Window config, bundle targets, CSP
192-
├── Cargo.toml # Rust dependencies + crate config
193-
└── icons/ # Generated app icons (ico, icns, png)
194-
195-
docs/
196-
├── ARCHITECTURE.md # Internal design + data flow
197-
├── SAFETY.md # Risk model + deletion policy
198-
└── CONTRIBUTING.md # Setup, code style, PR guidelines
209+
│ ├── cleanup.rs
210+
│ ├── disk.rs
211+
│ ├── memory.rs
212+
│ ├── recommendations.rs
213+
│ └── startup.rs
214+
├── tauri.conf.json
215+
├── Cargo.toml
216+
└── icons/
199217
```
200218

201219
</details>
202220

203-
<br>
204-
205-
---
206-
207-
<br>
208-
209-
### Contributing
221+
## Contributing
210222

211-
PRs welcome. See [`docs/CONTRIBUTING.md`](docs/CONTRIBUTING.md) for environment setup, code style, and how to add new cleanup targets or recommendation rules.
212-
213-
<br>
223+
PRs are welcome. Start with [`docs/CONTRIBUTING.md`](docs/CONTRIBUTING.md) for setup, workflow, and validation guidance.
214224

215225
<div align="center">
216226

217-
[MIT License](LICENSE) &middot; [TMHSDigital](https://github.com/TMHSDigital) &middot; [Security Policy](docs/SAFETY.md)
227+
[MIT License](LICENSE) &middot; [TMHSDigital](https://github.com/TMHSDigital) &middot; [Safety Policy](docs/SAFETY.md)
218228

219229
</div>

0 commit comments

Comments
 (0)