Add icon argument to smartblock buttons#134
Conversation
Co-authored-by: mclicks <mclicks@gmail.com>
|
Caution Review failedThe pull request is closed. WalkthroughThe updates introduce a new customizable icon feature for SmartBlock buttons, allowing users to specify or hide the icon via the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Button
participant SmartBlockHandler
participant IconRenderer
User->>Button: Click
Button->>SmartBlockHandler: Parse arguments (incl. Icon)
SmartBlockHandler->>IconRenderer: Determine icon (based on Icon/global settings)
IconRenderer-->>Button: Render icon (custom, default, or none)
SmartBlockHandler-->>Button: Execute SmartBlock logic
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…handling in code - Corrected capitalization of the `icon` parameter to `Icon` in documentation. - Enhanced examples to reflect the updated parameter name. - Refactored icon handling logic in the code to validate Blueprint icon names and improve icon display logic. - Adjusted default icon display behavior based on the new parameter structure.
|
@CodeRabbit full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/060-alternative-methods.md (1)
113-131: Convert emphasized text to a proper heading and fix icon-description mismatches
MD036 is flagging**Examples**(line 117) because bold text is being used as a heading. Use a heading level that matches prior sections (#### Examples).
While touching the block, correct the example descriptions –clipboardis not a “user” icon andrefreshis not a “settings” icon.-**Examples** +#### Examples ... -- `{{Today:SmartBlock:myWorkflow:Icon=clipboard}}` - Display a Blueprint.js user icon -- `{{Today:SmartBlock:myWorkflow:Icon=refresh}}` - Display a Blueprint.js settings icon +- `{{Today:SmartBlock:myWorkflow:Icon=clipboard}}` - Display the Blueprint.js “clipboard” icon +- `{{Today:SmartBlock:myWorkflow:Icon=refresh}}` - Display the Blueprint.js “refresh” icon
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/060-alternative-methods.md(2 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
docs/060-alternative-methods.md
117-117: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
Add
Iconargument to SmartBlock Buttons for per-button icon customization or disabling.This allows users to specify
icon=falseoricon=noneto hide the icon, oricon=<blueprint-name>to use a specific Blueprint.js icon. This per-button setting overrides the global "Hide Button Icon" configuration.https://blueprintjs.com/docs/versions/3/#icons
Summary by CodeRabbit
New Features
Iconparameter.Documentation
Iconparameter for SmartBlock buttons, including usage examples and global override behavior.Chores