Skip to content

[ENG-2088] Add tag to block button on canvas block cards - #1351

Open
sid597 wants to merge 1 commit into
mainfrom
eng-2088-implement-add-tag-to-block-button
Open

[ENG-2088] Add tag to block button on canvas block cards#1351
sid597 wants to merge 1 commit into
mainfrom
eng-2088-implement-add-tag-to-block-button

Conversation

@sid597

@sid597 sid597 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Adds a # Add tag button to the header of block cards on the Roam canvas, per the DES-359 mock. It reuses NodeMenu in tag mode, so selecting a tag appends it to the end of the block text; a new optional onTagAdded callback on NodeMenu lets the shape update its own props (title + recalculated size) after the write, since nothing on the canvas watches block strings. The header buttons (sidebar, add tag, convert) now sit in one flex container instead of fixed absolute offsets — the large Convert-button hunk is indentation-only (git diff -w). The button only shows on live block shapes when at least one node type has a tag configured, and the key-remount on close mirrors renderImageToolsMenu.

Known limitation, left out of scope: each block card mounts a trigger-mode NodeMenu, which attaches document-level key listeners that no-op unless that menu is open; avoiding that would change shared NodeMenu behavior that the textarea flows depend on.


Open in Devin Review

@linear-code

linear-code Bot commented Aug 24, 2026

Copy link
Copy Markdown

ENG-2088

@vercel

vercel Bot commented Aug 24, 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 Aug 24, 2026 5:25pm

Request Review

@supabase

supabase Bot commented Aug 24, 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 ↗︎.

@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: 4e691ad18a

ℹ️ 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 +673 to +678
<NodeMenu
key={addTagMenuKey}
blockUid={shape.props.uid}
extensionAPI={extensionAPI}
onClose={() => setAddTagMenuKey((k) => k + 1)}
onTagAdded={handleTagAdded}

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 Add unit coverage for the canvas tag flow

Add meaningful unit tests covering tag selection, the asynchronous block update, and the subsequent shape title/size refresh; this commit introduces that behavior without any tests, so regressions such as a rejected update or stale shape state will not be detected.

AGENTS.md reference: AGENTS.md:L82-L85

Useful? React with 👍 / 👎.


{/* Add Tag to Block Button */}
{extensionAPI && showAddTagButton && (
<NodeMenu

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 Mount the tag menu only when a card opens it

On canvases with many live block cards, this mounts a separate NodeMenu for every card even while all menus are closed. Each instance reads and parses all discourse nodes and, because it has a trigger, registers its own keydown and keyup listeners on document; consequently initialization and every keyboard event scale with the number of mounted cards. Lazily mounting the menu after the trigger is activated, or sharing one menu among cards, avoids that canvas-wide overhead.

Useful? React with 👍 / 👎.

@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

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