Skip to content

Conversation

@joshydavid
Copy link
Owner

Description

What type of PR is this?

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ‘¨πŸ»β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Desktop and mobile screenshots/recordings

Signed-off-by: joshydavid <cxang.2022@scis.smu.edu.sg>
Signed-off-by: joshydavid <cxang.2022@scis.smu.edu.sg>
Signed-off-by: joshydavid <cxang.2022@scis.smu.edu.sg>
@joshydavid joshydavid requested a review from Copilot August 1, 2025 09:22
@vercel
Copy link

vercel bot commented Aug 1, 2025

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
brew-intelligence βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Aug 1, 2025 9:32am

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a feature toggle for controlling the visibility of a notification banner in the header component. The toggle is implemented using an environment variable that allows the banner to be conditionally displayed.

  • Added environment variable-based feature toggle for notification banner
  • Wrapped existing banner component with conditional rendering logic
  • Updated environment sample file with the new configuration option

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
frontend/app/components/Header/index.tsx Added conditional rendering logic for banner using environment variable
frontend/.env.sample Added new environment variable for notification banner toggle

export default function Header() {
const pathname = usePathname();
const { authData } = useAuthStatus();
const showBanner = process.env.NEXT_PUBLIC_NOTIFICATION_BANNER === "true";
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

Consider using a more robust configuration approach. Direct environment variable access makes testing difficult and creates tight coupling. Consider creating a configuration utility function or using a configuration context that can be easily mocked in tests.

Copilot uses AI. Check for mistakes.
Comment on lines 19 to 20
title="⚠️&nbsp; Notice: AWS resources have been spun down. The backend is
currently not running."
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

The hardcoded banner message creates tight coupling between the feature toggle and specific content. Consider making the banner message configurable through environment variables or a separate configuration, allowing the same toggle mechanism to be reused for different notifications.

Suggested change
title="⚠️&nbsp; Notice: AWS resources have been spun down. The backend is
currently not running."
title={
process.env.NEXT_PUBLIC_BANNER_MESSAGE ||
"⚠️&nbsp; Notice: AWS resources have been spun down. The backend is currently not running."
}

Copilot uses AI. Check for mistakes.
Signed-off-by: joshydavid <cxang.2022@scis.smu.edu.sg>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 1, 2025

@joshydavid joshydavid merged commit 8927362 into master Aug 1, 2025
6 checks passed
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.

1 participant