Skip to content

Improve task UI responsiveness and optimistic task updates#1

Open
ssshanaka wants to merge 1 commit into
masterfrom
codex/improve-application-user-experience
Open

Improve task UI responsiveness and optimistic task updates#1
ssshanaka wants to merge 1 commit into
masterfrom
codex/improve-application-user-experience

Conversation

@ssshanaka

Copy link
Copy Markdown
Owner

Motivation

  • Reduce UI jank and unnecessary recomputation when switching views or updating tasks to make interactions feel instant.
  • Make adding tasks and subtasks feel fast by avoiding full list reloads and replacing DOM query focus patterns with a stable input ref.
  • Reduce rerenders caused by board/list derivations and item rendering during sync/status changes.

Description

  • Memoized derived lists and trees in the list view by adding visibleTasks, completedTasks, listTaskCounts, and currentTaskList using useMemo in src/pages/AppPage.jsx to avoid rebuilding trees on unrelated renders.
  • Reworked board rendering in src/components/TaskBoard.jsx to precompute boardData with useMemo and exported TaskBoard with React.memo to cut unnecessary recalculation and rerenders.
  • Replaced DOM queries/timeouts for focusing the add-task input with a stable ref and a focusAddTaskInput callback (requestAnimationFrame) in src/pages/AppPage.jsx, and wired that into sidebar/board actions and keyboard shortcuts.
  • Improved add-task and subtask UX by keeping optimistic local entries and then replacing them with the server response (instead of forcing a full getTasks reload), added saveTasksCache helper to persist optimistic state, and exported DesktopTaskItem with React.memo to further reduce rerenders (src/pages/AppPage.jsx, src/components/TaskBoard.jsx, src/components/DesktopTaskItem.jsx).

Testing

  • npm run build — succeeded and produced a production build.
  • npm test -- --watchAll=false — failed early due to the CRA/Jest environment not resolving react-router-dom in src/App.jsx (pre-existing resolver issue), so unit tests did not run to completion.

Codex Task

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
taskflow-nih3 Ready Ready Preview, Comment Jun 26, 2026 6:15pm

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

Copy link
Copy Markdown

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: d8a638e12a

ℹ️ 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 thread src/pages/AppPage.jsx
Comment on lines +619 to +623
const next = prev.map((task) =>
task.id === tempId ? { ...createdTask, starred: false } : task
);
saveTasksCache(currentListId, next);
return next;

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 Avoid caching another list after async adds

When a user submits a task in list A and switches to another list before insertTask resolves, the prev passed to this updater can now be the new list's tasks while currentListId is still the old list captured by the submit handler. This saves the other list into list A's cache and leaves the temp task unreplaced until a later network refresh; only write the cache when the temp id is still present, or update a per-list snapshot instead of the shared tasks state.

Useful? React with 👍 / 👎.

Comment thread src/pages/AppPage.jsx
Comment on lines +153 to +155
counts[list.id] = (allTasksByList[list.id] || []).filter(
(task) => task.status !== "completed"
).length;

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 Keep sidebar counts in sync with list edits

These badges now depend only on allTasksByList, but list-view add/complete/delete handlers update the separate tasks state and do not update allTasksByList. After a user edits tasks while viewing a list, the sidebar count for that list stays based on the last board fetch until returning to board or refreshing, so the displayed count is stale; include the active list state in this derivation or keep allTasksByList updated with the same optimistic changes.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant