Skip to content

fix: update old popup to ToolTip (skeleton v3) #2138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 20, 2025

Conversation

Axxiar
Copy link
Contributor

@Axxiar Axxiar commented Jun 19, 2025

Summary by CodeRabbit

  • New Features

    • Improved user feedback on the submit button by displaying a tooltip explaining why submission is disabled when no approver is assigned.
  • Refactor

    • Removed unused and redundant data attributes related to popups and tooltips across multiple components for cleaner markup.
    • Updated button logic and styling to provide clearer visual cues when actions are unavailable.

Copy link
Contributor

coderabbitai bot commented Jun 19, 2025

Walkthrough

This update removes various data-popup attributes and related popup target properties from several Svelte components and pages. In DetailView.svelte, a disabled submit button is replaced with a tooltip-enhanced button that provides feedback when submission is unavailable, including new reactive state handling. Minor interface and prop changes accompany the removal of popup-related attributes.

Changes

File(s) Change Summary
frontend/src/lib/components/DetailView/DetailView.svelte Replaced disabled submit button with a tooltip-wrapped button, added tooltip state, dynamic event handling, and styling.
frontend/src/lib/components/RiskMatrix/Cell.svelte Removed popupTarget prop from the Props interface.
frontend/src/lib/components/RiskMatrix/RiskMatrix.svelte Removed data-popup attributes and no longer passes popupTarget prop to Cell components.
frontend/src/routes/(app)/(internal)/ebios-rm/[id=uuid]/Tile.svelte Removed data-popup attributes from tooltip and popover content containers.
frontend/src/routes/(app)/(internal)/operational-scenarios/[id=uuid]/+page.svelte Removed data-popup attributes from popover content divs for likelihood, gravity, and risk level.
frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/+page.svelte Removed data-popup="popupDownload" attribute from the popover content wrapper.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DetailView
    participant Tooltip

    User->>DetailView: Render Submit Button
    DetailView->>Tooltip: If no approver, show tooltip on hover/focus
    User->>DetailView: Click or press key on button
    alt Approver exists
        DetailView->>DetailView: Invoke modalConfirm()
    else No approver
        Tooltip->>User: Show "No approver assigned" message
    end
Loading

Suggested reviewers

  • ab-smith
  • nas-tabchiche

Poem

The popups are gone, the tooltips now shine,
With feedback and style, the interface is fine.
No more hidden hints in data attributes deep,
Now users get guidance before they take the leap.
🐇✨

Hoppity hooray for clarity’s sweep!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b85ecc and 4e5eae0.

📒 Files selected for processing (6)
  • frontend/src/lib/components/DetailView/DetailView.svelte (3 hunks)
  • frontend/src/lib/components/RiskMatrix/Cell.svelte (0 hunks)
  • frontend/src/lib/components/RiskMatrix/RiskMatrix.svelte (0 hunks)
  • frontend/src/routes/(app)/(internal)/ebios-rm/[id=uuid]/Tile.svelte (1 hunks)
  • frontend/src/routes/(app)/(internal)/operational-scenarios/[id=uuid]/+page.svelte (0 hunks)
  • frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/+page.svelte (1 hunks)
💤 Files with no reviewable changes (3)
  • frontend/src/lib/components/RiskMatrix/Cell.svelte
  • frontend/src/routes/(app)/(internal)/operational-scenarios/[id=uuid]/+page.svelte
  • frontend/src/lib/components/RiskMatrix/RiskMatrix.svelte
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: functional-tests (3.12, chromium)
  • GitHub Check: enterprise-startup-functional-test (3.12)
  • GitHub Check: enterprise-functional-tests (3.12, chromium)
  • GitHub Check: startup-docker-compose-test
  • GitHub Check: enterprise-startup-docker-compose-test
  • GitHub Check: startup-functional-test (3.12)
🔇 Additional comments (5)
frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/+page.svelte (1)

187-188: Removed obsolete data-popup attribute.
The Popover content container no longer requires the data-popup="popupDownload" hook under Skeleton v3. This cleanup aligns with the updated API and prevents stale attributes.

frontend/src/routes/(app)/(internal)/ebios-rm/[id=uuid]/Tile.svelte (1)

116-124: Dropped legacy data-popup on Tooltip content.
The Tooltip now handles its content targeting internally, so removing the old data-popup binding simplifies the markup without affecting functionality.

frontend/src/lib/components/DetailView/DetailView.svelte (3)

18-18: Import addition looks correct.

The Tooltip import is properly added alongside the existing Tabs import from the skeleton library, which aligns with the skeleton v3 upgrade objective.


226-226: Reactive state variable is properly implemented.

The openStateRA state variable follows Svelte 5 patterns and is correctly positioned with other variable declarations.


471-498: Excellent UX improvement with comprehensive tooltip implementation.

The replacement of a simple button with a Tooltip component significantly enhances user experience by providing clear feedback when submission is unavailable due to missing approver. The implementation includes:

  • Proper conditional tooltip display logic
  • Appropriate styling for enabled/disabled states
  • Comprehensive event handling for both click and keyboard interactions
  • Well-structured Svelte snippets for trigger and content

The conditional logic correctly ensures the modal is only triggered when an approver is present, preventing user confusion.


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need 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)

  • @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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Axxiar Axxiar marked this pull request as ready for review June 20, 2025 16:49
Copy link
Collaborator

@eric-intuitem eric-intuitem left a comment

Choose a reason for hiding this comment

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

LGTM

@eric-intuitem eric-intuitem merged commit 5176f78 into main Jun 20, 2025
19 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants