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

fix: mobile ui/ux responsive adjustments #216

Merged
merged 10 commits into from
May 14, 2024

Conversation

TopETH
Copy link
Member

@TopETH TopETH commented May 13, 2024

Close #184

Summary by CodeRabbit

  • Style Updates

    • Updated various container class names from "container" to "fluid-container" for improved layout flexibility.
    • Modified the SearchInput component's styling and placeholder text for better user experience.
    • Adjusted the UserMenu to display the correct username and email from the user object.
  • New Features

    • Enhanced ThreadAccordion component to conditionally remove the threadId query parameter.
    • Simplified height calculation in the Sidebar component for a more consistent layout.
  • Bug Fixes

    • Corrected a typo in a console log message from 'Thereads' to 'Threads'.
  • Refactor

    • Updated the ChatLayout structure to include additional wrapping <div> elements for better layout control.
    • Improved conditional rendering in the ThreadHeading component based on the isBot variable.
  • Chores

    • Adjusted CSS in globals.css for better styling consistency across components.

@TopETH TopETH self-assigned this May 13, 2024
Copy link

vercel bot commented May 13, 2024

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

Name Status Preview Comments Updated (UTC)
masterbots ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 3:15pm

Copy link
Contributor

coderabbitai bot commented May 13, 2024

Walkthrough

The recent updates aim to enhance the user experience by improving mobile UI/UX responsiveness in the masterbots.ai application. Changes include adjusting layouts for better display on various devices, refining styling for responsiveness, and updating component properties to ensure a seamless experience.

Changes

Files & Directories Change Summary
...(browse)/[category]/[threadId]/page.tsx,
...(browse)/page.tsx,
.../b/[id]/page.tsx,
.../u/[slug]/page.tsx
Changed class name from "container" to "fluid-container" for enhanced responsiveness.
.../c/layout.tsx Added a new <div> with class "flex flex-col grow" to optimize layout structure.
.../globals.css Adjusted .fluid-container class for improved width and padding, and refined other CSS styles.
.../c/sidebar/sidebar-responsive.tsx Enhanced styling attributes by adding lg:static absolute for a responsive sidebar.
.../shared/account-details.tsx Improved layout on medium screens by adding md:min-w-[700px] and md:w-full to the className.
.../shared/search-input.tsx Updated className and placeholder attributes in SearchInput component for better styling and clarity.
.../shared/thread-heading.tsx Conditionally applied 'mx-10' class based on isBot variable in ThreadHeading component.
.../shared/thread-accordion.tsx Added conditional check before removing threadId query parameter from URL during cleanup.
.../shared/thread-list-accordion.tsx Added imports and new state variables, functions, and hooks to handle thread ID changes asynchronously.
.../layout/user-menu.tsx Updated displayed username and email to use values from the user object.
.../routes/c/sidebar/index.tsx Simplified height calculation for container div from h-[calc(100%-113px)] to h-full.

Assessment against linked issues

Objective Addressed Explanation
Mobile UI/UX Responsive Adjustments (#184)

In fields of code where changes bloom,
A rabbit hops, dispelling gloom.
With fluid styles and layouts grand,
Responsive dreams at users' hand.
A better app, both sleek and bright,
Now shines with mobile-friendly light. 🌟🐇


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 786f8d8 and 7e0852a.
Files selected for processing (11)
  • apps/masterbots.ai/app/(browse)/[category]/[threadId]/page.tsx (1 hunks)
  • apps/masterbots.ai/app/(browse)/[category]/page.tsx (1 hunks)
  • apps/masterbots.ai/app/(browse)/page.tsx (1 hunks)
  • apps/masterbots.ai/app/b/[id]/page.tsx (1 hunks)
  • apps/masterbots.ai/app/c/layout.tsx (1 hunks)
  • apps/masterbots.ai/app/globals.css (5 hunks)
  • apps/masterbots.ai/app/u/[slug]/page.tsx (1 hunks)
  • apps/masterbots.ai/components/routes/c/sidebar/sidebar-responsive.tsx (1 hunks)
  • apps/masterbots.ai/components/shared/account-details.tsx (1 hunks)
  • apps/masterbots.ai/components/shared/search-input.tsx (1 hunks)
  • apps/masterbots.ai/components/shared/thread-heading.tsx (1 hunks)
Files skipped from review due to trivial changes (5)
  • apps/masterbots.ai/app/(browse)/[category]/[threadId]/page.tsx
  • apps/masterbots.ai/app/(browse)/[category]/page.tsx
  • apps/masterbots.ai/app/(browse)/page.tsx
  • apps/masterbots.ai/app/b/[id]/page.tsx
  • apps/masterbots.ai/app/u/[slug]/page.tsx
Additional comments not posted (6)
apps/masterbots.ai/app/c/layout.tsx (1)

27-28: Enhancements to layout flexibility and responsiveness.

The restructuring of the main content area with flex flex-col grow and the conditional rendering of FooterCT for smaller screens are well-aligned with the objectives to improve mobile responsiveness. Good use of responsive design patterns.

apps/masterbots.ai/components/shared/thread-heading.tsx (1)

58-58: Conditional styling based on thread type.

The use of conditional logic to apply the mx-10 class based on the isBot variable enhances visual distinction and aligns with the objectives to improve UI responsiveness and usability.

apps/masterbots.ai/components/shared/account-details.tsx (1)

23-23: Enhancements to layout consistency and responsiveness.

The addition of md:min-w-[700px] md:w-full to the class names ensures that the component maintains a consistent layout across different device sizes, aligning with the objectives to improve mobile responsiveness.

apps/masterbots.ai/components/shared/search-input.tsx (1)

59-63: Enhancements to input styling and placeholder text.

The updates to the class names and placeholder text of the Input component enhance the styling and make the placeholder text more relevant, aligning with the objectives to improve UI usability.

apps/masterbots.ai/app/globals.css (2)

49-51: Updated linear gradient definition enhances visual appeal.

The new linear gradient definition enhances the visual appeal of elements using this gradient, aligning with the objectives to improve the visual consistency of the UI.


106-108: Enhancements to the .fluid-container class improve responsiveness.

The updates to the .fluid-container class, including adjustments to the maximum width and padding, improve the responsiveness of the layout, aligning with the objectives to enhance mobile UI usability.

@@ -9,7 +9,8 @@ export async function ResponsiveSidebar() {
transition-all
-translate-x-full duration-500 ease-in-out
data-[state=open]:translate-x-0 data-[state=closed]:lg:translate-x-0
w-[300px] lg:w-[250px] xl:w-[300px]"
w-[300px] lg:w-[250px] xl:w-[300px]
lg:static absolute"
Copy link
Contributor

@coderabbitai coderabbitai bot May 13, 2024

Choose a reason for hiding this comment

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

Potential conflict in CSS positioning styles.

The combination of lg:static and absolute in the class attribute might cause layout issues, as these two positioning styles are generally not used together. Please verify the sidebar's behavior on different screen sizes to ensure it behaves as expected.

Copy link
Contributor

Choose a reason for hiding this comment

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

@TopETH -- Maybe it is not related, but can you check very small device screens? I noticed that when we have a device with less than 400px of width is making it look this way on Chat:

Screencast.from.05-13-2024.12.26.54.PM.webm

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link

github-actions bot commented May 13, 2024

⚡️ Lighthouse report

Page: https://masterbots-e8jq4ef2x-bitcash.vercel.app/
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1715700173303-62318.report.html

Category Score
🔴 Performance 32
🟢 Accessibility 96
🟠 Best practices 78
🟠 SEO 85
🔴 PWA 38

Page: https://masterbots-e8jq4ef2x-bitcash.vercel.app/b/moneybot
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1715700173858-4548.report.html

Category Score
🔴 Performance 47
🟢 Accessibility 95
🟠 Best practices 78
🟠 SEO 85
🔴 PWA 38

Page: https://masterbots-e8jq4ef2x-bitcash.vercel.app/u/slug-1
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1715700174214-47858.report.html

Category Score
🟠 Performance 51
🟢 Accessibility 94
🟠 Best practices 78
🟠 SEO 83
🔴 PWA 38

Page: https://masterbots-e8jq4ef2x-bitcash.vercel.app/p
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1715700174528-3589.report.html

Category Score
🟠 Performance 52
🟢 Accessibility 92
🟠 Best practices 78
🟠 SEO 76
🔴 PWA 38

Page: https://masterbots-e8jq4ef2x-bitcash.vercel.app/health
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1715700174923-53982.report.html

Category Score
🟠 Performance 52
🟠 Accessibility 59
🟠 Best practices 74
🔴 SEO 42
🔴 PWA 13

Page: https://masterbots-e8jq4ef2x-bitcash.vercel.app/health/a8103808-14a3-48ed-aa5a-9e490cfdcf0e
Report https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1715700175264-10585.report.html

Category Score
🟠 Performance 51
🟠 Accessibility 59
🟠 Best practices 74
🔴 SEO 42
🔴 PWA 13

Copy link
Contributor

@AndlerRL AndlerRL left a comment

Choose a reason for hiding this comment

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

Changes LGTM! I found while testing though that the sidebar and chat in general layout is not rendering good on small mobile devices. Can you check that comment? After that it will be ready to merge.

@TopETH TopETH requested a review from AndlerRL May 13, 2024 23:30
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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 7e0852a and b9b09a4.
Files selected for processing (2)
  • apps/masterbots.ai/components/shared/thread-accordion.tsx (1 hunks)
  • apps/masterbots.ai/components/shared/thread-list-accordion.tsx (3 hunks)
Additional comments not posted (4)
apps/masterbots.ai/components/shared/thread-list-accordion.tsx (3)

6-6: Ensure the imported utilities cn and sleep are used correctly.

Verify that the cn and sleep utilities are correctly implemented and used in the code.


16-16: Ensure the useSearchParams hook is used correctly.

Verify that the useSearchParams hook is correctly implemented and used to handle URL parameters.


34-45: Ensure the handleThreadIdChange function correctly handles the scrolling and accordion state.

Verify that the handleThreadIdChange function correctly handles the scrolling behavior and accordion state based on the threadId URL parameter.

apps/masterbots.ai/components/shared/thread-accordion.tsx (1)

66-69: Ensure the useEffect hook correctly updates and cleans up the URL parameters.

Verify that the useEffect hook correctly updates the URL with the threadId parameter and cleans it up on unmount to maintain a clean URL state.

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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between b9b09a4 and 849a49f.
Files selected for processing (1)
  • apps/masterbots.ai/lib/threads.ts (1 hunks)
Files not reviewed due to errors (1)
  • apps/masterbots.ai/lib/threads.ts (no review received)

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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 849a49f and 106a3de.
Files selected for processing (2)
  • apps/masterbots.ai/components/layout/user-menu.tsx (1 hunks)
  • apps/masterbots.ai/components/routes/c/sidebar/index.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • apps/masterbots.ai/components/routes/c/sidebar/index.tsx
Additional comments not posted (1)
apps/masterbots.ai/components/layout/user-menu.tsx (1)

49-50: Display of username and email in the dropdown menu looks good.

This change enhances the visibility of user information, aligning with the PR's objectives to improve UI/UX.

Comment on lines 41 to 44
<span className="ml-2 truncate-title w-[calc(100vw-325px)]">
{' '}
{user.username}
</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using a more responsive CSS approach for the username display width.

Using fixed pixel calculations can lead to issues on devices with different screen sizes. Consider using CSS flex properties or media queries to adjust the width dynamically based on the viewport size.

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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 106a3de and 056358c.
Files selected for processing (1)
  • apps/masterbots.ai/components/layout/user-menu.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/masterbots.ai/components/layout/user-menu.tsx

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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 056358c and 7341852.
Files selected for processing (1)
  • apps/masterbots.ai/components/layout/user-menu.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/masterbots.ai/components/layout/user-menu.tsx

Copy link
Contributor

@AndlerRL AndlerRL left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for taking care on the details. Merging!

@AndlerRL
Copy link
Contributor

@gaboesquivel -- This will be the last PR merged to alpha branch. After that I will block this branch to not receive more PRs after having the latest work on UI/UX to search branch.

To do the merge with the latest on search, what I will be doing is the plan shared the other day but instead, I am going to include the database seeds on the merge to search branch.

cc - @merivercap @TopETH @leandrogavidia @Bran18 @AnoukRImola

@AndlerRL AndlerRL merged commit 4961d57 into alpha May 14, 2024
4 checks passed
@AndlerRL AndlerRL deleted the topeth/mobile-ui/ux-responsive-adjustments branch May 14, 2024 23:15
@AndlerRL
Copy link
Contributor

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.

Mobile UI/UX Responsive Adjustments
2 participants