Repository navigation
Sub-habits, and the web's Productivity tabs drawn like the iPhone app - #72
Conversation
Published from the private repository by oss-sync. - Sub-habits, and the web's Productivity tabs drawn like the iPhone app 61 files changed, 5944 insertions(+), 1707 deletions(-)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27b324990e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) : loading && goals.length === 0 ? ( | ||
| <p className="pk-empty" role="status">Loading goals…</p> |
There was a problem hiding this comment.
Hide goals until the selected period finishes loading
When switching from a populated period to another tab or using the period arrows, goals still contains the previous period while the new request runs. Because loading is shown only when that array is empty, the old goals are rendered under the newly selected period and remain there indefinitely if the request fails; the user can then complete or edit a goal while believing it belongs to the new period. Treat any period-changing load as loading, or associate the cached goals with the query that produced them.
Useful? React with 👍 / 👎.
| await habitWrite(group.id, { date: habitDay, complete: t.complete }) | ||
| pushToast(groupWords(group.name, t, 0, 0).result, 'info', { |
There was a problem hiding this comment.
Only show group success after the write succeeds
When /api/habits/log fails, habitWrite catches the error and resolves normally, so this code still displays the successful “Marked/Cleared” toast and offers Undo even though the group was not changed. This occurs on any transient bridge or validation failure from the Overview group check; return a success result from habitWrite or let it reject before showing the success toast.
Useful? React with 👍 / 👎.
| // phone, so a habit with one puts its controls on a line of their own. | ||
| const crowded = Boolean(habit.metric) | ||
| const recent = recentDays(habit, entries, date).filter((d) => d.level > 0).length | ||
| const crowded = Boolean(habit.metric) && !group |
There was a problem hiding this comment.
Hide the metric control after a habit becomes a group
When a habit that already tracks a manual metric gains its first sub-habit, the metric remains on the payload. This group path sets crowded false but the shared controls block still renders HabitMetricInput, so entering a value calls /api/habits/log for the group and is always rejected because groups cannot own entries; the group form also hides metric settings, leaving no way to remove it. Guard the metric input (and group history metric) with !group or clear/refuse the metric when forming a group.
AGENTS.md reference: AGENTS.md:L75-L75
Useful? React with 👍 / 👎.
| if (!saved) return | ||
| pushToast(`Removed “${item.text}”`, 'success', { | ||
| duration: 6000, | ||
| action: { label: 'Undo', onClick: () => { void send(() => addListItems(list.id, [{ text: item.text, checked: item.checked }]), { id: list.id }) } }, |
There was a problem hiding this comment.
Restore deleted list items at their original position
When an item is removed from the middle of a checklist and the user clicks Undo, this recreates only its text and checked state. addListItems assigns every recreated item the next available position, so the supposedly restored item moves to the end of its open or checked section instead of returning where it was. Preserve item.position when recreating the item, or follow creation with a position update.
Useful? React with 👍 / 👎.
Published from the private repository by oss-sync.
61 files changed, 5944 insertions(+), 1707 deletions(-)