Skip to content

Conversation

@pan93412
Copy link
Member

@pan93412 pan93412 commented Nov 3, 2025

  • feat(challenges): implement GatedAIAssistant
  • feat: allow controlling interface with environment variable

@pan93412 pan93412 self-assigned this Nov 3, 2025
@linear
Copy link

linear bot commented Nov 3, 2025

@vercel
Copy link
Contributor

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
dbplay-app Ready Ready Preview Comment Nov 3, 2025 6:39pm

@pan93412 pan93412 force-pushed the pan93412/dbp-133-考試系統應該要隱藏和考試無關的內容 branch from 8098b47 to 8b1379b Compare November 3, 2025 18:38
@pan93412 pan93412 requested a review from Copilot November 3, 2025 18:39
Copy link
Contributor

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 introduces a feature flag system to conditionally enable/disable the statistics page and social platform integrations. The implementation allows administrators to control these features via environment variables.

Key changes:

  • Created a centralized feature flag system with a requireExplicitlyDisabled helper function
  • Made statistics page and social platform links conditionally visible in the navigation based on feature flags
  • Added authorization gating for the AI assistant feature

Reviewed Changes

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

Show a summary per file
File Description
lib/features.ts New file defining feature flags for statistics page and social platform
components/app-navbar.tsx Updated navigation to conditionally render statistics and social platform items
app/login/page.tsx Conditionally renders social platform links based on feature flag
app/(app)/statistics/page.tsx Added feature flag check with user-friendly error message when disabled
app/(app)/page.tsx Redirects to challenges page when statistics feature is disabled
app/(app)/challenges/[id]/page.tsx Replaced direct AIAssistant with GatedAIAssistant wrapper
app/(app)/challenges/[id]/_components/gated-ai-assistant.tsx New server component that gates AI assistant access with authorization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pan93412 pan93412 merged commit 0805d2e into main Nov 3, 2025
10 checks passed
@pan93412 pan93412 deleted the pan93412/dbp-133-考試系統應該要隱藏和考試無關的內容 branch November 3, 2025 18:41
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