-
Notifications
You must be signed in to change notification settings - Fork 536
Description
Problem
From the list above, only TinybaseValues and the Onboarding-related variants are actually needed. The others are redundant.
Occasionally, the onboarding state must be accessed from the Rust side. The remaining variants are frontend-only and can be merged into TinybaseValues.
For each added enum variant, we end up introducing a significant amount of boilerplate, for example:
- https://github.com/fastrepl/hyprnote/blob/6aae2567ce934bc372adce4e01f047e11a952447/apps/desktop/src-tauri/src/ext.rs#L104-L117
- https://github.com/fastrepl/hyprnote/blob/6aae2567ce934bc372adce4e01f047e11a952447/apps/desktop/src-tauri/src/commands.rs#L133-L148
Additionally, one-off load/store logic is required alongside the generated bindings:
In practice, we can simply leverage the TinybaseValues variant. Load/save is already handled by the TinyBase persister:
Why Things Are Getting Worse
Previously, I believed DismissedToasts should not be part of StoreKey. After introducing TinybaseValues, this became even clearer, and a refactor was obviously needed. However, I did not follow through, nor did I document this as code comments.
As a result:
- AI agents tend to follow existing patterns.
- Contributors with less familiarity with the codebase maintenance model generate non-ideal code with AI.
- AI helps us move fast—but also helps us generate bad code faster.
Recent examples:
- feat(desktop): add recently opened tabs tracking #3526
- feat: persist pinned tabs across app restarts #3503
Solution
The upside is that AI can also help us fix this faster. This issue can be fed directly to an agent, and also serve as shared context for other contributors.
Other Resources
This situation strongly echoes what Mitchell said about feature design.