Skip to content

Conversation

MananTank
Copy link
Member

@MananTank MananTank commented Jul 30, 2025


PR-Codex overview

This PR focuses on refactoring the codebase by removing the ScrollShadow component and updating various components and styles to enhance UI consistency and functionality. It also introduces new dependencies and modifies existing ones.

Detailed summary

  • Deleted ScrollShadow.tsx and ScrollShadow.module.css.
  • Updated color prop in NextTopLoader from hsl(var(--link-foreground)) to hsl(var(--foreground)).
  • Added sonner dependency to package.json.
  • Adjusted paths for ScrollShadow imports across multiple components.
  • Modified layout styles in page.tsx and other components.
  • Enhanced MarkdownRenderer to use UnderlineLink for links.
  • Introduced TextShimmer and Toaster components for improved UI feedback.
  • Updated Chat component to utilize ScrollShadow for message display.
  • Refactored ThirdwebIcon to use a prefix for IDs.
  • Improved styling consistency across various components.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Introduced a shimmering text effect for loading states.
    • Added a customizable toast notification system with theme support.
    • Added an underlined link component for consistent link styling.
  • Enhancements

    • Refined chat interface with improved empty state, message rendering, feedback handling, and visual distinction between user and AI messages.
    • Updated markdown rendering for improved link, heading, list, and paragraph styles.
    • Improved icon rendering with unique ID management and monochrome support.
    • Adjusted chat page and loader bar styling for better layout and color consistency.
  • Bug Fixes

    • Corrected React key usage in code snippet rendering to use unique platform IDs.
  • Refactor

    • Modularized chat message rendering and feedback logic.
    • Updated import paths for scroll shadow components across multiple files.
  • Chores

    • Updated dependencies to include the "sonner" package.
    • Cleaned up whitespace, formatting, and removed unused lint comments.
    • Adjusted Tailwind configuration for border radius and added shimmer animation.
  • Removals

    • Deleted legacy scroll shadow component and associated CSS.

Copy link

linear bot commented Jul 30, 2025

Copy link

vercel bot commented Jul 30, 2025

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 7:25pm
nebula ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 7:25pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 7:25pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 7:25pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
wallet-ui ⬜️ Skipped (Inspect) Jul 30, 2025 7:25pm

@vercel vercel bot temporarily deployed to Preview – wallet-ui July 30, 2025 18:55 Inactive
Copy link

changeset-bot bot commented Jul 30, 2025

⚠️ No Changeset found

Latest commit: 4b7b003

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Jul 30, 2025

Walkthrough

This change set refactors the assistant chat UI in the portal application to align with the dashboard's implementation, modularizes message rendering and feedback, introduces new UI components for toasts and shimmer effects, and updates related styling and configuration. It also adjusts import paths, removes a deprecated ScrollShadow component, and enhances markdown rendering and icon uniqueness.

Changes

Cohort / File(s) Change Summary
Chat UI Refactor & Modularization
apps/portal/src/components/AI/chat.tsx
Refactored chat component for improved structure and UI; modularized message rendering and feedback; added shimmer loading, icons, and asynchronous feedback handling.
New UI Components
apps/portal/src/components/ui/sonner.tsx, apps/portal/src/components/ui/text-shimmer.tsx, apps/portal/src/components/ui/underline-link.tsx
Added Toaster wrapper for Sonner, TextShimmer for shimmer effect, and UnderlineLink for styled links.
Thirdweb Icon Enhancement
apps/portal/src/icons/thirdweb.tsx
Consolidated SVG ID handling and added monochrome rendering option.
Markdown Renderer Update
apps/portal/src/components/markdown/MarkdownRenderer.tsx
Replaced Link with UnderlineLink, adjusted heading/list/paragraph styles, and made minor formatting changes.
ScrollShadow Removal & Import Updates
apps/portal/src/components/others/ScrollShadow/ScrollShadow.tsx, apps/portal/src/components/others/ScrollShadow/ScrollShadow.module.css, apps/portal/src/components/Document/Code.tsx, apps/portal/src/components/Document/Table.tsx, apps/portal/src/components/code/CodeBlockContainer.tsx, apps/portal/src/components/code/RenderCode.tsx, apps/portal/src/components/ui/table.tsx
Deleted ScrollShadow component and CSS; updated imports in related files to use new path or remove dependency.
Chat Page & Layout Styling
apps/portal/src/app/chat/page.tsx, apps/portal/src/app/layout.tsx
Updated container div classes for chat page and loader color in layout.
Document Components Formatting
apps/portal/src/components/Document/AuthMethodsTabs.tsx, apps/portal/src/components/Document/Breadcrumb.tsx
Cleaned up whitespace, formatting, and improved React key usage in tabs; removed a lint-disable comment in breadcrumb.
Tailwind Config Update
apps/portal/tailwind.config.ts
Moved borderRadius config to extend, added text-shimmer animation and keyframes.
Dependency Addition
apps/portal/package.json
Added "sonner" library to dependencies.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ChatComponent
    participant RenderMessage
    participant RenderAIResponse
    participant ReactQuery
    participant SonnerToaster

    User->>ChatComponent: Send message
    ChatComponent->>ChatComponent: Update messages list
    ChatComponent->>RenderMessage: Render each message
    RenderMessage->>RenderAIResponse: If assistant message
    RenderAIResponse->>ReactQuery: Send feedback (thumbs up/down)
    ReactQuery-->>RenderAIResponse: Success/Failure response
    RenderAIResponse->>SonnerToaster: Show toast notification
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
Refactor/enhance assistant chat UI in portal to match dashboard (BLD-26)
Modularize chat message rendering and feedback, improve UI/UX, and align with dashboard implementation (BLD-26)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Addition of "sonner" dependency (apps/portal/package.json) The addition supports toast notifications in the chat UI, which is part of the UI enhancement objective.
Tailwind config changes for borderRadius and text-shimmer animation (apps/portal/tailwind.config.ts) The text-shimmer animation is used in the new chat UI, so this is in scope. The borderRadius config move is a minor, related style update.
ScrollShadow component removal and import updates (apps/portal/src/components/others/ScrollShadow/ScrollShadow.tsx, .../ScrollShadow.module.css, etc.) The ScrollShadow component is not referenced in the chat UI and its removal is not directly related to the chat enhancement objective. However, if it was unused or replaced for consistency, this could be justified.
Monochrome option in ThirdwebIcon (apps/portal/src/icons/thirdweb.tsx) The monochrome option is likely to support the new chat UI's empty state, which uses the Thirdweb logo, thus in scope.

No clearly out-of-scope functional changes were identified. All changes appear relevant to the chat UI enhancement or necessary support components/styles.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

📜 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 4b7b003 and 0483776.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (19)
  • apps/portal/package.json (1 hunks)
  • apps/portal/src/app/chat/page.tsx (1 hunks)
  • apps/portal/src/app/layout.tsx (1 hunks)
  • apps/portal/src/components/AI/chat.tsx (7 hunks)
  • apps/portal/src/components/Document/AuthMethodsTabs.tsx (13 hunks)
  • apps/portal/src/components/Document/Breadcrumb.tsx (0 hunks)
  • apps/portal/src/components/Document/Code.tsx (1 hunks)
  • apps/portal/src/components/Document/Table.tsx (1 hunks)
  • apps/portal/src/components/code/CodeBlockContainer.tsx (1 hunks)
  • apps/portal/src/components/code/RenderCode.tsx (1 hunks)
  • apps/portal/src/components/markdown/MarkdownRenderer.tsx (7 hunks)
  • apps/portal/src/components/others/ScrollShadow/ScrollShadow.module.css (0 hunks)
  • apps/portal/src/components/others/ScrollShadow/ScrollShadow.tsx (0 hunks)
  • apps/portal/src/components/ui/sonner.tsx (1 hunks)
  • apps/portal/src/components/ui/table.tsx (1 hunks)
  • apps/portal/src/components/ui/text-shimmer.tsx (1 hunks)
  • apps/portal/src/components/ui/underline-link.tsx (1 hunks)
  • apps/portal/src/icons/thirdweb.tsx (4 hunks)
  • apps/portal/tailwind.config.ts (2 hunks)
💤 Files with no reviewable changes (3)
  • apps/portal/src/components/Document/Breadcrumb.tsx
  • apps/portal/src/components/others/ScrollShadow/ScrollShadow.module.css
  • apps/portal/src/components/others/ScrollShadow/ScrollShadow.tsx
✅ Files skipped from review due to trivial changes (5)
  • apps/portal/src/components/Document/Code.tsx
  • apps/portal/src/components/code/RenderCode.tsx
  • apps/portal/src/components/code/CodeBlockContainer.tsx
  • apps/portal/src/components/Document/AuthMethodsTabs.tsx
  • apps/portal/src/components/ui/text-shimmer.tsx
🚧 Files skipped from review as they are similar to previous changes (11)
  • apps/portal/package.json
  • apps/portal/src/app/layout.tsx
  • apps/portal/src/components/Document/Table.tsx
  • apps/portal/src/components/ui/table.tsx
  • apps/portal/src/components/ui/underline-link.tsx
  • apps/portal/src/components/ui/sonner.tsx
  • apps/portal/src/icons/thirdweb.tsx
  • apps/portal/src/app/chat/page.tsx
  • apps/portal/src/components/AI/chat.tsx
  • apps/portal/tailwind.config.ts
  • apps/portal/src/components/markdown/MarkdownRenderer.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Lint Packages
  • GitHub Check: Build Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 07-31-_bld-26_portal_ai_chat_ui_improvements

🪧 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 generate unit tests to generate unit tests for 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.

@github-actions github-actions bot added the Portal Involves changes to the Portal (docs) codebase. label Jul 30, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codecov bot commented Jul 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.42%. Comparing base (cd142f9) to head (0483776).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7764   +/-   ##
=======================================
  Coverage   56.42%   56.42%           
=======================================
  Files         904      904           
  Lines       58674    58674           
  Branches     4139     4139           
=======================================
  Hits        33108    33108           
  Misses      25461    25461           
  Partials      105      105           
Flag Coverage Δ
packages 56.42% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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: 2

🔭 Outside diff range comments (1)
apps/portal/src/app/chat/page.tsx (1)

6-6: Move QueryClient instantiation inside the component

Creating QueryClient at the module level creates a singleton instance that persists across all renders and potentially across different users in SSR scenarios. This can lead to cache pollution and unexpected behavior.

Move the QueryClient instantiation inside the component with proper memoization:

-const queryClient = new QueryClient();

 export default function ChatPage() {
+  const [queryClient] = useState(() => new QueryClient());
   return (
🧹 Nitpick comments (7)
apps/portal/src/app/chat/page.tsx (1)

11-11: Consider using rem units instead of px for better scalability

The change from rem-based height calculations to fixed pixel values reduces responsiveness and maintainability. The rem units scale with the user's font size preferences, making the UI more accessible.

Consider reverting to rem units or using CSS custom properties for these values:

-      <div className="flex h-[calc(100vh-65px)] flex-col overflow-hidden lg:h-[calc(100vh-102px)]">
+      <div className="flex h-[calc(100vh-4rem)] flex-col overflow-hidden lg:h-[calc(100vh-6.5rem)]">
apps/portal/src/components/AI/chat.tsx (2)

235-248: Consider extracting icon components to a separate file

The aiIcon and userIcon constants could be moved to a separate file for better organization and reusability across other chat-related components.

Create a new file apps/portal/src/components/AI/chat-icons.tsx:

import { UserIcon } from "lucide-react";
import { ThirdwebIcon } from "@/icons/thirdweb";

export const AIChatIcon = () => (
  <div className="rounded-full size-7 lg:size-9 border shrink-0 flex items-center justify-center bg-inverted">
    <ThirdwebIcon
      className="size-3 lg:size-4 text-inverted-foreground"
      isMonoChrome
    />
  </div>
);

export const UserChatIcon = () => (
  <div className="rounded-full size-7 lg:size-9 border bg-card shrink-0 flex items-center justify-center translate-y-1">
    <UserIcon className="size-3 lg:size-4 text-muted-foreground" />
  </div>
);

160-165: Remove array length check for scroll anchor

The condition messages.length > 0 is unnecessary since scrollIntoView will simply do nothing if the element doesn't need to scroll.

-    if (scrollAnchorRef.current && messages.length > 0) {
+    if (scrollAnchorRef.current) {
       scrollAnchorRef.current.scrollIntoView({
         behavior: "smooth",
       });
     }
apps/portal/src/components/code/RenderCode.tsx (1)

1-2: Unify alias usage for internal imports

Great to see the ScrollShadow path switched to the @ alias. For consistency (and to avoid brittle relative hops), consider doing the same for cn:

-import { cn } from "../../lib/utils";
+import { cn } from "@/lib/utils";

Keeps imports homogeneous and resilient to future folder moves.

apps/portal/src/components/Document/Code.tsx (1)

14-18: Minor path style inconsistency

ScrollShadow now uses the alias, but CopyButton still comes from a relative "../others/CopyButton". If that file also migrated to components/ui, consider adopting the alias for parity:

-import { CopyButton } from "../others/CopyButton";
+import { CopyButton } from "@/components/ui/CopyButton";

Purely organisational, no functional impact.

apps/portal/src/components/ui/table.tsx (1)

2-3: Alias switch looks good – but drop the inline comment

Path update is correct. The trailing comment (// Path within portal/components/ui) is noise in production code; remove unless it adds real value.

apps/portal/src/components/code/CodeBlockContainer.tsx (1)

4-8: Consistent aliasing & barrel import

Nice alias usage. As with the other files, consider importing Button from the central UI barrel (@/components/ui/button) instead of the relative "../ui/button" to keep import style uniform.

Copy link
Contributor

github-actions bot commented Jul 30, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.15 KB (0%) 1.3 s (0%) 396 ms (+42.96% 🔺) 1.7 s
thirdweb (cjs) 353.02 KB (0%) 7.1 s (0%) 2.2 s (+5.87% 🔺) 9.3 s
thirdweb (minimal + tree-shaking) 5.7 KB (0%) 114 ms (0%) 65 ms (+360.6% 🔺) 179 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 124 ms (+1585.04% 🔺) 134 ms
thirdweb/react (minimal + tree-shaking) 19.3 KB (0%) 386 ms (0%) 97 ms (+160.49% 🔺) 483 ms

Copy link
Contributor

graphite-app bot commented Jul 30, 2025

Merge activity

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR primarily focuses on enhancing the UI components and improving the styling, particularly around the `ScrollShadow` component. It also introduces new animations and adjusts various layouts for better responsiveness.

### Detailed summary
- Removed `ScrollShadow.tsx` and its CSS module.
- Updated color in `NextTopLoader` from `--link-foreground` to `--foreground`.
- Added `sonner` package for toasts.
- Integrated `ScrollShadow` in multiple components.
- Adjusted layout styles in `page.tsx` and `MarkdownRenderer.tsx`.
- Enhanced `Chat` component with `ScrollShadow` for better scrolling behavior.
- Introduced `TextShimmer` and `UnderlineLink` components.
- Improved styling and responsiveness in various components.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->

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

## Summary by CodeRabbit

* **New Features**
  * Introduced a shimmering text effect for loading states.
  * Added a customizable toast notification system with theme support.
  * Added an underlined link component for consistent link styling.

* **Enhancements**
  * Refined chat interface with improved empty state, message rendering, feedback handling, and visual distinction between user and AI messages.
  * Updated markdown rendering for improved link, heading, list, and paragraph styles.
  * Improved icon rendering with unique ID management and monochrome support.
  * Adjusted chat page and loader bar styling for better layout and color consistency.

* **Bug Fixes**
  * Corrected React key usage in code snippet rendering to use unique platform IDs.

* **Refactor**
  * Modularized chat message rendering and feedback logic.
  * Updated import paths for scroll shadow components across multiple files.

* **Chores**
  * Updated dependencies to include the "sonner" package.
  * Cleaned up whitespace, formatting, and removed unused lint comments.
  * Adjusted Tailwind configuration for border radius and added shimmer animation.

* **Removals**
  * Deleted legacy scroll shadow component and associated CSS.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the 07-31-_bld-26_portal_ai_chat_ui_improvements branch from 4b7b003 to 0483776 Compare July 30, 2025 19:18
@vercel vercel bot temporarily deployed to Preview – wallet-ui July 30, 2025 19:18 Inactive
@graphite-app graphite-app bot merged commit 0483776 into main Jul 30, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 07-31-_bld-26_portal_ai_chat_ui_improvements branch July 30, 2025 19:26
@vercel vercel bot temporarily deployed to Production – wallet-ui July 30, 2025 19:26 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Portal Involves changes to the Portal (docs) codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants