hoangsonww / hoangsonww/ToDo-App-NextJS-Fullstack

Feature: Natural-Language “Quick Add” → Structured Tasks (dates, recurrence, priority, lists, reminders)

Open
#5 0 comments 0 reactions 1 assignee Claimed by @hoangsonww View on GitHub
bug documentation duplicate enhancement good first issue help wanted question
Dominant language
TypeScript
Stars
27
Forks
18
PR merge metrics
No merged PRs in 30d

Description

### Summary

Let users type a sentence like:

* `pay rent on the 1st, repeat monthly at 9am 🔔`
* `finish report tomorrow 5pm #work !high @jane`
* `groceries sat 10am -> Home List`
…and automatically parse it into a structured task (title, due date/time, recurrence, priority, list, assignees, reminder).

---

### Why

Speeds up capture, especially on mobile. Reduces clicks and improves adoption. Complements your existing recurrence/collab roadmap but is orthogonal to both.

---

### Scope (v1)

* Parse: **date/time**, **recurrence** (daily/weekly/monthly/“every 3rd Fri”), **priority** (`!low|!med|!high`), **list** (`-> List Name`), **tags** (`#tag`), **reminder** (`🔔 in 10m / at 9am`), **assignees** (`@user` for shared lists in future).
* Respect user **timezone** and **week start**.
* Provide inline chips preview before saving; allow quick edits.

---

### UX

* Add a “Quick Add” input at top of list.
* As user types, show parsed chips: `[Fri 5:00 PM] [repeat monthly] [!high] [-> Work] [🔔 30m before]`.
* On Enter: create task; on Esc: revert to plain text.
* If parse is ambiguous, underline fragment with a dotted line; show tooltip with choices.

---

### Parsing Rules

* Natural dates: “tomorrow 5pm”, “next wed”, “in 2h”, “on the 1st at 9”.
* Recurrence: `every day|weekday|week|month|year`, “every 2 weeks”, “on the 3rd Friday”.
* Priority: `!low|!med|!high` (or `p1|p2|p3` fallback).
* Tags: `#tag`.
* List routing: `-> List Name` (exact, case-insensitive).
* Reminder: `🔔 at 9am`, `🔔 in 10m`, `🔔 30m before`.
* Assignee: `@email` (store now; activate when shared lists ship).

---

### Tech Plan

**Frontend**

* Lightweight parser util with small grammar (avoid huge deps). Option A: use `chrono-node` for dates, add small custom layers for recurrence/priority; Option B: hand-rolled regex + date-fns.
* Component: `` with live parse preview chips; accessible (ARIA) and keyboard-driven.
* Persist original raw text alongside structured fields for audit.

**Backend**

* Extend `/api/todos` to accept `recurrence`, `priority`, `reminderAt`, `listId`, `tags[]`, `assignees[]`.
* Normalize to ISO timestamps; store `timezone` (IANA) per user for correct server rendering.
* Validate recurrence with RFC5545-like subset (freq, interval, byday, bymonthday).
* Return server’s interpretation in response (echo parsed fields) for client confirmation.

**Data Model (minimal)**

* `todos`: `title`, `dueAt timestamptz`, `priority enum('low','med','high')`, `recurrence jsonb`, `reminderAt timestamptz`, `listId`, `tags text[]`, `assignees text[]`, `rawInput text`.

---

### Acceptance Criteria

* [ ] Typing `submit assignment fri 5pm !high 🔔 30m before -> School` creates a task with correct fields.
* [ ] Relative inputs (“in 2h”, “next wed”) are timezone-correct.
* [ ] Invalid or conflicting tokens surface a non-blocking inline warning with suggestions.
* [ ] API returns canonicalized fields; UI chips match server.
* [ ] Unit tests for parser (at least 30 cases covering dates/recurrence/edge cases).

---

### Edge Cases

* Month rollover (`on the 31st` when next month shorter) → snap to last day or warn.
* Past times today → assume **next occurrence** unless user disabled.
* Multiple lists matching `-> home` vs `-> Home Projects` → pick exact match; if none, show chooser.

---

### Follow-ups (post-v1)

* Voice quick add (Web Speech API) → pipe transcript through the same parser.
* Email/SMS inbox to task (idempotent webhook with parsing).
* ICS export for parsed recurrence (ties into your calendar work).

---

### Test Snippets

```
“call mom sun 7pm 🔔 in 10m !med #family”
“pay rent on the 1st at 9am repeat monthly 🔔 day before 9am -> Finance”
“review PRs every weekday 4:30pm -> Work #eng”
“buy milk in 2h”
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.