Skip to content
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

More robust edge detection #2710

Merged
merged 3 commits into from
Oct 9, 2024
Merged

More robust edge detection #2710

merged 3 commits into from
Oct 9, 2024

Conversation

pablonyx
Copy link
Contributor

@pablonyx pablonyx commented Oct 7, 2024

Description

Previously, ellipsis at the very edge of being necessary would not quite be caught by our edge detection
Fixes https://linear.app/danswer/issue/DAN-778/banner-width-bug

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Accepted Risk

[Any know risks or failure modes to point out to reviewers]

Related Issue(s)

[If applicable, link to the issue(s) this PR addresses]

Checklist:

  • All of the automated tests pass
  • All PR comments are addressed and marked resolved
  • If there are migrations, they have been rebased to latest main
  • If there are new dependencies, they are added to the requirements
  • If there are new environment variables, they are added to all of the deployment methods
  • If there are new APIs that don't require auth, they are added to PUBLIC_ENDPOINT_SPECS
  • Docker images build and basic functionalities work
  • Author has done a final read through of the PR right before merge

Copy link

vercel bot commented Oct 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 7, 2024 8:45pm

@pablonyx pablonyx marked this pull request as ready for review October 7, 2024 20:38
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR enhances the ChatBanner component's overflow detection mechanism, improving its ability to handle edge cases where content is on the verge of overflowing.

  • Implemented robust overflow checking using getBoundingClientRect() for both width and height in web/src/app/chat/ChatBanner.tsx
  • Adjusted layout with improved flex and visibility settings for better content overflow handling
  • Added useLayoutEffect hook to perform overflow checks and update state accordingly
  • Introduced separate visible and invisible content divs for more accurate overflow comparison

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

<div className="absolute top-0 left-0 invisible flex justify-center max-w-full">
<div
ref={fullContentRef}
className={`overflow-hidden invisible${settings.enterpriseSettings.two_lines_for_chat_header ? "line-clamp-2" : "line-clamp-1"} text-center max-w-full`}
Copy link

Choose a reason for hiding this comment

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

syntax: Missing space after 'invisible' in className

@rkuo-danswer rkuo-danswer added this pull request to the merge queue Oct 9, 2024
Merged via the queue into main with commit f83e680 Oct 9, 2024
7 checks passed
@pablonyx pablonyx deleted the banner_width branch October 17, 2024 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants