feat(setup): first-run gate, hub-first preview, honest wording — setup before the app
Some checks are pending
Security / Security check (push) Waiting to run
Some checks are pending
Security / Security check (push) Waiting to run
Stefan's live findings, all four addressed at the root:
- 'In 3 Fragen loslegen' read like ad copy → the entry is now plainly
'Einrichtung starten' / 'Start setup'.
- The setup button sat permanently on the Welcome page of a running
app ('setup after the app runs is backwards' — reported twice). A
fresh install now starts INSIDE the setup: SetupGateScreen hosts
the wizard embedded as the page (new embedded/onFinished modes on
GuidedSetupDialog), with an explicit 'Später einrichten' skip.
Welcome loses the setup button entirely and stays a calm intro.
- Re-running the setup later lives in Settings → General ('Run setup
again…'), the single post-first-run home.
- 'You must grant access first and only then see what will be done':
the preview used to spawn the chain CLI, whose first run could pop
the macOS permission prompt BEFORE the plan was ever shown. The
preview now calls the new PlanSetup RPC over the live hub
connection (no subprocess, nothing granted); the CLI remains only
a fallback when no hub is reachable — and applying stays the
explicit, separate step.
Widget tests: gate hosts the wizard + skip/cancel leave it; CLI-path
tests drive the fallback through the new hub-preview test seam.
Suite 76 green, analyze clean.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
06f023aada
commit
065939be74
13 changed files with 377 additions and 62 deletions
81
lib/pages/setup_gate.dart
Normal file
81
lib/pages/setup_gate.dart
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
// First-run gate. On a fresh install (no ~/.chain/config.yaml, no
|
||||
// setup-plan.yaml) the app opens INTO the setup instead of showing
|
||||
// the full shell with a wizard dialog on top — setup before the
|
||||
// app, not after. The guided-setup wizard renders embedded as the
|
||||
// page content; "Später einrichten" skips into the app for this
|
||||
// run (the gate returns on the next launch as long as nothing is
|
||||
// configured — the wizard IS the onboarding until then).
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../theme/tokens.dart';
|
||||
import '../widgets/guided_setup_dialog.dart';
|
||||
|
||||
class SetupGateScreen extends StatelessWidget {
|
||||
/// Called when the operator finishes the setup or skips — the
|
||||
/// app swaps this screen for the normal shell.
|
||||
final VoidCallback onDone;
|
||||
|
||||
const SetupGateScreen({super.key, required this.onDone});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final l = AppLocalizations.of(context)!;
|
||||
return Scaffold(
|
||||
backgroundColor: theme.scaffoldBackgroundColor,
|
||||
body: Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(ChainSpace.xl),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 560),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Ch∆In Studio',
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
color: theme.colorScheme.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: ChainSpace.xs),
|
||||
Text(
|
||||
l.setupGateIntro,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: ChainSpace.lg),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(ChainSpace.xl),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surfaceContainerLow,
|
||||
borderRadius: BorderRadius.circular(ChainRadius.md),
|
||||
border: Border.all(
|
||||
color: theme.colorScheme.outlineVariant,
|
||||
),
|
||||
),
|
||||
child: GuidedSetupDialog(
|
||||
embedded: true,
|
||||
onFinished: onDone,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: ChainSpace.sm),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: TextButton(
|
||||
onPressed: onDone,
|
||||
child: Text(l.setupGateSkip),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue