Skip to content

Attribute Select - handle {[table]}#514

Merged
mdroidian merged 3 commits into
mainfrom
attribute-select-table-fix
May 19, 2026
Merged

Attribute Select - handle {[table]}#514
mdroidian merged 3 commits into
mainfrom
attribute-select-table-fix

Conversation

@mdroidian
Copy link
Copy Markdown
Collaborator

@mdroidian mdroidian commented May 19, 2026

  • Introduced functions to handle table rows and retrieve block UIDs from table cells.
  • Enhanced event management for attribute buttons to prevent default actions and improve user interaction.
  • Refactored attribute button rendering to include new event handlers for better focus and click behavior.
  • Updated various function calls to maintain consistency and prevent potential errors.
  • Improved code readability and maintainability with structured event handling.

https://www.loom.com/share/a5e5b42301db4bbeb02dfc7fed8c12e8

Summary by CodeRabbit

  • Bug Fixes

    • Improved attribute selector functionality in table cells
    • Fixed attribute button interactions to prevent unintended focus and selection behavior
  • Chores

    • Version bump to 1.7.4

Review Change Stack

* Introduced functions to handle table rows and retrieve block UIDs from table cells.
* Enhanced event management for attribute buttons to prevent default actions and improve user interaction.
* Refactored attribute button rendering to include new event handlers for better focus and click behavior.
* Updated various function calls to maintain consistency and prevent potential errors.
* Improved code readability and maintainability with structured event handling.
@coderabbitai

This comment was marked as resolved.

@mdroidian
Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

✅ Actions performed

Full review triggered.

const getAttributeBlockUidFromTarget = (target: HTMLElement): string => {
if (target.closest(".rm-block-ref")) return getBlockUidFromTarget(target);

const tableCellUid = getTableCellBlockUidFromTarget(target);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should move this to roamjs-components getBlockUidFromTarget

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/features/attributeSelect.tsx`:
- Around line 109-135: getTableCellBlockUidFromTarget mixes undefined and
empty-string sentinels which lets an empty string slip past the caller's check
in getAttributeBlockUidFromTarget; change getTableCellBlockUidFromTarget to
consistently return undefined when no valid uid is found (update its return type
to string | undefined and replace all "" returns with undefined), and then
update getAttributeBlockUidFromTarget to treat a missing table result by
checking for undefined (or falsy) and falling back to getBlockUidFromTarget;
ensure callers that relied on "" are adjusted to handle undefined.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4fce43e9-cbbb-4d96-be87-14d431924020

📥 Commits

Reviewing files that changed from the base of the PR and between fa8cf0b and 4d75513.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • src/features/attributeSelect.tsx

Comment thread src/features/attributeSelect.tsx
@mdroidian
Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

✅ Actions performed

Full review triggered.

@mdroidian mdroidian merged commit 134b1c5 into main May 19, 2026
2 checks passed
@mdroidian mdroidian deleted the attribute-select-table-fix branch May 19, 2026 02:22
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