Add CSV deadline import to account settings#5739
Add CSV deadline import to account settings#5739darkestni wants to merge 1 commit intousememos:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c8a1e9c81
ℹ️ 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".
| const date = new Date(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute), Number(second)); | ||
| if (!Number.isNaN(date.getTime())) { | ||
| return date; |
There was a problem hiding this comment.
Reject rolled-over calendar values during deadline parsing
Rows like 2026-02-31 or 2026-01-01 25:00 currently pass validation because new Date(...) normalizes out-of-range components instead of failing. parseDeadlineCsv() then imports the shifted timestamp as if it were valid, so a typo silently becomes the wrong deadline rather than a validation error. This affects any import that relies on the advertised YYYY-MM-DD / YYYY-MM-DD HH:mm[:ss] formats.
Useful? React with 👍 / 👎.
| for (const entry of entries) { | ||
| try { | ||
| await memoServiceClient.createMemo({ | ||
| memo: buildDeadlineMemo(entry, defaultVisibility), | ||
| }); |
There was a problem hiding this comment.
Remove successful rows before allowing a retry
When an import partially succeeds, this loop still leaves entries unchanged and the dialog open. A second click retries every original row, and each createMemo() call produces a new memo instead of idempotently updating the old one, so users retrying a transient failure will duplicate all of the rows that already succeeded. The corruption only depends on having at least one failed row in the batch.
Useful? React with 👍 / 👎.
| export function formatDeadlineForDisplay(date: Date): string { | ||
| const pad = (value: number) => String(value).padStart(2, "0"); | ||
| return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`; |
There was a problem hiding this comment.
Preserve seconds in displayed imported deadlines
The importer advertises YYYY-MM-DD HH:mm:ss and ISO 8601 support, but formatDeadlineForDisplay() truncates everything to minutes. Because buildDeadlineMemo() uses this helper for both the preview and the persisted **Deadline:** ... line, importing a row such as 2026-04-10 23:59:30 creates a memo whose body says 23:59, which is the wrong deadline for anyone reading it later.
Useful? React with 👍 / 👎.
Summary
This adds a CSV deadline import flow under account settings.
Users can upload a CSV file, preview parsed rows, review validation errors, choose a default visibility, and bulk-create memos from the imported deadlines.
What's included
Import CSVaction in Settings -> My Accounttitleanddeadlinecolumnsdescription,visibility, andtagscolumnsdisplay_timeCSV format
Required columns:
titledeadlineOptional columns:
descriptionvisibilitytagsAccepted deadline formats include:
YYYY-MM-DDYYYY-MM-DD HH:mmYYYY-MM-DD HH:mm:ssValidation
corepack pnpm lintcorepack pnpm build