Repository navigation
fix: truncation of titles to fix UI breaks - #1162
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@rhit-daviscl is attempting to deploy a commit to the Documenso Team Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe recent changes improve the user interface of the application by enhancing text handling across various components. Key updates include adding truncation classes to elements to manage overflow text, modifying the structure of email displays for better layout, and improving the contextual information provided to users. These adjustments aim to create a cleaner and more user-friendly experience. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant Header
participant DocumentView
participant NameField
participant SignatureField
User->>Header: Navigate to document
Header-->>App: Determine selected team
App->>DocumentView: Render document with title
DocumentView->>NameField: Display recipient's name
DocumentView->>SignatureField: Display recipient's email
Note right of SignatureField: Email is now in a <div> for layout
Assessment against linked issues
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
|
Hey there, it looks like you haven't accepted our contributor license agreement yet. In order for us to accept your pull request we ask that you please fill out the CLA: https://documen.so/cla |
There was a problem hiding this comment.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- apps/web/src/app/(dashboard)/documents/[id]/document-page-view-recent-activity.tsx (1 hunks)
- apps/web/src/app/(dashboard)/documents/[id]/document-page-view.tsx (1 hunks)
- apps/web/src/app/(dashboard)/documents/[id]/logs/document-logs-page-view.tsx (1 hunks)
- apps/web/src/app/(signing)/sign/[token]/name-field.tsx (1 hunks)
- apps/web/src/app/(signing)/sign/[token]/signature-field.tsx (1 hunks)
- apps/web/src/app/(signing)/sign/[token]/signing-page-view.tsx (2 hunks)
- apps/web/src/components/(dashboard)/layout/header.tsx (3 hunks)
- packages/ui/primitives/avatar.tsx (1 hunks)
- packages/ui/primitives/dialog.tsx (1 hunks)
Files skipped from review due to trivial changes (2)
- apps/web/src/app/(dashboard)/documents/[id]/logs/document-logs-page-view.tsx
- apps/web/src/app/(signing)/sign/[token]/signature-field.tsx
Additional comments not posted (10)
packages/ui/primitives/avatar.tsx (1)
81-83: LGTM! Verify the truncation behavior.The addition of the
truncateclass to thedivelement wrapping the text sections is correct. Ensure that the truncation behavior works as expected and does not introduce any layout issues.To verify:
- Check if the text is truncated correctly when it exceeds the available width.
- Ensure that the hover effect displays the full text as intended.
apps/web/src/components/(dashboard)/layout/header.tsx (4)
45-46: LGTM! Verify theusePathnamehook usage.The addition of the
usePathnamehook is correct. Ensure that it correctly retrieves the current pathname.To verify:
- Check if the
pathnamevariable correctly reflects the current URL path.- Ensure that the
usePathnamehook is used appropriately and does not introduce any issues.
47-53: LGTM! Verify theisPathTeamUrlfunction.The
isPathTeamUrlfunction correctly checks if the current pathname corresponds to a team URL format. Ensure that it works as intended.To verify:
- Check if the function correctly identifies team URLs.
- Ensure that the logic inside the function is robust and handles edge cases.
55-55: LGTM! Verify theselectedTeamvariable.The
selectedTeamvariable is correctly set based on the current pathname. Ensure that it correctly identifies the selected team.To verify:
- Check if the
selectedTeamvariable correctly reflects the selected team based on the URL.- Ensure that the
findmethod works as intended and handles cases where no team is selected.
76-79: LGTM! Verify thetitleattribute update.The
titleattribute is correctly updated based on theselectedTeamvariable. Ensure that it correctly displays the team name or user name.To verify:
- Check if the
titleattribute correctly reflects the selected team name or user name.- Ensure that the
titleattribute updates dynamically based on theselectedTeamvariable.packages/ui/primitives/dialog.tsx (1)
116-116: LGTM! Verify the truncation behavior.The addition of the
truncateclass to theclassNameproperty of theDialogTitlecomponent is correct. Ensure that the truncation behavior works as expected and does not introduce any layout issues.To verify:
- Check if the text is truncated correctly when it exceeds the available width.
- Ensure that the hover effect displays the full text as intended.
apps/web/src/app/(signing)/sign/[token]/signing-page-view.tsx (2)
53-53: LGTM!The title rendering is simplified and the
truncateclass is correctly applied.
64-69: LGTM!The user invitation message is clear and the conditional rendering for the recipient's role is correctly implemented.
apps/web/src/app/(signing)/sign/[token]/name-field.tsx (1)
181-181: Verify the impact of changing<span>to<div>.Changing from
<span>to<div>may affect the layout due to the difference between inline and block elements. Ensure that this change does not disrupt the UI.apps/web/src/app/(dashboard)/documents/[id]/document-page-view.tsx (1)
113-113: LGTM! The addition of thetruncateclass is appropriate.The
truncateclass will help in handling text overflow and prevent UI breaks caused by lengthy titles.
| <p | ||
| className="text-muted-foreground dark:text-muted-foreground/70 flex-auto truncate py-0.5 text-xs leading-5" | ||
| title={`${formatDocumentAuditLogAction(auditLog, userId).prefix} ${ | ||
| formatDocumentAuditLogAction(auditLog, userId).description | ||
| }`} | ||
| > |
There was a problem hiding this comment.
Ensure consistent usage of formatDocumentAuditLogAction.
The title attribute and the paragraph content both use formatDocumentAuditLogAction. Consider storing the result in a variable to avoid redundant calls.
const formattedAction = formatDocumentAuditLogAction(auditLog, userId);
<p
className="text-muted-foreground dark:text-muted-foreground/70 flex-auto truncate py-0.5 text-xs leading-5"
title={`${formattedAction.prefix} ${formattedAction.description}`}
>
<span className="text-foreground font-medium">
{formattedAction.prefix}
</span>{' '}
{formattedAction.description}
</p>| <p | ||
| className="text-muted-foreground truncate" | ||
| title={document.User.name ? document.User.name : ''} | ||
| > | ||
| {document.User.name} |
There was a problem hiding this comment.
Ensure proper handling of null or undefined values.
The conditional rendering of document.User.name should handle cases where document.User might be null or undefined.
- title={document.User.name ? document.User.name : ''}
+ title={document.User?.name ?? ''}Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <p | |
| className="text-muted-foreground truncate" | |
| title={document.User.name ? document.User.name : ''} | |
| > | |
| {document.User.name} | |
| <p | |
| className="text-muted-foreground truncate" | |
| title={document.User?.name ?? ''} | |
| > | |
| {document.User.name} |
|
Thanks for the effort! 😄 |
Description
This pull request introduces the addition of CSS properties which will allow for the display of long titles in most sections not already implemented. This enhancement allows users to see their full screen without breaking the UI for having a long input.
Related Issue
Fixes #950
Changes Made
Testing Performed
Checklist
Additional Notes
No additional notes.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation