Skip to content

feat(code): show Draft badge on New task when input is unsubmitted#2348

Open
fercgomes wants to merge 1 commit into
mainfrom
posthog-code/new-task-draft-indicator
Open

feat(code): show Draft badge on New task when input is unsubmitted#2348
fercgomes wants to merge 1 commit into
mainfrom
posthog-code/new-task-draft-indicator

Conversation

@fercgomes
Copy link
Copy Markdown
Contributor

@fercgomes fercgomes commented May 25, 2026

Summary

  • Adds a small Draft badge on the "New task" sidebar item when the user has typed into the new-task input but not submitted it
  • Reuses the existing persisted draft state (useDraftStore keyed on "task-input") — no new state machinery; the badge automatically disappears on submit because clearDraft already runs in the submit flow
Screenshot 2026-05-25 at 12 28 34

Test plan

  • Open the app — "New task" shows no badge
  • Click "New task", type something into the editor, then navigate away (e.g. click a task or the Inbox) — "New task" now shows a Draft badge
  • Reopen "New task" — the draft text is still in the editor, badge stays visible
  • Submit the task — badge disappears, draft cleared
  • Clear the editor manually (delete all text) — badge disappears
  • Restart the app with a draft present — badge re-appears after the draft store hydrates from electronStorage

Reads the persisted task-input draft from the message editor draft store and renders a small "Draft" badge in the New task sidebar item whenever the editor content is non-empty. The badge clears as soon as the task is submitted (which already calls clearDraft on the "task-input" session).

Generated-By: PostHog Code
Task-Id: bb2e391e-884e-4f53-be65-441b51ddda98
@fercgomes fercgomes marked this pull request as ready for review May 25, 2026 15:28
@fercgomes fercgomes requested a review from a team May 25, 2026 15:29
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 25, 2026

Reviews (1): Last reviewed commit: "feat(code): show Draft badge on New task..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant