Skip to content

Conversation

@mfts
Copy link
Owner

@mfts mfts commented May 21, 2025

Summary by CodeRabbit

  • New Features
    • Added an optional light navigation bar with the brand's logo at the top of the access form for supported teams. This feature can be enabled based on team configuration and displays the brand logo with a custom background color.
  • Style
    • Adjusted access form padding to accommodate the new navigation bar when displayed.

@vercel
Copy link

vercel bot commented May 21, 2025

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

Name Status Preview Comments Updated (UTC)
papermark ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 6:12pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 21, 2025

Walkthrough

A new optional boolean prop, logoOnAccessForm, has been introduced and propagated across several components and pages related to document and dataroom views. When enabled, this flag causes the AccessForm component to display a navigation bar with the brand’s logo. The flag is set conditionally based on the teamId in data-fetching functions.

Changes

File(s) Change Summary
components/view/access-form/index.tsx Added logoOnAccessForm prop to display a navigation bar with the brand logo above the form when enabled. Adjusted form container padding to accommodate the nav bar.
components/view/dataroom/dataroom-document-view.tsx
components/view/document-view.tsx
components/view/dataroom/dataroom-view.tsx
Added and propagated the logoOnAccessForm prop to these components, forwarding it to the AccessForm where relevant. No other logic changes.
pages/view/[linkId]/d/[documentId].tsx
pages/view/domains/[domain]/[slug]/d/[documentId].tsx
Added logoOnAccessForm to the props and component signatures. Set the flag conditionally in getStaticProps based on teamId. Propagated the flag to child components.
pages/view/[linkId]/index.tsx
pages/view/domains/[domain]/[slug]/index.tsx
Added logoOnAccessForm to the props and component signatures. In getStaticProps, set the flag conditionally for both document and dataroom links based on teamId. Passed the flag to DocumentView and DataroomView components.

Sequence Diagram(s)

sequenceDiagram
    participant Page
    participant DataFetcher
    participant ViewComponent
    participant AccessForm

    Page->>DataFetcher: getStaticProps()
    DataFetcher->>Page: returns props (logoOnAccessForm set by teamId)
    Page->>ViewComponent: Renders with logoOnAccessForm prop
    ViewComponent->>AccessForm: Passes logoOnAccessForm
    AccessForm->>AccessForm: If logoOnAccessForm & brand.logo, render nav bar with logo
Loading

Poem

🐰
A logo now shines above the form,
With colors bright, it’s far from norm.
A flag is set, the brand appears,
Bringing smiles and bunny cheers!
Hop along, enjoy the view—
The access page feels fresh and new!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm warn config production Use --omit=dev instead.
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-05-21T18_10_48_994Z-debug-0.log

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.

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 (4)
components/view/access-form/index.tsx (2)

106-106: Consider using optional chaining for more concise code.

The static analysis tool suggests using optional chaining here for better readability.

- if (field.required && !data.customFields?.[field.identifier!]) {
+ if (field.required && !data.customFields?.[field.identifier ?? '']) {
🧰 Tools
🪛 Biome (1.9.4)

[error] 106-106: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


119-121: Consider enhancing logo accessibility.

For better accessibility, consider using a more specific alt text that includes the brand name when available.

  <img
    src={brand.logo as string}
-   alt="Brand Logo"
+   alt={`${brand.name || 'Brand'} Logo`}
    className="h-16 w-auto object-contain"
  />
pages/view/domains/[domain]/[slug]/d/[documentId].tsx (1)

271-271: Consider more maintainable team ID management

The feature is enabled based on a hardcoded team ID check. While this works for now, consider moving team-specific configurations to a centralized configuration file or environment variables for better maintainability as more teams adopt this feature.

-        logoOnAccessForm: teamId === "cm7nlkrhm0000qgh0nvyrrywr",
+        logoOnAccessForm: TEAMS_WITH_LOGO_ON_ACCESS_FORM.includes(teamId),

Where TEAMS_WITH_LOGO_ON_ACCESS_FORM would be imported from a central configuration file.

pages/view/[linkId]/index.tsx (1)

150-152: Consider extracting team ID logic

The same team ID conditions are duplicated in both the document and dataroom branches. Consider extracting this logic into a helper function or a constant to improve maintainability.

+ const TEAMS_WITH_LOGO_ON_ACCESS_FORM = ["cm7nlkrhm0000qgh0nvyrrywr", "clup33by90000oewh4rfvp2eg"];
+ const hasLogoOnAccessForm = (teamId) => TEAMS_WITH_LOGO_ON_ACCESS_FORM.includes(teamId);

  // Then in DOCUMENT_LINK branch
- logoOnAccessForm:
-   teamId === "cm7nlkrhm0000qgh0nvyrrywr" ||
-   teamId === "clup33by90000oewh4rfvp2eg",
+ logoOnAccessForm: hasLogoOnAccessForm(teamId),

  // And in DATAROOM_LINK branch
- logoOnAccessForm:
-   teamId === "cm7nlkrhm0000qgh0nvyrrywr" ||
-   teamId === "clup33by90000oewh4rfvp2eg",
+ logoOnAccessForm: hasLogoOnAccessForm(teamId),

Also applies to: 222-224

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3743df5 and 716db82.

📒 Files selected for processing (8)
  • components/view/access-form/index.tsx (4 hunks)
  • components/view/dataroom/dataroom-document-view.tsx (3 hunks)
  • components/view/dataroom/dataroom-view.tsx (4 hunks)
  • components/view/document-view.tsx (3 hunks)
  • pages/view/[linkId]/d/[documentId].tsx (5 hunks)
  • pages/view/[linkId]/index.tsx (6 hunks)
  • pages/view/domains/[domain]/[slug]/d/[documentId].tsx (5 hunks)
  • pages/view/domains/[domain]/[slug]/index.tsx (6 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
components/view/access-form/index.tsx

[error] 106-106: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (19)
components/view/document-view.tsx (1)

65-65: Properly integrated new logoOnAccessForm feature!

The logoOnAccessForm parameter and type definition have been correctly added to the DocumentView component and appropriately passed down to the AccessForm component when displaying the access form for protected documents.

Also applies to: 87-87, 267-267

components/view/dataroom/dataroom-document-view.tsx (1)

78-78: Consistent implementation of logoOnAccessForm prop!

The logoOnAccessForm parameter and type definition have been correctly added to the DataroomDocumentView component and properly passed to the AccessForm component, maintaining consistency with other view components.

Also applies to: 98-98, 311-311

components/view/dataroom/dataroom-view.tsx (2)

58-58: Properly integrated logoOnAccessForm prop!

The logoOnAccessForm parameter and type definition have been correctly added to the DataroomView component and appropriately passed to the AccessForm component.

Also applies to: 74-74, 252-252


282-288: Improved readability of viewerEmail prop!

The formatting change for the viewerEmail prop improves code readability while maintaining the same functionality.

components/view/access-form/index.tsx (1)

45-45: Well-implemented logo navigation bar!

The implementation of the optional logo navigation bar is clean and effective:

  • Only displays when both logoOnAccessForm is true and a brand logo exists
  • Uses brand colors with sensible defaults
  • Properly sizes the logo with fixed height and auto width
  • Adjusts container padding to accommodate the new element

Also applies to: 63-63, 103-103, 109-125, 127-127

pages/view/domains/[domain]/[slug]/d/[documentId].tsx (3)

46-46: Type definition update for logoOnAccessForm

The new logoOnAccessForm boolean property has been correctly added to the DataroomDocumentProps type definition, maintaining proper type safety for this feature.


57-57: Parameter propagation for logoOnAccessForm

The logoOnAccessForm parameter is correctly added to the component function signature, consistent with the type definition update.


174-174: Prop forwarding to child component

The logoOnAccessForm prop is properly passed down to the DataroomDocumentView component, enabling the logo display functionality.

pages/view/[linkId]/d/[documentId].tsx (4)

46-46: Type definition update for logoOnAccessForm

The logoOnAccessForm boolean property has been correctly added to the DataroomDocumentProps type definition, maintaining proper type safety.


57-57: Parameter propagation for logoOnAccessForm

The logoOnAccessForm parameter is correctly added to the component function signature, maintaining consistency with the updated type definition.


170-170: Prop forwarding to child component

The logoOnAccessForm prop is properly passed down to the DataroomDocumentView component.


263-263:

Details

❌ Incorrect review comment

Team ID inconsistency across files

This file only enables the logo feature for one team ID (cm7nlkrhm0000qgh0nvyrrywr), while other files in this PR enable it for two team IDs. Ensure this difference is intentional.

Consider checking if these team-based conditions should be consistent across files:


🏁 Script executed:

#!/bin/bash
# Search for logoOnAccessForm conditions across files to verify consistency
rg "logoOnAccessForm: teamId === " --type=tsx

Length of output: 75


Let’s search all .tsx files for any logoOnAccessForm occurrences using a glob-based ripgrep search (falling back to grep if needed):

#!/bin/bash
echo "=== ripgrep results ==="
rg -n "logoOnAccessForm" -g "*.tsx" || echo "rg search failed or no matches"

echo
echo "=== grep fallback ==="
grep -R -n "logoOnAccessForm" . --include="*.tsx" || echo "grep search failed or no matches"

Let’s retry searching across all .tsx files without relying on built-in filetype definitions:


🏁 Script executed:

#!/bin/bash
echo "=== ripgrep results ==="
rg -n "logoOnAccessForm" -g "*.tsx" || echo "No matches found with rg"

echo
echo "=== grep fallback results ==="
grep -R -n "logoOnAccessForm" . --include="*.tsx" || echo "No matches found with grep"

Length of output: 5351


Ignore team-ID consistency concern
I searched all .tsx files and found the only teamId === "cm7nlkrhm0000qgh0nvyrrywr" checks gating logoOnAccessForm in:

  • pages/view/[linkId]/d/[documentId].tsx (line 263)
  • pages/view/domains/[domain]/[slug]/d/[documentId].tsx (line 271)

All other pages and components consume the shared logoOnAccessForm boolean and do not repeat any team-ID checks. There are no instances enabling the logo for a second team. You can safely disregard the original comment.

Likely an incorrect or invalid review comment.

pages/view/domains/[domain]/[slug]/index.tsx (4)

194-196: Feature flag consistency across link types

Good job maintaining consistency by applying the same team ID conditions for both document and dataroom link types within this file.


221-221: Parameter and type updates for ViewPage

The logoOnAccessForm parameter and type definition are correctly added to the ViewPage component.

Also applies to: 241-241


365-365: Consistent prop forwarding to view components

The logoOnAccessForm prop is properly passed down to both the DocumentView and DataroomView components, ensuring consistent behavior across different view types.

Also applies to: 446-446


122-124:

Details

❓ Verification inconclusive

Multiple team IDs for logoOnAccessForm

The feature is enabled for two specific teams here, which differs from some other files in this PR. Ensure this difference is intentional based on your business requirements.


🏁 Script executed:

#!/bin/bash
# Show all team IDs that get the logoOnAccessForm feature across the codebase
rg "logoOnAccessForm:.*teamId" --type=tsx -A 3 -B 1

Length of output: 81


🏁 Script executed:

#!/bin/bash
# Find all occurrences of logoOnAccessForm in the codebase without filtering by file type
rg "logoOnAccessForm" -n -A 3 -B 1

Length of output: 11588


Verify inconsistent logoOnAccessForm team IDs

Across the codebase, the logoOnAccessForm flag is enabled for two teams in some pages but only one team in others. Please confirm this discrepancy is intentional:

• pages/view/domains/[domain]/[slug]/index.tsx
logoOnAccessForm enabled for:
- cm7nlkrhm0000qgh0nvyrrywr
- clup33by90000oewh4rfvp2eg

• pages/view/[linkId]/index.tsx
logoOnAccessForm enabled for:
- cm7nlkrhm0000qgh0nvyrrywr
- clup33by90000oewh4rfvp2eg

• pages/view/domains/[domain]/[slug]/d/[documentId].tsx
logoOnAccessForm enabled only for: cm7nlkrhm0000qgh0nvyrrywr

• pages/view/[linkId]/d/[documentId].tsx
logoOnAccessForm enabled only for: cm7nlkrhm0000qgh0nvyrrywr

Ensure the difference in team coverage aligns with your business requirements.

pages/view/[linkId]/index.tsx (3)

58-58: Interface update for ViewPageProps

The logoOnAccessForm boolean property has been correctly added to the ViewPageProps interface.


250-250: Parameter update for ViewPage

The logoOnAccessForm parameter is correctly added to the component function signature.


382-382: Consistent prop forwarding

The logoOnAccessForm prop is properly passed down to both the DocumentView and DataroomView components, ensuring consistent behavior across different view types.

Also applies to: 462-462

@mfts mfts merged commit d9592c3 into main May 21, 2025
4 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2025
@mfts mfts deleted the marc/pm-323-add-brand-logo-to-access-screen branch August 19, 2025 07:58
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