TouK / nussknacker

Low-code tool for automating actions on real time data | Stream processing for the users.
https://nussknacker.io
Apache License 2.0
663 stars 93 forks source link

Revert to shorter tooltip for labels #7217

Closed arkadius closed 1 day ago

arkadius commented 1 day ago

Describe your changes

Checklist before merge

Summary by CodeRabbit

coderabbitai[bot] commented 1 day ago
📝 Walkthrough ## Walkthrough The pull request introduces changes to two components: `ScenarioLabels` and `LabelChip`. In the `ScenarioLabels.tsx` file, the tooltip title for the `StyledLabelChip` component has been modified from a dynamic string that incorporated the label title to a static string "Label". This adjustment simplifies the tooltip content but removes the specific context previously provided by the dynamic label title. The overall logic of the `ScenarioLabels` component remains intact, preserving its functionality related to label management, input validation, and state management. Similarly, in the `labelChip.tsx` file, the `LabelChip` component has undergone a similar modification where the `title` prop of the `StyledLabelChip` has been changed from a dynamic translated string that included the label value to a static string "Label". No other changes have been made to the control flow, error handling, or internal logic of either component. The modifications are primarily cosmetic, focusing on the tooltip text while keeping the core functionality of both components unchanged. ## Sequence Diagram(s) ```mermaid sequenceDiagram participant User participant ScenarioLabels participant LabelChip User->>ScenarioLabels: Interacts with label ScenarioLabels->>LabelChip: Render label with tooltip LabelChip-->>ScenarioLabels: Display tooltip "Label" ScenarioLabels-->>User: Show label with static tooltip ```

📜 Recent review details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
📥 Commits Reviewing files that changed from the base of the PR and between 5e5bf702d1739cab5887bbfe57df3d4aeaa6a339 and ea0d759341e80ac0dac6305fcded61c758be7b6f.
📒 Files selected for processing (2) * `designer/client/src/components/toolbars/scenarioDetails/ScenarioLabels.tsx` (1 hunks) * `designer/submodules/packages/components/src/common/labelChip.tsx` (1 hunks)
✅ Files skipped from review due to trivial changes (1) * designer/client/src/components/toolbars/scenarioDetails/ScenarioLabels.tsx
🔇 Additional comments (2)
designer/submodules/packages/components/src/common/labelChip.tsx (2) `31-31`: **LGTM! Consider documenting UX decisions.** The change aligns with the PR objective to revert to shorter tooltips. However, since this appears to be part of a broader UX decision affecting multiple components, consider documenting this decision. Let's verify if similar tooltip simplifications exist across the codebase:
✅ Verification successful **Tooltip changes are consistent across the codebase** The verification confirms that all scenario-related tooltips follow the same simplified pattern: - Status: "Status" - Label: "Label" - Category: "Category" - Fragment/Scenario: "Fragment"/"Scenario" - Processing mode: "Processing mode" This consistent approach to tooltips across components indicates a deliberate UX decision that has been uniformly applied.
🏁 Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Check for similar tooltip patterns across the codebase # to ensure consistency in UX decisions # Search for tooltip-related translations rg "scenariosList\.tooltip" -A 2 # Search for similar Chip components with tooltips ast-grep --pattern 'StyledLabelChip title={$_}' ``` Length of output: 2271
--- Line range hint `31-38`: **Verify accessibility impact of simplified tooltips.** While the simplified tooltip makes the UI cleaner, we should ensure it maintains adequate context for screen readers and keyboard navigation. Let's check for other accessibility attributes in similar components: Consider adding an `aria-label` with more context for screen readers while keeping the visual tooltip simple: ```diff ```
✅ Verification successful Let me gather more information about accessibility patterns in the codebase. --- **Accessibility implementation is consistent with similar components.** The current implementation follows the established accessibility patterns in the codebase: - The component uses `tabIndex={0}` to ensure keyboard navigation, consistent with other interactive chips in the codebase - The component has a descriptive `title` attribute providing tooltip text - The component has an `onClick` handler for interaction The simplified tooltip is sufficient since: 1. The component is keyboard accessible via tabIndex 2. The tooltip provides clear context with "Label" text 3. The pattern is consistent with other similar components in the codebase like categoryChip
🏁 Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Check for accessibility patterns in similar components # to ensure consistent accessibility support # Search for aria-label attributes in Chip components rg 'aria-label.*=.*".*Label.*"' # Search for similar components with accessibility attributes ast-grep --pattern 'Chip $$$ aria-label={$_} $$$' ``` Length of output: 131158 --- Script: ```shell #!/bin/bash # Search for aria-label usage in similar components rg -A 2 'aria-label.*=.*".*Label.*"' designer/submodules/packages/components/src/ # Search for tabIndex usage in similar components rg -A 2 'tabIndex.*=.*[0-9]' designer/submodules/packages/components/src/ # Search for title attribute usage in similar components rg -A 2 'title.*=.*".*Label.*"' designer/submodules/packages/components/src/ ``` Length of output: 2209

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` 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) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.