FTCHD / frametrain

Infinitely growing Frames builder with integrated Farcaster Hub APIs and Revenue Sharing.
https://frametra.in
25 stars 29 forks source link

fix: homepage layout and semantic tags #176

Open thesanjeevsharma opened 2 days ago

thesanjeevsharma commented 2 days ago

Observed a few issues with the UI:

  1. On desktop, the template grid doesn't stretch properly.
  2. On phone, the layout doesn't look good.
  3. Improper use of html tags, for example, too many h1 (this will impact SEO).

Current production:

Desktop


Phone


I've fixed the above mentioned issues.

Two minor UI tweaks I did, which IMO make the website look even better:

  1. Pushed the All Template -> button to the right, makes the page balanced.
  2. Changed some font sizes and colors for different screen sizes.

Fixed versions:

Desktop


Tablet


Phone

Summary by CodeRabbit

coderabbitai[bot] commented 2 days ago

Walkthrough

The pull request includes updates to the layout and presentation of the home page, modifications to the header component's styling, and adjustments to the button properties in the TemplateCard component. Changes involve altering HTML heading levels for better semantic structure, adjusting the layout from flexbox to grid, and making the button width responsive. The header link's font size has been modified for smaller screens, while the loading state management remains unchanged in the TemplateCard component.

Changes

Files Change Summary
app/(app)/page.tsx Modified outermost <div> class, updated heading elements from <h1> to <h2>, adjusted conditional rendering for recent frames, and changed layout from flexbox to grid.
components/foundation/Header.tsx Altered font size class for the NextLink element for smaller screens, maintaining the logic for AccountButton.
components/home/TemplateCard.tsx Changed button width from fixed to flexible, setting a maximum width for medium screens; loading state management remains unchanged.

📜 Recent review details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
📥 Commits Files that changed from the base of the PR and between e5ddde45b6085c6cc4e996799d9825a327995f20 and 1b0f9928d5a429a84b748a4cfb1386e7e1ada48d.
📒 Files selected for processing (3) * app/(app)/page.tsx (4 hunks) * components/foundation/Header.tsx (1 hunks) * components/home/TemplateCard.tsx (1 hunks)
🔇 Additional comments (9)
components/foundation/Header.tsx (1)
`11-11`: **Improved responsive design for the header link** The modification to the NextLink's className enhances the responsive design of the header. By using `text-4xl` as the default and `md:text-5xl` for medium and larger screens, the header link now adapts better to different device sizes. This change directly addresses the PR objective of improving the mobile layout while maintaining the desktop appearance.
components/home/TemplateCard.tsx (1)
`40-42`: **LGTM! Responsive design improvement.** The changes to the button's className improve the responsiveness of the TemplateCard component: - The width is now fully responsive (`w-full`), allowing it to adapt to its container. - A maximum width (`md:max-w-[380px]`) has been set for medium-sized screens, which should help maintain a consistent layout. These modifications align with the PR objectives of improving the layout on both desktop and mobile devices. To ensure these changes achieve the desired layout across all screen sizes, please run the following verification steps: 1. Test the layout on various screen sizes (mobile, tablet, desktop) to confirm proper responsiveness. 2. Verify that the cards align correctly within the grid on the homepage. 3. Check that the maximum width of 380px is applied correctly on medium-sized screens. If possible, provide screenshots of the layout at different breakpoints to demonstrate the improvements.
app/(app)/page.tsx (7)
`30-30`: **Improved layout container for better responsiveness** The change from `p-5` to `lg:container` is a good improvement. This Tailwind utility class will provide a responsive container that adapts to different screen sizes, addressing the issue of the template grid not stretching properly on desktop. It also helps in creating a more consistent layout across different devices. --- `34-36`: **Improved spacing and semantic structure in the Frames section** Great improvements in this section: 1. The added padding and margin classes (`p-4 space-y-8 w-full mb-6`) enhance the visual spacing and overall layout. 2. Changing the "Frames" heading from `

` to `

` improves the semantic structure of the page, which is beneficial for SEO as mentioned in the PR objectives. These changes contribute to a better user experience and address the concerns about improper use of HTML tags. --- `58-61`: **Improved semantic structure for the "No frames" message** Good change in converting the "No frames" message from an `

` to a `

` tag. This improves the semantic structure of the page, as this content is more appropriately represented as a paragraph rather than a heading. This change contributes to better HTML semantics without altering the informational content of the message. --- `65-66`: **Enhanced welcome message structure and responsiveness** Excellent improvements to the welcome message for non-signed-in users: 1. Using `

` for "Welcome to Frametrain!" correctly identifies it as the primary heading of the page for non-signed-in users. 2. The subtitle is now a `

` tag, which is semantically correct. 3. Responsive text sizes (`md:text-4xl` for the title and `md:text-lg` for the subtitle) ensure better readability across different screen sizes. These changes enhance both the semantic structure and the visual presentation of the welcome message, contributing to better SEO and user experience. --- `73-74`: **Improved layout and semantic structure in the Templates section** Excellent changes in the Templates section: 1. The flex layout adjustment (`flex flex-row w-full items-center justify-between`) improves the alignment of the section title and the "All templates" link, enhancing the visual balance. 2. Changing the "Templates" heading from `

` to `

` improves the semantic structure, addressing the SEO concerns mentioned in the PR objectives. 3. The new grid layout for template cards (`grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 md:gap-6`) is a significant improvement. This should address the layout issues on both desktop and mobile devices, providing a more responsive and visually appealing arrangement of template cards. These changes effectively address the layout concerns mentioned in the PR objectives and contribute to a better overall user experience across different device sizes. Also applies to: 86-86 --- `107-109`: **Improved semantic structure for the bottom link** Good change in converting the bottom link text from an `

` to a `

` tag. This improves the semantic structure of the page, as link text is more appropriately represented as a paragraph rather than a heading. This change contributes to better HTML semantics without altering the functionality or visual appearance of the link. --- Line range hint `30-109`: **Overall improvements align well with PR objectives** The changes made in this file effectively address the issues mentioned in the PR objectives: 1. Layout improvements: - The use of `lg:container` and the new grid layout for templates should resolve the stretching issues on desktop and improve the appearance on mobile devices. - Adjusted flex layouts and spacing contribute to a more balanced and visually appealing design. 2. Semantic structure: - Proper use of heading levels (h1, h2) and paragraph tags improves the overall semantic structure of the page, addressing the SEO concerns. 3. Responsiveness: - The grid layout for template cards and responsive text sizes ensure a better user experience across different screen sizes. These changes collectively enhance the homepage's layout, semantic structure, and responsiveness, aligning perfectly with the stated PR objectives. The improvements should result in a more visually appealing and SEO-friendly homepage.

--- 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 - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `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 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 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.` - `@coderabbitai help me debug CodeRabbit configuration file.` 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 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
thesanjeevsharma commented 2 days ago

Similar issues exist on /templates page. If this looks fine, I can create another PR later for templates page.