Skip to content

Add CSV deadline import to account settings#5739

Open
darkestni wants to merge 1 commit intousememos:mainfrom
darkestni:codex/memos-csv-deadline-import
Open

Add CSV deadline import to account settings#5739
darkestni wants to merge 1 commit intousememos:mainfrom
darkestni:codex/memos-csv-deadline-import

Conversation

@darkestni
Copy link
Copy Markdown
Contributor

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

  • Add an Import CSV action in Settings -> My Account
  • Parse CSV files with required title and deadline columns
  • Support optional description, visibility, and tags columns
  • Preview valid rows before import
  • Show validation/import errors without blocking valid rows
  • Create memos with the imported deadline mapped to memo display_time
  • Format imported memo content with a heading, deadline line, description, and tags

CSV format

Required columns:

  • title
  • deadline

Optional columns:

  • description
  • visibility
  • tags

Accepted deadline formats include:

  • YYYY-MM-DD
  • YYYY-MM-DD HH:mm
  • YYYY-MM-DD HH:mm:ss
  • ISO 8601

Validation

  • corepack pnpm lint
  • corepack pnpm build

@darkestni darkestni requested a review from a team as a code owner March 19, 2026 07:15
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +108 to +110
const date = new Date(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute), Number(second));
if (!Number.isNaN(date.getTime())) {
return date;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +109 to +113
for (const entry of entries) {
try {
await memoServiceClient.createMemo({
memo: buildDeadlineMemo(entry, defaultVisibility),
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +230 to +232
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())}`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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