refactor: rename internal Fai* design system + fai_ helpers to chain
Some checks failed
Security / Security check (push) Failing after 2s
Some checks failed
Security / Security check (push) Failing after 2s
The Studio design system, widgets and helpers carried a Fai* / fai_ prefix (FaiSpace, FaiColors, FaiTheme, FaiLog, 17 fai_*.dart files, the faiBinary* l10n keys). Studio is the Ch∆In product, so rename them to Chain* / chain_ — carefully preserving English fail/failure/failed. Also fix stale references: the 'fai' binary in l10n strings -> 'chain', FAI_* env vars (FAI_BIN/DATA_DIR/MODULES_DIR/TODAY/BOOTSTRAP_TOKEN) -> CHAIN_*, fai_platform -> fai_chain, fai_hub -> chain_hub. Vendor security-hook tooling (FAI_BANNED_TERMS_FILE) + the .fai bundle ext left. flutter analyze + test: clean (20 passed). Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
68d23ab7dd
commit
891acd2ba2
52 changed files with 1225 additions and 1225 deletions
|
|
@ -224,7 +224,7 @@ class _ApprovalsPageState extends State<ApprovalsPage>
|
|||
tooltip: AppLocalizations.of(context)!.approvalsReloadTooltip,
|
||||
onPressed: _refresh,
|
||||
),
|
||||
const SizedBox(width: FaiSpace.sm),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
],
|
||||
),
|
||||
body: TabBarView(
|
||||
|
|
@ -288,7 +288,7 @@ class _PendingList extends StatelessWidget {
|
|||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
if (snapshot.hasError) {
|
||||
return FaiEmptyState(
|
||||
return ChainEmptyState(
|
||||
icon: Icons.cloud_off_outlined,
|
||||
iconColor: theme.colorScheme.error,
|
||||
title: l.hubUnreachable,
|
||||
|
|
@ -301,7 +301,7 @@ class _PendingList extends StatelessWidget {
|
|||
}
|
||||
final pending = snapshot.data ?? [];
|
||||
if (pending.isEmpty) {
|
||||
return FaiEmptyState(
|
||||
return ChainEmptyState(
|
||||
icon: Icons.task_alt_outlined,
|
||||
title: l.approvalsInboxZero,
|
||||
hint: l.approvalsInboxHint,
|
||||
|
|
@ -314,15 +314,15 @@ class _PendingList extends StatelessWidget {
|
|||
children: [
|
||||
ListView.separated(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
FaiSpace.xl,
|
||||
FaiSpace.xl,
|
||||
FaiSpace.xl,
|
||||
ChainSpace.xl,
|
||||
ChainSpace.xl,
|
||||
ChainSpace.xl,
|
||||
// Keep the last card clear of the floating
|
||||
// batch action bar.
|
||||
selected.isEmpty ? FaiSpace.xl : 96.0,
|
||||
selected.isEmpty ? ChainSpace.xl : 96.0,
|
||||
),
|
||||
itemCount: pending.length,
|
||||
separatorBuilder: (_, _) => const SizedBox(height: FaiSpace.md),
|
||||
separatorBuilder: (_, _) => const SizedBox(height: ChainSpace.md),
|
||||
itemBuilder: (context, i) {
|
||||
final a = pending[i];
|
||||
final isSelected = selectedIds.contains(a.id);
|
||||
|
|
@ -337,9 +337,9 @@ class _PendingList extends StatelessWidget {
|
|||
),
|
||||
if (selected.isNotEmpty)
|
||||
Positioned(
|
||||
left: FaiSpace.xl,
|
||||
right: FaiSpace.xl,
|
||||
bottom: FaiSpace.lg,
|
||||
left: ChainSpace.xl,
|
||||
right: ChainSpace.xl,
|
||||
bottom: ChainSpace.lg,
|
||||
child: _BatchActionBar(
|
||||
selectedCount: selected.length,
|
||||
totalCount: pending.length,
|
||||
|
|
@ -387,15 +387,15 @@ class _BatchActionBar extends StatelessWidget {
|
|||
final l = AppLocalizations.of(context)!;
|
||||
return Material(
|
||||
elevation: 4,
|
||||
borderRadius: BorderRadius.circular(FaiRadius.md),
|
||||
borderRadius: BorderRadius.circular(ChainRadius.md),
|
||||
color: theme.colorScheme.surfaceContainerHigh,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: FaiSpace.lg,
|
||||
vertical: FaiSpace.md,
|
||||
horizontal: ChainSpace.lg,
|
||||
vertical: ChainSpace.md,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(FaiRadius.md),
|
||||
borderRadius: BorderRadius.circular(ChainRadius.md),
|
||||
border: Border.all(color: theme.colorScheme.outlineVariant),
|
||||
),
|
||||
child: Row(
|
||||
|
|
@ -405,14 +405,14 @@ class _BatchActionBar extends StatelessWidget {
|
|||
size: 18,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
const SizedBox(width: FaiSpace.sm),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
Text(
|
||||
l.approvalsBatchSelected(selectedCount),
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: FaiSpace.md),
|
||||
const SizedBox(width: ChainSpace.md),
|
||||
if (selectedCount < totalCount)
|
||||
TextButton(
|
||||
onPressed: inFlight ? null : onSelectAll,
|
||||
|
|
@ -434,7 +434,7 @@ class _BatchActionBar extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: FaiSpace.sm),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
FilledButton.icon(
|
||||
onPressed: inFlight ? null : onApprove,
|
||||
icon: inFlight
|
||||
|
|
@ -470,7 +470,7 @@ class _HistoryList extends StatelessWidget {
|
|||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
if (snapshot.hasError) {
|
||||
return FaiEmptyState(
|
||||
return ChainEmptyState(
|
||||
icon: Icons.cloud_off_outlined,
|
||||
iconColor: theme.colorScheme.error,
|
||||
title: l.hubUnreachable,
|
||||
|
|
@ -483,16 +483,16 @@ class _HistoryList extends StatelessWidget {
|
|||
}
|
||||
final decided = snapshot.data ?? [];
|
||||
if (decided.isEmpty) {
|
||||
return FaiEmptyState(
|
||||
return ChainEmptyState(
|
||||
icon: Icons.history,
|
||||
title: l.approvalsHistoryEmpty,
|
||||
hint: l.approvalsHistoryEmptyHint,
|
||||
);
|
||||
}
|
||||
return ListView.separated(
|
||||
padding: const EdgeInsets.all(FaiSpace.xl),
|
||||
padding: const EdgeInsets.all(ChainSpace.xl),
|
||||
itemCount: decided.length,
|
||||
separatorBuilder: (_, _) => const SizedBox(height: FaiSpace.xs),
|
||||
separatorBuilder: (_, _) => const SizedBox(height: ChainSpace.xs),
|
||||
itemBuilder: (context, i) {
|
||||
final a = decided[i];
|
||||
return _HistoryRow(record: a);
|
||||
|
|
@ -522,7 +522,7 @@ class _ApprovalCard extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final l = AppLocalizations.of(context)!;
|
||||
return FaiCard(
|
||||
return ChainCard(
|
||||
accentTop: true,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
|
@ -534,13 +534,13 @@ class _ApprovalCard extends StatelessWidget {
|
|||
onChanged: (_) => onToggleSelected(),
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
const SizedBox(width: FaiSpace.xs),
|
||||
FaiPill(
|
||||
const SizedBox(width: ChainSpace.xs),
|
||||
ChainPill(
|
||||
label: l.approvalsPillPending,
|
||||
tone: FaiPillTone.warning,
|
||||
tone: ChainPillTone.warning,
|
||||
icon: Icons.pending_outlined,
|
||||
),
|
||||
const SizedBox(width: FaiSpace.sm),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${approval.flowName} › ${approval.stepId}',
|
||||
|
|
@ -550,17 +550,17 @@ class _ApprovalCard extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
if (approval.expiresAt != null)
|
||||
FaiPill(
|
||||
ChainPill(
|
||||
label: _expiresInLabel(context, approval.expiresAt!),
|
||||
tone: FaiPillTone.neutral,
|
||||
tone: ChainPillTone.neutral,
|
||||
icon: Icons.schedule,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: FaiSpace.lg),
|
||||
const SizedBox(height: ChainSpace.lg),
|
||||
Text(approval.prompt, style: theme.textTheme.bodyLarge),
|
||||
if (approval.payloadPreview != null) ...[
|
||||
const SizedBox(height: FaiSpace.md),
|
||||
const SizedBox(height: ChainSpace.md),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 4),
|
||||
child: Text(
|
||||
|
|
@ -574,27 +574,27 @@ class _ApprovalCard extends StatelessWidget {
|
|||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(FaiSpace.md),
|
||||
padding: const EdgeInsets.all(ChainSpace.md),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surfaceContainerHigh,
|
||||
borderRadius: BorderRadius.circular(FaiRadius.sm),
|
||||
borderRadius: BorderRadius.circular(ChainRadius.sm),
|
||||
border: Border.all(color: theme.colorScheme.outlineVariant),
|
||||
),
|
||||
child: SelectableText(
|
||||
_prettyPreview(approval.payloadPreview!),
|
||||
style: FaiTheme.mono(
|
||||
style: ChainTheme.mono(
|
||||
size: 11,
|
||||
color: theme.colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: FaiSpace.lg),
|
||||
const SizedBox(height: ChainSpace.lg),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
approval.id,
|
||||
style: FaiTheme.mono(
|
||||
style: ChainTheme.mono(
|
||||
size: 10,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
|
|
@ -611,7 +611,7 @@ class _ApprovalCard extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: FaiSpace.sm),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
FilledButton.icon(
|
||||
onPressed: onApprove,
|
||||
icon: const Icon(Icons.check, size: 16),
|
||||
|
|
@ -663,21 +663,21 @@ class _HistoryRow extends StatelessWidget {
|
|||
context: context,
|
||||
builder: (_) => _HistoryDialog(record: record),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(FaiRadius.sm),
|
||||
borderRadius: BorderRadius.circular(ChainRadius.sm),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: FaiSpace.sm,
|
||||
vertical: FaiSpace.sm,
|
||||
horizontal: ChainSpace.sm,
|
||||
vertical: ChainSpace.sm,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
FaiPill(label: label, tone: tone, icon: icon),
|
||||
const SizedBox(width: FaiSpace.md),
|
||||
ChainPill(label: label, tone: tone, icon: icon),
|
||||
const SizedBox(width: ChainSpace.md),
|
||||
SizedBox(
|
||||
width: 150,
|
||||
child: Text(
|
||||
timeStr,
|
||||
style: FaiTheme.mono(
|
||||
style: ChainTheme.mono(
|
||||
size: 11,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
|
|
@ -693,7 +693,7 @@ class _HistoryRow extends StatelessWidget {
|
|||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: FaiSpace.md),
|
||||
const SizedBox(width: ChainSpace.md),
|
||||
if (record.decidedBy.isNotEmpty)
|
||||
Text(
|
||||
record.decidedBy,
|
||||
|
|
@ -707,24 +707,24 @@ class _HistoryRow extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
|
||||
static (FaiPillTone, IconData, String) _statusPresentation(
|
||||
static (ChainPillTone, IconData, String) _statusPresentation(
|
||||
BuildContext context,
|
||||
String status,
|
||||
) {
|
||||
final l = AppLocalizations.of(context)!;
|
||||
switch (status) {
|
||||
case 'approved':
|
||||
return (FaiPillTone.success, Icons.check, l.approvalsPillApproved);
|
||||
return (ChainPillTone.success, Icons.check, l.approvalsPillApproved);
|
||||
case 'rejected':
|
||||
return (FaiPillTone.danger, Icons.close, l.approvalsPillRejected);
|
||||
return (ChainPillTone.danger, Icons.close, l.approvalsPillRejected);
|
||||
case 'expired':
|
||||
return (
|
||||
FaiPillTone.neutral,
|
||||
ChainPillTone.neutral,
|
||||
Icons.timer_off_outlined,
|
||||
l.approvalsPillExpired,
|
||||
);
|
||||
default:
|
||||
return (FaiPillTone.neutral, Icons.help_outline, status);
|
||||
return (ChainPillTone.neutral, Icons.help_outline, status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -743,8 +743,8 @@ class _HistoryDialog extends StatelessWidget {
|
|||
return AlertDialog(
|
||||
title: Row(
|
||||
children: [
|
||||
FaiPill(label: label, tone: tone, icon: icon),
|
||||
const SizedBox(width: FaiSpace.sm),
|
||||
ChainPill(label: label, tone: tone, icon: icon),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${record.flowName} › ${record.stepId}',
|
||||
|
|
@ -779,7 +779,7 @@ class _HistoryDialog extends StatelessWidget {
|
|||
AppLocalizations.of(context)!.approvalsDialogReason,
|
||||
record.reason,
|
||||
),
|
||||
const SizedBox(height: FaiSpace.md),
|
||||
const SizedBox(height: ChainSpace.md),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.approvalsDialogPrompt,
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
|
|
@ -790,7 +790,7 @@ class _HistoryDialog extends StatelessWidget {
|
|||
const SizedBox(height: 4),
|
||||
SelectableText(record.prompt, style: theme.textTheme.bodyMedium),
|
||||
if (record.payloadPreview != null) ...[
|
||||
const SizedBox(height: FaiSpace.md),
|
||||
const SizedBox(height: ChainSpace.md),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.approvalsPayloadPreview,
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
|
|
@ -801,22 +801,22 @@ class _HistoryDialog extends StatelessWidget {
|
|||
const SizedBox(height: 4),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(FaiSpace.sm),
|
||||
padding: const EdgeInsets.all(ChainSpace.sm),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surfaceContainerHigh,
|
||||
borderRadius: BorderRadius.circular(FaiRadius.sm),
|
||||
borderRadius: BorderRadius.circular(ChainRadius.sm),
|
||||
border: Border.all(color: theme.colorScheme.outlineVariant),
|
||||
),
|
||||
child: SelectableText(
|
||||
record.payloadPreview!,
|
||||
style: FaiTheme.mono(size: 11),
|
||||
style: ChainTheme.mono(size: 11),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: FaiSpace.md),
|
||||
const SizedBox(height: ChainSpace.md),
|
||||
Text(
|
||||
record.id,
|
||||
style: FaiTheme.mono(
|
||||
style: ChainTheme.mono(
|
||||
size: 10,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue