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
|
|
@ -97,7 +97,7 @@ class _AuditPageState extends State<AuditPage> {
|
|||
title: Text(AppLocalizations.of(context)!.auditTitle),
|
||||
actions: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: FaiSpace.lg),
|
||||
padding: const EdgeInsets.only(right: ChainSpace.lg),
|
||||
child: _FilterChips(
|
||||
value: _typeFilter,
|
||||
onChanged: (v) => setState(() => _typeFilter = v),
|
||||
|
|
@ -113,7 +113,7 @@ class _AuditPageState extends State<AuditPage> {
|
|||
tooltip: AppLocalizations.of(context)!.auditClearLogTooltip,
|
||||
onPressed: _onClearPressed,
|
||||
),
|
||||
const SizedBox(width: FaiSpace.sm),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
|
|
@ -123,14 +123,14 @@ class _AuditPageState extends State<AuditPage> {
|
|||
child: !_initialLoaded
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: _error != null && _events.isEmpty
|
||||
? FaiEmptyState(
|
||||
? ChainEmptyState(
|
||||
icon: Icons.cloud_off_outlined,
|
||||
iconColor: theme.colorScheme.error,
|
||||
title: AppLocalizations.of(context)!.hubUnreachable,
|
||||
hint: AppLocalizations.of(context)!.hubUnreachableHint,
|
||||
)
|
||||
: filtered.isEmpty
|
||||
? FaiEmptyState(
|
||||
? ChainEmptyState(
|
||||
icon: Icons.timeline_outlined,
|
||||
title: AppLocalizations.of(context)!.auditNoEvents,
|
||||
hint: AppLocalizations.of(context)!.auditNoEventsHint,
|
||||
|
|
@ -187,7 +187,7 @@ class _AuditPageState extends State<AuditPage> {
|
|||
Color _toneFor(String type, ThemeData theme) {
|
||||
if (type.endsWith('.failed')) return theme.colorScheme.error;
|
||||
if (type.endsWith('.completed')) return theme.colorScheme.primary;
|
||||
if (type.endsWith('.started')) return FaiColors.warning;
|
||||
if (type.endsWith('.started')) return ChainColors.warning;
|
||||
return theme.colorScheme.outline;
|
||||
}
|
||||
}
|
||||
|
|
@ -220,15 +220,15 @@ class _GroupedEventList extends StatelessWidget {
|
|||
final l = AppLocalizations.of(context)!;
|
||||
final items = _itemsWithHeaders(events, l);
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.all(FaiSpace.xl),
|
||||
padding: const EdgeInsets.all(ChainSpace.xl),
|
||||
itemCount: items.length,
|
||||
itemBuilder: (context, i) {
|
||||
final item = items[i];
|
||||
if (item is _GroupHeader) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: i == 0 ? 0 : FaiSpace.lg,
|
||||
bottom: FaiSpace.sm,
|
||||
top: i == 0 ? 0 : ChainSpace.lg,
|
||||
bottom: ChainSpace.sm,
|
||||
),
|
||||
child: Text(
|
||||
item.label,
|
||||
|
|
@ -242,8 +242,8 @@ class _GroupedEventList extends StatelessWidget {
|
|||
}
|
||||
final e = (item as _EventItem).event;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: FaiSpace.xs),
|
||||
child: FaiDataRow(
|
||||
padding: const EdgeInsets.only(bottom: ChainSpace.xs),
|
||||
child: ChainDataRow(
|
||||
accent: toneFor(e.type),
|
||||
leading: formatTime(e.timestamp),
|
||||
title: e.type,
|
||||
|
|
@ -328,7 +328,7 @@ class _FilterChips extends StatelessWidget {
|
|||
children: [
|
||||
for (final (v, label) in items)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: FaiSpace.xs),
|
||||
padding: const EdgeInsets.only(left: ChainSpace.xs),
|
||||
child: _ChipButton(
|
||||
label: label,
|
||||
selected: value == v,
|
||||
|
|
@ -378,14 +378,14 @@ class _ChipButtonState extends State<_ChipButton> {
|
|||
child: GestureDetector(
|
||||
onTap: widget.onTap,
|
||||
child: AnimatedContainer(
|
||||
duration: FaiMotion.fast,
|
||||
duration: ChainMotion.fast,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: FaiSpace.md,
|
||||
horizontal: ChainSpace.md,
|
||||
vertical: 6,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: bg,
|
||||
borderRadius: BorderRadius.circular(FaiRadius.sm),
|
||||
borderRadius: BorderRadius.circular(ChainRadius.sm),
|
||||
border: Border.all(
|
||||
color: widget.selected
|
||||
? theme.colorScheme.primary.withValues(alpha: 0.3)
|
||||
|
|
@ -394,7 +394,7 @@ class _ChipButtonState extends State<_ChipButton> {
|
|||
),
|
||||
child: Text(
|
||||
widget.label,
|
||||
style: FaiTheme.mono(
|
||||
style: ChainTheme.mono(
|
||||
size: 11,
|
||||
weight: widget.selected ? FontWeight.w500 : FontWeight.w400,
|
||||
color: fg,
|
||||
|
|
@ -420,8 +420,8 @@ class _LiveStatusBar extends StatelessWidget {
|
|||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: FaiSpace.xl,
|
||||
vertical: FaiSpace.sm,
|
||||
horizontal: ChainSpace.xl,
|
||||
vertical: ChainSpace.sm,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surfaceContainerHigh,
|
||||
|
|
@ -431,11 +431,11 @@ class _LiveStatusBar extends StatelessWidget {
|
|||
),
|
||||
child: Row(
|
||||
children: [
|
||||
FaiStatusDot(
|
||||
color: live ? FaiColors.success : FaiColors.danger,
|
||||
ChainStatusDot(
|
||||
color: live ? ChainColors.success : ChainColors.danger,
|
||||
pulsing: live,
|
||||
),
|
||||
const SizedBox(width: FaiSpace.sm),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
Text(
|
||||
live ? l.auditLiveStatus(eventCount) : l.auditDisconnected(error!),
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
|
|
@ -569,7 +569,7 @@ class _EventDetailDialogState extends State<_EventDetailDialog> {
|
|||
return AlertDialog(
|
||||
title: Text(event.type),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(FaiRadius.md),
|
||||
borderRadius: BorderRadius.circular(ChainRadius.md),
|
||||
),
|
||||
content: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 640, maxHeight: 560),
|
||||
|
|
@ -616,7 +616,7 @@ class _EventDetailDialogState extends State<_EventDetailDialog> {
|
|||
valueColor: theme.colorScheme.error,
|
||||
),
|
||||
if (detail.isNotEmpty) ...[
|
||||
const SizedBox(height: FaiSpace.md),
|
||||
const SizedBox(height: ChainSpace.md),
|
||||
Text(
|
||||
l.auditDetailHeader,
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
|
|
@ -627,17 +627,17 @@ class _EventDetailDialogState extends State<_EventDetailDialog> {
|
|||
const SizedBox(height: 4),
|
||||
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(detail, style: FaiTheme.mono(size: 11)),
|
||||
child: SelectableText(detail, style: ChainTheme.mono(size: 11)),
|
||||
),
|
||||
],
|
||||
if (_explanation != null || _explaining) ...[
|
||||
const SizedBox(height: FaiSpace.lg),
|
||||
const SizedBox(height: ChainSpace.lg),
|
||||
_ExplanationPanel(
|
||||
explaining: _explaining,
|
||||
result: _explanation,
|
||||
|
|
@ -729,7 +729,7 @@ class _FlowRunDialog extends StatelessWidget {
|
|||
return AlertDialog(
|
||||
title: Text(l.auditFlowRunDialogTitle(flowName)),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(FaiRadius.md),
|
||||
borderRadius: BorderRadius.circular(ChainRadius.md),
|
||||
),
|
||||
content: ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: 640, maxHeight: maxHeight),
|
||||
|
|
@ -743,15 +743,15 @@ class _FlowRunDialog extends StatelessWidget {
|
|||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: FaiSpace.md),
|
||||
const SizedBox(height: ChainSpace.md),
|
||||
Flexible(
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
itemCount: related.length,
|
||||
separatorBuilder: (_, _) => const SizedBox(height: FaiSpace.xs),
|
||||
separatorBuilder: (_, _) => const SizedBox(height: ChainSpace.xs),
|
||||
itemBuilder: (context, i) {
|
||||
final e = related[i];
|
||||
return FaiDataRow(
|
||||
return ChainDataRow(
|
||||
accent: _toneFor(e.type, theme),
|
||||
leading: _formatRelativeTime(e.timestamp),
|
||||
title: e.type,
|
||||
|
|
@ -792,7 +792,7 @@ class _FlowRunDialog extends StatelessWidget {
|
|||
Color _toneFor(String type, ThemeData theme) {
|
||||
if (type.endsWith('.failed')) return theme.colorScheme.error;
|
||||
if (type.endsWith('.completed')) return theme.colorScheme.primary;
|
||||
if (type.endsWith('.started')) return FaiColors.warning;
|
||||
if (type.endsWith('.started')) return ChainColors.warning;
|
||||
return theme.colorScheme.outline;
|
||||
}
|
||||
}
|
||||
|
|
@ -831,7 +831,7 @@ class _Field extends StatelessWidget {
|
|||
child: SelectableText(
|
||||
value,
|
||||
style: mono
|
||||
? FaiTheme.mono(
|
||||
? ChainTheme.mono(
|
||||
size: 11,
|
||||
color: valueColor ?? theme.colorScheme.onSurface,
|
||||
)
|
||||
|
|
@ -875,10 +875,10 @@ class _ExplanationPanel extends StatelessWidget {
|
|||
: theme.colorScheme.error;
|
||||
return 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: color.withValues(alpha: 0.3)),
|
||||
),
|
||||
child: Column(
|
||||
|
|
@ -887,7 +887,7 @@ class _ExplanationPanel extends StatelessWidget {
|
|||
Row(
|
||||
children: [
|
||||
Icon(Icons.auto_awesome, size: 14, color: color),
|
||||
const SizedBox(width: FaiSpace.xs),
|
||||
const SizedBox(width: ChainSpace.xs),
|
||||
Text(
|
||||
l.auditSystemAi,
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
|
|
@ -895,15 +895,15 @@ class _ExplanationPanel extends StatelessWidget {
|
|||
letterSpacing: 0.6,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: FaiSpace.xs),
|
||||
FaiPill(
|
||||
const SizedBox(width: ChainSpace.xs),
|
||||
ChainPill(
|
||||
label: privacyMode,
|
||||
tone: privacyMode == 'full'
|
||||
? FaiPillTone.warning
|
||||
: FaiPillTone.neutral,
|
||||
? ChainPillTone.warning
|
||||
: ChainPillTone.neutral,
|
||||
),
|
||||
if (result != null && result!.isSuccess && result!.cached) ...[
|
||||
const SizedBox(width: FaiSpace.xs),
|
||||
const SizedBox(width: ChainSpace.xs),
|
||||
Tooltip(
|
||||
message: () {
|
||||
final hits = result!.cacheHits > 1
|
||||
|
|
@ -913,9 +913,9 @@ class _ExplanationPanel extends StatelessWidget {
|
|||
? l.auditCachedTooltipUnknown(hits)
|
||||
: l.auditCachedTooltipKnown(result!.cachedAt, hits);
|
||||
}(),
|
||||
child: FaiPill(
|
||||
child: ChainPill(
|
||||
label: l.auditCachedPill,
|
||||
tone: FaiPillTone.success,
|
||||
tone: ChainPillTone.success,
|
||||
icon: Icons.bolt,
|
||||
),
|
||||
),
|
||||
|
|
@ -926,7 +926,7 @@ class _ExplanationPanel extends StatelessWidget {
|
|||
result!.cached
|
||||
? l.auditOriginalLatency(result!.latencyMs)
|
||||
: l.auditLatency(result!.latencyMs),
|
||||
style: FaiTheme.mono(
|
||||
style: ChainTheme.mono(
|
||||
size: 10,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
|
|
@ -934,7 +934,7 @@ class _ExplanationPanel extends StatelessWidget {
|
|||
if (result != null &&
|
||||
result!.isSuccess &&
|
||||
onRegenerate != null) ...[
|
||||
const SizedBox(width: FaiSpace.sm),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
Tooltip(
|
||||
message: l.auditRegenerateTooltip,
|
||||
child: IconButton(
|
||||
|
|
@ -946,7 +946,7 @@ class _ExplanationPanel extends StatelessWidget {
|
|||
],
|
||||
],
|
||||
),
|
||||
const SizedBox(height: FaiSpace.sm),
|
||||
const SizedBox(height: ChainSpace.sm),
|
||||
if (explaining)
|
||||
Row(
|
||||
children: [
|
||||
|
|
@ -955,7 +955,7 @@ class _ExplanationPanel extends StatelessWidget {
|
|||
height: 14,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
),
|
||||
const SizedBox(width: FaiSpace.sm),
|
||||
const SizedBox(width: ChainSpace.sm),
|
||||
Text(
|
||||
l.auditAskingFull,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
|
|
@ -974,7 +974,7 @@ class _ExplanationPanel extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
if (result!.fixHint(l).isNotEmpty) ...[
|
||||
const SizedBox(height: FaiSpace.sm),
|
||||
const SizedBox(height: ChainSpace.sm),
|
||||
Text(
|
||||
l.auditFixLabel,
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
|
|
@ -1063,7 +1063,7 @@ class _ClearAuditDialogState extends State<_ClearAuditDialog> {
|
|||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: FaiSpace.lg),
|
||||
const SizedBox(height: ChainSpace.lg),
|
||||
TextField(
|
||||
controller: _reviewer,
|
||||
decoration: InputDecoration(
|
||||
|
|
@ -1072,7 +1072,7 @@ class _ClearAuditDialogState extends State<_ClearAuditDialog> {
|
|||
isDense: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: FaiSpace.md),
|
||||
const SizedBox(height: ChainSpace.md),
|
||||
ValueListenableBuilder<TextEditingValue>(
|
||||
valueListenable: _reason,
|
||||
builder: (_, _, _) => TextField(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue