Commit f021d84
committed
refactor(desktop): move Settings → Usage into a features/usage slice
Extract the Usage settings surface out of the frozen legacy renderer zone into a
feature slice `src/renderer/features/usage/` (ports + services-context + ui), so
net-new Usage work (the #2015/#4164 pricing tab) is no longer blocked by the
tooltip and the read-only pricing tab).
- `features/usage/` owns the surface: narrow `UsageServices` ports
(`loadUsageStats`, `updateUsageSettings` — `UsageSettings` in and out, never the
whole `AppSettings`); a persistent `UsageFeatureScope` holding the single tagged
`{ range, value }` snapshot + reload ticket + Host-generation invalidation +
load-failure toast; and a disposable `UsageSettingsView`.
- `settings/usage-settings-page.tsx` is a thin legacy shim (`UsageScopeMount` +
`UsageSettingsPage`). `settings-surface.tsx` mounts the scope ABOVE its
loading/error gate and passes a `host:epoch` `targetKey` as a prop; the scope
clears and fences in place on a target change (no React `key`). The Host-change
handler also calls the scope's imperative `fenceTarget()` synchronously, so an
in-flight old-Host load cannot land in the window before the re-render.
- Regenerate renderer-architecture.json and the astryx surface inventory.
Extraction-only; the Desktop adapter/composition wiring and the editable pricing
tab remain follow-ups. Refs #4425.
Generated-by: Claude Code1 parent ad18da4 commit f021d84
15 files changed
Lines changed: 1880 additions & 721 deletions
File tree
- apps/desktop
- src
- main/__tests__
- renderer
- features/usage
- controller
- ui
- settings
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | 184 | | |
186 | 185 | | |
187 | 186 | | |
| |||
3891 | 3890 | | |
3892 | 3891 | | |
3893 | 3892 | | |
3894 | | - | |
3895 | | - | |
3896 | | - | |
3897 | | - | |
3898 | | - | |
3899 | | - | |
3900 | | - | |
3901 | | - | |
3902 | | - | |
3903 | | - | |
3904 | | - | |
3905 | 3893 | | |
3906 | 3894 | | |
3907 | 3895 | | |
| |||
4085 | 4073 | | |
4086 | 4074 | | |
4087 | 4075 | | |
4088 | | - | |
| 4076 | + | |
4089 | 4077 | | |
4090 | 4078 | | |
4091 | | - | |
4092 | | - | |
| 4079 | + | |
| 4080 | + | |
4093 | 4081 | | |
4094 | 4082 | | |
4095 | 4083 | | |
| |||
4247 | 4235 | | |
4248 | 4236 | | |
4249 | 4237 | | |
4250 | | - | |
4251 | | - | |
4252 | | - | |
4253 | | - | |
4254 | 4238 | | |
4255 | 4239 | | |
4256 | 4240 | | |
4257 | 4241 | | |
4258 | 4242 | | |
4259 | 4243 | | |
4260 | | - | |
4261 | | - | |
| 4244 | + | |
4262 | 4245 | | |
4263 | | - | |
4264 | 4246 | | |
4265 | | - | |
4266 | | - | |
4267 | | - | |
4268 | 4247 | | |
4269 | | - | |
4270 | | - | |
4271 | 4248 | | |
4272 | | - | |
4273 | 4249 | | |
4274 | 4250 | | |
4275 | 4251 | | |
| |||
0 commit comments