fix: text color was not applying to table block#2663
Conversation
📝 WalkthroughWalkthroughAdded an Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/src/end-to-end/colors/colors.test.ts`:
- Around line 118-135: The test "Should be able to set block text color on a
table" is missing a short settle delay after clicking the color swatch, causing
flakiness; update the test (the block using focusOnEditor, executeSlashCommand,
TABLE_SELECTOR, DRAG_HANDLE_SELECTOR, DRAG_HANDLE_MENU_SELECTOR, and
TEXT_COLOR_SELECTOR) to await a small pause (e.g., 500ms) after the
page.mouse.click(...) that selects the color before calling page.screenshot(),
so the drag-handle / Colors submenu animation has time to finish.
🪄 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: CHILL
Plan: Pro
Run ID: 837bc722-93d7-493d-9ebd-5a20800e35a4
⛔ Files ignored due to path filters (3)
tests/src/end-to-end/colors/colors.test.ts-snapshots/blockTextColorTable-chromium-linux.pngis excluded by!**/*.pngtests/src/end-to-end/colors/colors.test.ts-snapshots/blockTextColorTable-firefox-linux.pngis excluded by!**/*.pngtests/src/end-to-end/colors/colors.test.ts-snapshots/blockTextColorTable-webkit-linux.pngis excluded by!**/*.png
📒 Files selected for processing (2)
packages/core/src/blocks/Table/block.tstests/src/end-to-end/colors/colors.test.ts

Summary
This PR fixes an issue where changing the text color prop for a table block had no effect. This was due to a difference in how
TableViews work vs typical node views (explained in more detail in the code).Closes #2636
Rationale
This is a bug.
Changes
Added
updatemethod toTableViewimplementation for the table block's node view. It calls the standardTableViewupdateimplementation and re-applies HTML attributes from props.Impact
N/A
Testing
Added e2e test.
Screenshots/Video
N/A
Checklist
Additional Notes
Summary by CodeRabbit
Bug Fixes
Tests