refactor: rename features to room-based directory structure
- Rename features/dashboard → features/front_hall - Update routes: /, /control-room, /parlor, /settings - Update navigation to 4 rooms (removed chat tab - will be omnipresent dock) - Add docs/UI_LAYOUT.md with wireframes and responsive specs - Update ARCHITECTURE.md and PLAN.md to reflect room structure Directory structure now mirrors "Rooms of the Estate" UI navigation: - front_hall/ (dashboard) - control_room/ (infrastructure - containers, stacks, etc.) - parlor/ (home automation) - library/ (future) - study/ (future, hidden) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -2,9 +2,9 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../version.g.dart';
|
||||
|
||||
/// Dashboard home page - overview of the homelab.
|
||||
class DashboardPage extends StatelessWidget {
|
||||
const DashboardPage({super.key});
|
||||
/// Front Hall - estate overview and quick access.
|
||||
class FrontHallPage extends StatelessWidget {
|
||||
const FrontHallPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -12,7 +12,7 @@ class DashboardPage extends StatelessWidget {
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Dashboard'),
|
||||
title: const Text('Front Hall'),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.refresh),
|
||||
+30
-27
@@ -3,17 +3,17 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
import '../shared/layouts/app_scaffold.dart';
|
||||
import '../features/dashboard/presentation/pages/dashboard_page.dart';
|
||||
import '../features/front_hall/presentation/pages/front_hall_page.dart';
|
||||
|
||||
part 'app_router.g.dart';
|
||||
|
||||
/// Route paths as constants.
|
||||
abstract class AppRoutes {
|
||||
static const dashboard = '/';
|
||||
static const chat = '/chat';
|
||||
static const containers = '/containers';
|
||||
static const containerDetail = '/containers/:id';
|
||||
static const housekeeping = '/housekeeping';
|
||||
static const frontHall = '/';
|
||||
static const controlRoom = '/control-room';
|
||||
static const containers = '/control-room/containers';
|
||||
static const containerDetail = '/control-room/containers/:id';
|
||||
static const parlor = '/parlor';
|
||||
static const settings = '/settings';
|
||||
}
|
||||
|
||||
@@ -21,43 +21,46 @@ abstract class AppRoutes {
|
||||
@riverpod
|
||||
GoRouter appRouter(AppRouterRef ref) {
|
||||
return GoRouter(
|
||||
initialLocation: AppRoutes.dashboard,
|
||||
initialLocation: AppRoutes.frontHall,
|
||||
debugLogDiagnostics: true,
|
||||
routes: [
|
||||
ShellRoute(
|
||||
builder: (context, state, child) => AppScaffold(child: child),
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: AppRoutes.dashboard,
|
||||
name: 'dashboard',
|
||||
builder: (context, state) => const DashboardPage(),
|
||||
path: AppRoutes.frontHall,
|
||||
name: 'frontHall',
|
||||
builder: (context, state) => const FrontHallPage(),
|
||||
),
|
||||
GoRoute(
|
||||
path: AppRoutes.chat,
|
||||
name: 'chat',
|
||||
builder: (context, state) => const _PlaceholderPage(title: 'Chat'),
|
||||
),
|
||||
GoRoute(
|
||||
path: AppRoutes.containers,
|
||||
name: 'containers',
|
||||
path: AppRoutes.controlRoom,
|
||||
name: 'controlRoom',
|
||||
builder: (context, state) =>
|
||||
const _PlaceholderPage(title: 'Containers'),
|
||||
const _PlaceholderPage(title: 'Control Room'),
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: ':id',
|
||||
name: 'containerDetail',
|
||||
builder: (context, state) {
|
||||
final id = state.pathParameters['id']!;
|
||||
return _PlaceholderPage(title: 'Container: $id');
|
||||
},
|
||||
path: 'containers',
|
||||
name: 'containers',
|
||||
builder: (context, state) =>
|
||||
const _PlaceholderPage(title: 'Containers'),
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: ':id',
|
||||
name: 'containerDetail',
|
||||
builder: (context, state) {
|
||||
final id = state.pathParameters['id']!;
|
||||
return _PlaceholderPage(title: 'Container: $id');
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
GoRoute(
|
||||
path: AppRoutes.housekeeping,
|
||||
name: 'housekeeping',
|
||||
path: AppRoutes.parlor,
|
||||
name: 'parlor',
|
||||
builder: (context, state) =>
|
||||
const _PlaceholderPage(title: 'Housekeeping'),
|
||||
const _PlaceholderPage(title: 'Parlor'),
|
||||
),
|
||||
GoRoute(
|
||||
path: AppRoutes.settings,
|
||||
|
||||
@@ -12,29 +12,27 @@ class AppScaffold extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: Replace AdaptiveScaffold with custom layout per UI_LAYOUT.md
|
||||
// - Header with room tabs (not bottom/rail nav)
|
||||
// - Chat dock on right side
|
||||
return AdaptiveScaffold(
|
||||
selectedIndex: _selectedIndex(context),
|
||||
onSelectedIndexChange: (index) => _onNavSelected(context, index),
|
||||
destinations: const [
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.dashboard_outlined),
|
||||
selectedIcon: Icon(Icons.dashboard),
|
||||
label: 'Dashboard',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.chat_outlined),
|
||||
selectedIcon: Icon(Icons.chat),
|
||||
label: 'Tatlock',
|
||||
icon: Icon(Icons.door_front_door_outlined),
|
||||
selectedIcon: Icon(Icons.door_front_door),
|
||||
label: 'Front Hall',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.dns_outlined),
|
||||
selectedIcon: Icon(Icons.dns),
|
||||
label: 'Containers',
|
||||
label: 'Control Room',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.home_outlined),
|
||||
selectedIcon: Icon(Icons.home),
|
||||
label: 'Housekeeping',
|
||||
icon: Icon(Icons.weekend_outlined),
|
||||
selectedIcon: Icon(Icons.weekend),
|
||||
label: 'Parlor',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.settings_outlined),
|
||||
@@ -51,21 +49,19 @@ class AppScaffold extends StatelessWidget {
|
||||
int _selectedIndex(BuildContext context) {
|
||||
final location = GoRouterState.of(context).matchedLocation;
|
||||
|
||||
if (location.startsWith(AppRoutes.containers)) return 2;
|
||||
if (location.startsWith(AppRoutes.chat)) return 1;
|
||||
if (location.startsWith(AppRoutes.housekeeping)) return 3;
|
||||
if (location.startsWith(AppRoutes.settings)) return 4;
|
||||
return 0; // Dashboard
|
||||
if (location.startsWith(AppRoutes.controlRoom)) return 1;
|
||||
if (location.startsWith(AppRoutes.parlor)) return 2;
|
||||
if (location.startsWith(AppRoutes.settings)) return 3;
|
||||
return 0; // Front Hall
|
||||
}
|
||||
|
||||
void _onNavSelected(BuildContext context, int index) {
|
||||
final route = switch (index) {
|
||||
0 => AppRoutes.dashboard,
|
||||
1 => AppRoutes.chat,
|
||||
2 => AppRoutes.containers,
|
||||
3 => AppRoutes.housekeeping,
|
||||
4 => AppRoutes.settings,
|
||||
_ => AppRoutes.dashboard,
|
||||
0 => AppRoutes.frontHall,
|
||||
1 => AppRoutes.controlRoom,
|
||||
2 => AppRoutes.parlor,
|
||||
3 => AppRoutes.settings,
|
||||
_ => AppRoutes.frontHall,
|
||||
};
|
||||
context.go(route);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user