feat(desktop): add isolated Pricing settings editor - #2218
Conversation
|
Thanks for this — I reviewed it from four angles (design/boundaries, implementation, UI, tests) and the core is genuinely solid: authority stays with the Host (the renderer snapshot is a pure mirror, Merge blocker — the branch conflicts with P2 — P2 — the destructive/recovery branches have zero automated coverage. P2 — the P2 (cheap) — P3 (optional): the host/renderer copies of None of this blocks the design — happy to approve once the rebase lands (and the cheap P2s are handled or explicitly deferred). |
16f312e to
ab42d1d
Compare
|
Rebased onto current main and addressed the review notes. Could you take another look when you have a chance? |
ab42d1d to
3483e93
Compare
|
Current head |
3483e93 to
7b5c82e
Compare
|
Rebased onto current main. While resolving the Usage overlap I also aligned Pricing with Visual System 2.0: predictable loading now reserves the table geometry, the extra empty-state Card is gone, and the panel uses the shared icon scale. I also made the confirmation stories wait for their portal content instead of racing it. The Pricing stories now pass at wide and floor widths. The only local smoke failure is the icon catalog already tracked by #2541/#2544. Ready for another look. |
|
The Storybook failure is outside Pricing: every Pricing manifest and catalog state passed. The icon error is #2541/#2544. The two Daily Review bounds failures are also outside this diff; a fresh production Storybook build from current main passed both floor runs locally. I don’t see a Pricing patch to make for this CI result. |
|
Thank you again for patiently working through all of the earlier feedback. Rechecking this after #2329 landed, I think the premise underneath this UI has materially changed rather than the implementation itself being at fault. The built-in pricing set has grown from a small hand-maintained list to 1,239 generated models.dev entries. The current adapter assembles the complete set and the panel renders it as one table, while the stories exercise at most three rows. We could add filtering, pagination, and large-dataset coverage, but I’m no longer sure that rescuing the full-table design is the simplest product. Pricing overrides now look like a low-frequency advanced escape hatch. My preference would be to keep models.dev as the read-only built-in authority and, if overrides are still needed, include pricing fields in the unified If real demand later justifies a UI, it could be much smaller: show only user overrides and use a catalog-backed picker when adding one, rather than presenting the complete built-in catalog. I don’t think this calls for another incremental patch here; it would be worth revisiting the product decision first. This is a change in the surrounding facts after #2329, not a reflection on the care put into this PR. |
|
That makes sense. #2329 changed the product shape enough that I don't think adding pagination and filtering to the 1,239-row table is the right next step. I'll stop iterating on this branch and close the PR. I agree with keeping models.dev read-only and moving pricing overrides into the unified model-facts layer discussed in #2330. If a dedicated UI is justified later, an overrides-only list with a catalog-backed picker would be a much smaller surface. Thanks for taking another look and for separating the changed product facts from the implementation. |
Summary
This PR lands the isolated M4 Pricing renderer/editor slice on top of the Host-backed semantic adapter added by #2148 and #2024.
DesktopPricingSettingsPort.UsageStats.pricingprojection so Pricing has one Host-backed source of truth.Part of #2015.
Verification
mise exec node@24.18.1 -- npm run lintmise exec node@24.18.1 -- npm run format:checkmise exec node@24.18.1 -- npm --workspace @maka/desktop run typecheckmise exec node@24.18.1 -- npm --workspace @maka/desktop run build:renderermise exec node@24.18.1 -- npm --workspace @maka/desktop run build-storybookScope
This PR intentionally does not activate Pricing in the production
SettingsModaland does not add a legacy IPC path. The copyable exact-key source from Host-backed Usage/Inspector remains a follow-up acceptance item before #2015 can close; production activation remains part of the M5 cutover.中文说明
摘要
本 PR 在 #2148 与 #2024 提供的 Host-backed 语义适配器之上,实现独立的 M4 Pricing renderer/editor 切片。
DesktopPricingSettingsPort支持新增、编辑、重置和删除。0。UsageStats.pricing投影,使 Pricing 只保留一个 Host-backed 事实来源。这是 #2015 的一部分。
验证
mise exec node@24.18.1 -- npm run lintmise exec node@24.18.1 -- npm run format:checkmise exec node@24.18.1 -- npm --workspace @maka/desktop run typecheckmise exec node@24.18.1 -- npm --workspace @maka/desktop run build:renderermise exec node@24.18.1 -- npm --workspace @maka/desktop run build-storybook范围
本 PR 不会在生产
SettingsModal中提前激活 Pricing,也不会新增 legacy IPC 路径。来自 Host-backed Usage/Inspector 的可复制 exact-key 来源仍是 #2015 关闭前的后续验收项;生产激活仍属于 M5 cutover。