Skip to content

Conversation

@jacquesikot
Copy link
Contributor

@jacquesikot jacquesikot commented Feb 11, 2025

Problem

Tooltips in the application were overflowing out of the viewport, causing them to be partially or completely hidden.

Why This is Happening

The preventOverflow modifier was disabled, and the flip modifier was not enabled in the Tooltip component, leading to improper positioning of tooltips.

Solution

  • Enabled the preventOverflow modifier and set its boundary to the viewport.
  • Enabled the flip modifier to ensure better positioning of tooltips.
  • Added a CSS assertion in the Input widget tests to verify that the tooltip icon has an overflow property set to "hidden".

Why This is the Best Solution

Enabling these modifiers ensures that tooltips adjust dynamically to remain fully on-screen, improving the user experience by making tooltips consistently visible. The additional test assertion helps maintain the integrity of the tooltip icon's CSS properties.

Fixes #34445

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13305105052
Commit: 1f20716
Cypress dashboard.
Tags: @tag.All
Spec:


Thu, 13 Feb 2025 11:33:13 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced tooltip behavior improves positioning and visibility by ensuring tooltips adjust dynamically to remain fully on-screen.
  • Tests

    • Added assertions to validate tooltip appearance and behavior in the InputV2 widget tests.

@jacquesikot jacquesikot self-assigned this Feb 11, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2025

Walkthrough

The tooltip component now uses an updated configuration within its useMemo hook. The preventOverflow modifier is explicitly enabled with its boundary element set to "viewport", and a new flip modifier has been introduced and enabled. The functional structure of the component remains unchanged, with only the behavior regarding positioning and visibility being refined.

Changes

File Path Change Summary
app/client/.../Tooltip/index.tsx Modified tooltip modifiers: enabled preventOverflow with "viewport" boundary and added enabled flip modifier.
app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input3_Spec.ts Added assertion to validate tooltip's CSS property for overflow in InputV2 widget tests.

Possibly related PRs

  • ci: Minor update for edge case #38295: The changes in the main PR, which modify the TooltipComponent to enhance its overflow behavior, are related to the retrieved PR's addition of a tooltip validation assertion in the Cypress test for the InputV2 widget, as both involve the tooltip's functionality.
  • fix:- added elipsis and tooltip to the button content in table widget component #36865: The changes in the main PR, which enhance the tooltip behavior in the TooltipComponent, are related to the modifications in the retrieved PR that also focus on tooltip functionality, specifically in the AutoToolTipComponent for buttons. Both PRs involve updates to tooltip behavior and visibility.

Suggested labels

skip-changelog, Bug, CI

Suggested reviewers

  • albinAppsmith
  • ApekshaBhosale

Poem

Code flows in delicate lines,
A tooltip now shimmers with new design,
Overflow is guarded, flipped with flair,
In the realm of UI, we dance with care,
Cheers to tweaks that make our work so fair!

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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
🪧 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.
    • 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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.

@jacquesikot jacquesikot added the ok-to-test Required label for CI label Feb 11, 2025
@jacquesikot jacquesikot added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Feb 11, 2025
Copy link
Contributor

@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: 0

🧹 Nitpick comments (2)
app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input3_Spec.ts (2)

107-107: LGTM! Consider adding a comment.

The assertion correctly validates the tooltip's overflow property. Consider adding a comment explaining why overflow needs to be hidden for the tooltip icon.

+ // Ensure tooltip icon's content is properly contained
 agHelper.AssertCSS(locators._tooltipIcon, "overflow", "hidden");

30-31: Refactor selector string concatenations into locator variables.

String concatenation for selectors is error-prone and harder to maintain. Consider moving these selectors into the locators object.

Example refactor:

// In locators.ts
+ _inputV2Input: `${this._widgetInDeployed(draggableWidgets.INPUT_V2)} input`,
+ _inputV2Textarea: `${this._widgetInDeployed(draggableWidgets.INPUT_V2)} textarea`,

// In test file
- agHelper.TypeText(locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " input", "test")
+ agHelper.TypeText(locators._inputV2Input, "test")

Also applies to: 34-35, 50-51, 67-68, 86-87, 109-110, 133-134, 141-142, 152-153, 158-159

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 461caa1 and 1f20716.

📒 Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input3_Spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test ...

app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input3_Spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: chromatic-deployment
  • GitHub Check: storybook-tests
  • GitHub Check: chromatic-deployment

@jacquesikot jacquesikot changed the title TESTING EXTERNAL SCRIPT: external merge request from Contributor fix: stop tooltip from overflowing out of view in preview and deployed mode. Feb 24, 2025
@github-actions github-actions bot added Bug Something isn't working Community Reported issues reported by community members Good First Issue Good for newcomers Input Widget Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage Production Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets labels Feb 24, 2025
@jacquesikot jacquesikot merged commit fc80866 into release Feb 24, 2025
96 of 97 checks passed
@jacquesikot jacquesikot deleted the fix/tooltip-position-fix-draft-pr branch February 24, 2025 11:36
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Apr 12, 2025
…d mode. (appsmithorg#39159)

### Problem
Tooltips in the application were overflowing out of the viewport,
causing them to be partially or completely hidden.

### Why This is Happening
The preventOverflow modifier was disabled, and the flip modifier was not
enabled in the Tooltip component, leading to improper positioning of
tooltips.

### Solution
- Enabled the preventOverflow modifier and set its boundary to the
viewport.
- Enabled the flip modifier to ensure better positioning of tooltips.
- Added a CSS assertion in the Input widget tests to verify that the
tooltip icon has an overflow property set to "hidden".

### Why This is the Best Solution
Enabling these modifiers ensures that tooltips adjust dynamically to
remain fully on-screen, improving the user experience by making tooltips
consistently visible. The additional test assertion helps maintain the
integrity of the tooltip icon's CSS properties.

Fixes appsmithorg#34445 

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/13305105052>
> Commit: 1f20716
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13305105052&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Thu, 13 Feb 2025 11:33:13 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Enhanced tooltip behavior improves positioning and visibility by
ensuring tooltips adjust dynamically to remain fully on-screen.
  
- **Tests**
- Added assertions to validate tooltip appearance and behavior in the
InputV2 widget tests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Community Reported issues reported by community members Good First Issue Good for newcomers Input Widget Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Production Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tooltip cut in fullscreen

2 participants