Skip to content

Conversation

@smokeyScraper
Copy link
Contributor

@smokeyScraper smokeyScraper commented Jun 15, 2025

Currently, a temporary workaround fix for the frontend.

Attached interactions

image

Summary by CodeRabbit

  • New Features

    • Added user authentication with login and logout functionality, including persistent authentication state.
    • Introduced a new login page and profile page.
    • Integrated toast notifications for user feedback.
  • Improvements

    • Enhanced contributor card with animated expansion and collapse of contribution details.
    • Added spacing improvements around contributor information for better readability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 15, 2025

Walkthrough

The changes introduce user authentication state management to the application, including login/logout handlers and conditional routing based on authentication status. The ContributorCard component's contributions section is now animated to collapse and expand smoothly, with improved spacing and minor formatting adjustments.

Changes

File(s) Change Summary
frontend/src/App.tsx Added authentication state, login/logout handlers, conditional routing, toast notifications, and new profile/login routes.
frontend/src/components/contributors/ContributorCard.tsx Made lastActive prop optional, typed contributions as number, animated contributions section height for expand/collapse, improved spacing around "Last Active" section, minor JSX formatting fixes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant LocalStorage
    participant LoginPage
    participant MainContent

    User->>App: Loads application
    App->>LocalStorage: Get isAuthenticated state
    App->>App: Set isAuthenticated state
    App->>User: If not authenticated, show LoginPage
    User->>LoginPage: Submit login
    LoginPage->>App: Call handleLogin
    App->>LocalStorage: Set isAuthenticated = true
    App->>App: Update isAuthenticated state
    App->>User: Show MainContent (Sidebar, Pages)
    User->>App: Click logout
    App->>LocalStorage: Set isAuthenticated = false
    App->>App: Reset state, show LoginPage
Loading

Poem

🐇
A hop, a skip, a login leap,
Now users’ secrets safe we keep.
With cards that fold and stretch with grace,
Last Active’s space finds its place.
Toasts that pop and routes that flow,
In bunny code, we watch it grow!
🥕✨


📜 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 1e1398b and 3f103ab.

📒 Files selected for processing (2)
  • frontend/src/App.tsx (2 hunks)
  • frontend/src/components/contributors/ContributorCard.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/src/components/contributors/ContributorCard.tsx
  • frontend/src/App.tsx
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, 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: 1

🧹 Nitpick comments (3)
frontend/src/App.tsx (2)

23-30: Persisted auth value should be parsed to a boolean

localStorage only stores strings, so relying on a hard-coded string compare is fragile (e.g. "TRUE" or "True" would be considered unauthenticated). Converting once via JSON or a simple cast is safer and self-documenting.

-const savedAuth = localStorage.getItem('isAuthenticated');
-if (savedAuth === 'true') {
-  setIsAuthenticated(true);
-}
+const savedAuth = localStorage.getItem('isAuthenticated');
+setIsAuthenticated(savedAuth === 'true');

31-41: Keep multiple tabs in sync with storage event

Login/logout updates are written to localStorage, but other open tabs/windows will keep showing stale UI. Add a storage listener that updates isAuthenticated accordingly so the session state stays consistent everywhere.

useEffect(() => {
  const syncAuth = (e: StorageEvent) => {
    if (e.key === 'isAuthenticated') {
      setIsAuthenticated(e.newValue === 'true');
    }
  };
  window.addEventListener('storage', syncAuth);
  return () => window.removeEventListener('storage', syncAuth);
}, []);
frontend/src/components/contributors/ContributorCard.tsx (1)

40-49: Minor: format large numbers for readability

If contributions can grow into the thousands, consider rendering with toLocaleString() so 1 234 is easier to scan than 1234.

-{contributions}
+{contributions.toLocaleString()}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3354281 and 114dc6f.

📒 Files selected for processing (2)
  • frontend/src/App.tsx (2 hunks)
  • frontend/src/components/contributors/ContributorCard.tsx (1 hunks)
🔇 Additional comments (2)
frontend/src/App.tsx (1)

68-72: 👍 Good call adding the Toaster provider

Placing Toaster once at the app root avoids duplicate mounts and ensures all nested components (e.g. ContributorCard) can trigger notifications.

frontend/src/components/contributors/ContributorCard.tsx (1)

67-70: Toast handler looks good

Stopping propagation prevents unintended collapse toggles and the success toast integrates nicely with the Toaster added in App.tsx.

@smokeyScraper
Copy link
Contributor Author

@chandansgowda, could you please review and merge?

@chandansgowda chandansgowda merged commit 4884600 into AOSSIE-Org:main Jun 18, 2025
1 check passed
@smokeyScraper smokeyScraper deleted the frontend-fix branch June 24, 2025 14:36
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.

2 participants