Skip to content

ENG-1927 Debounce canvas color writes and flush pending writes on unmount#1144

Merged
mdroidian merged 4 commits into
mainfrom
codex/linear-mention-eng-1927-debounce-roam-discourse-node-color
Jun 22, 2026
Merged

ENG-1927 Debounce canvas color writes and flush pending writes on unmount#1144
mdroidian merged 4 commits into
mainfrom
codex/linear-mention-eng-1927-debounce-roam-discourse-node-color

Conversation

@mdroidian

@mdroidian mdroidian commented Jun 22, 2026

Copy link
Copy Markdown
Member

Motivation

  • Prevent excessive writes when the color input is changed rapidly by debouncing persistence of the canvas color setting.
  • Ensure any pending color write is flushed when the settings panel unmounts to avoid losing the last user change.
  • Allow immediate persistence when the color is explicitly cleared.

Description

  • Introduced COLOR_WRITE_DEBOUNCE_MS, a PendingColorWrite type, and a writeColorSetting helper to centralize color persistence logic.
  • Added useRef hooks (colorWriteTimeoutRef and pendingColorWriteRef) and utility functions clearColorWriteTimeout, persistColor, and persistColorAfterPause to debounce writes and manage pending state.
  • Updated the color input handler to call persistColorAfterPause and updated the clear (Icon click) handler to clear the timeout and call persistColor for immediate persistence.
  • Added a cleanup useEffect to flush any pending color write on unmount.

Testing

  • Ran TypeScript type-check and linting (tsc / linter) and they passed.
  • Ran the project's unit tests and they passed.
  • Performed a development build locally and it completed successfully.

Codex Task


Open in Devin Review

@linear-code

linear-code Bot commented Jun 22, 2026

Copy link
Copy Markdown

ENG-1927

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
discourse-graph Skipped Skipped Jun 22, 2026 7:50am

Request Review

@supabase

supabase Bot commented Jun 22, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@mdroidian mdroidian changed the title Debounce canvas color writes and flush pending writes on unmount ENG-1927 Debounce canvas color writes and flush pending writes on unmount Jun 22, 2026
@mdroidian

Copy link
Copy Markdown
Member Author

@codex review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@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: 90d5792843

ℹ️ 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 apps/roam/src/components/settings/NodeConfig.tsx Outdated
@mdroidian

Copy link
Copy Markdown
Member Author

@codex review

@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: 7c0e378e91

ℹ️ 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 apps/roam/src/components/settings/NodeConfig.tsx
Comment thread apps/roam/src/components/settings/NodeConfig.tsx
@mdroidian mdroidian merged commit 11f6178 into main Jun 22, 2026
8 checks passed
@mdroidian mdroidian deleted the codex/linear-mention-eng-1927-debounce-roam-discourse-node-color branch June 22, 2026 07:50
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