feat: Phase 2 feature flags — hide/show sidebar entries per client

- usePhase2Features.js hook: manages localStorage-based feature flags for all 8 Phase 2
  sidebar entries (notes, expenses, contacts, customers, tabs, waste, kds, schedule)
  All default to enabled=true. setFeatureEnabled() writes to localStorage and dispatches
  a 'phase2features' event so all subscribers re-render immediately without page reload
- Phase2FeaturesTab.jsx: new Settings tab 'Λειτουργίες' — toggle each Phase 2 page on/off
  with master 'Ενεργοποίηση όλων' / 'Απενεργοποίηση όλων' buttons
  Note shown: changes are localStorage-only, instant, no reload needed, no data deleted
- SettingsPage.jsx: adds 'Λειτουργίες' and reinstates 'Developer' tab (was missing import)
- Sidebar.jsx: subscribes to phase2features + storage events; filters ALL_NAV to remove
  disabled Phase 2 entries; each phase2 item has a phase2 id that isFeatureEnabled() checks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 04:01:54 +03:00
co-authored by Claude Sonnet 4.6
parent 49f19ed65c
commit 0fc027eb5f
4 changed files with 177 additions and 9 deletions
@@ -4,6 +4,8 @@ import ColoursTab from './tabs/ColoursTab'
import OperationTab from './tabs/OperationTab'
import PrintFontsTab from './tabs/PrintFontsTab'
import SecurityTab from './tabs/SecurityTab'
import DevelopmentTab from './tabs/DevelopmentTab'
import Phase2FeaturesTab from './tabs/Phase2FeaturesTab'
import { TabGroup } from '../../ui/Tabs'
const TABS = [
@@ -12,6 +14,8 @@ const TABS = [
{ id: 'operation', label: 'Λειτουργία' },
{ id: 'colours', label: 'Εμφάνιση' },
{ id: 'print-fonts', label: 'Εκτύπωση' },
{ id: 'features', label: 'Λειτουργίες' },
{ id: 'development', label: 'Developer' },
]
export default function SettingsPage() {
@@ -26,6 +30,8 @@ export default function SettingsPage() {
{activeTab === 'operation' && <OperationTab />}
{activeTab === 'colours' && <ColoursTab />}
{activeTab === 'print-fonts' && <PrintFontsTab />}
{activeTab === 'features' && <Phase2FeaturesTab />}
{activeTab === 'development' && <DevelopmentTab />}
</div>
</div>
)