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

Settings #56

Merged
merged 15 commits into from
Jan 18, 2025
Merged

Settings #56

merged 15 commits into from
Jan 18, 2025

Conversation

charlottewiltshire0
Copy link
Collaborator

PR Content:

  • Added a sidebar component for settings with configurable items.
  • Introduced AppearanceForm component for appearance settings.
  • Improved layout and navigation for the settings page.
  • Integrated Radix UI packages to enhance UI components.
  • Implemented settings page for blog appearance and layout.
  • Added Label and Radio Group components for layout customization.
  • Included functionality for blog layout selection with state persistence.
  • Added a function to retrieve saved blog layout settings.
  • Conditionally rendered the article splash based on selected layout.
  • Refactored and split ArticleSplash component for better maintainability.

Copy link

cloudflare-workers-and-pages bot commented Jan 18, 2025

Deploying redot-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: aab4ff0
Status: ✅  Deploy successful!
Preview URL: https://827ee61c.redot-website.pages.dev
Branch Preview URL: https://feature-settings.redot-website.pages.dev

View logs

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added a comprehensive settings system with customizable blog layouts, featuring a new settings page with appearance customization options and persistent user preferences.

  • Added /actions/settings.ts for managing blog layout preferences via cookies with saveSettingsBlogLayout and getSettingsBlogLayout functions
  • Implemented AppearanceForm component with visual layout previews and radio group selection between "new" and "old" blog styles
  • Split ArticleSplash into ArticleSplashNew and ArticleSplashOld components with distinct layout styles
  • Added settings navigation with SettingsSidebar component and configurable sidebar items
  • Integrated Radix UI components (Label, RadioGroup) for enhanced form controls and accessibility

12 file(s) reviewed, 16 comment(s)
Edit PR Review Bot Settings | Greptile

};

export default function Layout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return <>{children}</>;
return (
<div className="hidden space-y-6 p-10 pb-16 md:block">
Copy link

Choose a reason for hiding this comment

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

logic: Hidden on mobile screens with no alternative mobile navigation provided

return (
<div className="hidden space-y-6 p-10 pb-16 md:block">
<div className="space-y-0.5">
<h2 className="text-2xl font-bold tracking-tight">Settings</h2>
Copy link

Choose a reason for hiding this comment

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

style: Consider adding aria-label to improve accessibility since this is the main settings heading

Comment on lines +14 to +17
<p className="text-sm text-muted-foreground">
Customize the look and feel of your experience by adjusting themes,
colors, and display preferences.
</p>
Copy link

Choose a reason for hiding this comment

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

logic: description text implies theme customization but AppearanceForm only shows blog layout options - either update text or expand functionality

</div>
<Separator className="my-6" />
<div className="flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0">
<aside className="-mx-4 lg:w-1/5">
Copy link

Choose a reason for hiding this comment

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

style: Negative margin (-mx-4) could cause horizontal scrolling issues on some viewports

actions/settings.ts Outdated Show resolved Hide resolved
Comment on lines 39 to 42
<div
className="[&:has([data-state=checked])>div]:border-primary"
onClick={() => handleLayoutChange("new")}
>
Copy link

Choose a reason for hiding this comment

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

style: redundant onClick handler since RadioGroup already handles value changes through onValueChange

components/settings/SettingsSidebar.tsx Outdated Show resolved Hide resolved
>
<RadioGroupItem value="new" className="sr-only" />
<div className="items-center rounded-md border-2 border-muted p-1 hover:border-accent">
<div className="space-y-2 rounded-sm bg-white p-2 shadow-sm">
Copy link

Choose a reason for hiding this comment

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

style: consider adding dark mode support for bg-white and shadow styling

constants/settingsSidebarItems.ts Outdated Show resolved Hide resolved
constants/settingsSidebarItems.ts Outdated Show resolved Hide resolved
@charlottewiltshire0 charlottewiltshire0 merged commit 5978b59 into master Jan 18, 2025
5 checks passed
@charlottewiltshire0 charlottewiltshire0 deleted the feature/settings branch January 18, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants