@mindstudio-ai/remy 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiled/design.md +17 -0
- package/package.json +1 -1
package/dist/compiled/design.md
CHANGED
|
@@ -125,6 +125,23 @@ Forms should feel like interactions, not paperwork.
|
|
|
125
125
|
- Even data entry can be beautiful. Pay attention to alignment, padding,
|
|
126
126
|
and spacing. Consistency is key.
|
|
127
127
|
|
|
128
|
+
## Data Fetching and Updates
|
|
129
|
+
|
|
130
|
+
The UI should feel instant. Never make the user wait for a server round-trip
|
|
131
|
+
to see the result of their own action.
|
|
132
|
+
|
|
133
|
+
- **Optimistic updates.** When a user adds a row, toggles a setting, or
|
|
134
|
+
submits a form, update the UI immediately and let the backend confirm
|
|
135
|
+
in the background. If the backend fails, revert and show an error.
|
|
136
|
+
- **Use SWR for data fetching** (`useSWR` from the `swr` package). It
|
|
137
|
+
handles caching, revalidation, and stale-while-revalidate out of the box.
|
|
138
|
+
Prefer SWR over manual `useEffect` + `useState` fetch patterns.
|
|
139
|
+
- **Mutate after actions.** After a successful create/update/delete, call
|
|
140
|
+
`mutate()` to revalidate the relevant SWR cache rather than manually
|
|
141
|
+
updating local state.
|
|
142
|
+
- **Skeleton loading.** Show skeletons that mirror the layout on initial
|
|
143
|
+
load. Never show a blank page or centered spinner while data is loading.
|
|
144
|
+
|
|
128
145
|
## What Good Looks Like
|
|
129
146
|
|
|
130
147
|
- A dashboard that feels like Linear — clean data, clear hierarchy, every
|