Skip to content

Conversation

@m4dm4rtig4n
Copy link
Contributor

Summary

  • Added submenu with kWh and Euro tabs to the consumption page
  • Restructured routes: /consumption redirects to /consumption_kwh
  • Created ConsumptionEuro page as a coming-soon placeholder
  • Updated navigation, page header, and PDL filtering logic for consumption pages

Test Plan

  • Navigate to /consumption_kwh to see the new kWh tab (active)
  • Click the Euro tab to view the coming-soon page
  • Verify the menu highlights "Consommation" when on either tab
  • Test PDL selector filters correctly for consumption pages

🤖 Generated with Claude Code

Implemented a new submenu structure for the consumption page with two tabs: kWh and Euro. The /consumption route now redirects to /consumption_kwh. ConsumptionEuro is a placeholder for future implementation. Added ConsumptionTabs component and updated routing, navigation, and page header logic to support the new consumption structure.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 1, 2025 00:08
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 restructures the consumption page by introducing a tabbed submenu interface with two sections: kWh (active) and Euro (placeholder). The changes improve navigation and prepare for future cost-based consumption analysis.

Key Changes

  • Renamed the existing Consumption page to ConsumptionKwh and moved it to a dedicated directory structure
  • Added routing redirect from /consumption to /consumption_kwh for backward compatibility
  • Created ConsumptionEuro placeholder page with "coming soon" messaging
  • Updated navigation to highlight "Consommation" menu item when on either consumption tab
  • Updated PDL filtering logic to work with both consumption routes

Reviewed changes

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

Show a summary per file
File Description
apps/web/src/App.tsx Added consumption routes with redirect from /consumption to /consumption_kwh, and new route for /consumption_euro
apps/web/src/components/ConsumptionTabs.tsx New tab navigation component for switching between kWh and Euro views
apps/web/src/components/Layout.tsx Updated menu logic to highlight Consommation for all consumption pages, updated navigation path to /consumption_kwh
apps/web/src/components/PageHeader.tsx Added Euro icon import, updated page config for consumption routes, added consumption page detection logic
apps/web/src/pages/ConsumptionKwh/index.tsx Moved and renamed from Consumption page with complete feature set for kWh visualization
apps/web/src/pages/ConsumptionKwh/types/consumption.types.ts Type definitions for consumption data structures
apps/web/src/pages/ConsumptionKwh/hooks/* Custom hooks for data fetching, calculations, and state management
apps/web/src/pages/ConsumptionKwh/components/* UI components for consumption visualization (charts, tables, modals, buttons)
apps/web/src/pages/ConsumptionEuro/index.tsx Placeholder page with coming-soon message and planned features list
apps/web/src/pages/Landing.tsx Added authentication state management, removed animations, added account distinction information (unrelated to main PR purpose)

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

import { MonthlyHcHp } from './components/MonthlyHcHp'
import { PowerPeaks } from './components/PowerPeaks'

// Renamed from Consumption to ConsumptionKwh
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment mentions "Renamed from Consumption to ConsumptionKwh" but the actual component functionality should remain unchanged. This comment is informative but may be misleading as it's not just a rename - the entire page was restructured with new routing.

Suggested change
// Renamed from Consumption to ConsumptionKwh
// Page restructured and routing updated; previously named 'Consumption', now 'ConsumptionKwh'

Copilot uses AI. Check for mistakes.
Comment on lines +235 to 241
const [isReady, setIsReady] = useState(false)

// Attendre que le composant soit monté pour éviter le clignotement
useEffect(() => {
setIsReady(true)
}, [])

Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The Landing page changes appear unrelated to the consumption submenu feature described in the PR. These changes (adding authentication state checks with isReady and isLoading, removing animations, and adding account distinction information) should ideally be in a separate commit or PR to maintain clear separation of concerns.

Suggested change
const [isReady, setIsReady] = useState(false)
// Attendre que le composant soit monté pour éviter le clignotement
useEffect(() => {
setIsReady(true)
}, [])

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,67 @@
import { useState, useEffect } from 'react'
import { Euro, Database, ArrowRight, AlertCircle } from 'lucide-react'
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

Unused import Database.

Suggested change
import { Euro, Database, ArrowRight, AlertCircle } from 'lucide-react'
import { Euro, ArrowRight, AlertCircle } from 'lucide-react'

Copilot uses AI. Check for mistakes.
import { usePdlStore } from '@/stores/pdlStore'

export default function ConsumptionEuro() {
const { selectedPdl: selectedPDL } = usePdlStore()
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

Unused variable selectedPDL.

Suggested change
const { selectedPdl: selectedPDL } = usePdlStore()
usePdlStore()

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +21
const [isDarkMode, setIsDarkMode] = useState(false)

// Detect dark mode
useEffect(() => {
const checkDarkMode = () => {
setIsDarkMode(document.documentElement.classList.contains('dark'))
}
checkDarkMode()
const observer = new MutationObserver(checkDarkMode)
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['class']
})
return () => observer.disconnect()
}, [])
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

Unused variable isDarkMode.

Suggested change
const [isDarkMode, setIsDarkMode] = useState(false)
// Detect dark mode
useEffect(() => {
const checkDarkMode = () => {
setIsDarkMode(document.documentElement.classList.contains('dark'))
}
checkDarkMode()
const observer = new MutationObserver(checkDarkMode)
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['class']
})
return () => observer.disconnect()
}, [])

Copilot uses AI. Check for mistakes.
@m4dm4rtig4n m4dm4rtig4n merged commit 2ff2a09 into main Dec 1, 2025
10 of 11 checks passed
@m4dm4rtig4n m4dm4rtig4n deleted the gitbutler/workspace branch December 18, 2025 07:59
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