a6db4ba20e
- Run detail: on a wide window (>= 840, pane >= 600) the tabs are Material segments under the run header; phones keep the floating bottom bar. Artifacts is always a tab, badged with its count and disabled with 0 (its tooltip says why), so Changes never moves. - Pipelines list: 'Failed · last run 19 Oct' beside the status dot; facts on the next line; compact rows keep 'Failed · 19 Oct'. - Settings: Disconnect is outlined beside a tonal Reconnect. - Lists: one selection style (tonal fill plus one leading accent bar) for runs, pipelines and chats; chat's border, fill and pointer removed. - Transcript: overflowing blocks fade at the edge with a chevron instead of a 'Scroll horizontally' line (semantics hint kept); code blocks get a header strip with language and Copy; lighter light-mode code fill. - Runs list: rows under a day heading show only the time of day. - Artifact search reveal re-centres once the lazy list's extent settles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
157 lines
5.0 KiB
Dart
157 lines
5.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'settings_layout.dart';
|
|
|
|
export 'settings_theme.dart';
|
|
|
|
/// A native text field with a label and one supporting line. The label is laid
|
|
/// out as wrapping text above the field; Material uses an outlined
|
|
/// [TextField]. The label is a compact secondary line (like the web field
|
|
/// label) while the section title carries the weight.
|
|
/// Labels and helper/error copy are never line-capped, so large text cannot
|
|
/// truncate them. No font sizes, heights or colours are fixed here.
|
|
class SettingsTextField extends StatelessWidget {
|
|
const SettingsTextField({
|
|
super.key,
|
|
required this.controller,
|
|
required this.label,
|
|
required this.placeholder,
|
|
required this.helper,
|
|
required this.onChanged,
|
|
this.error = '',
|
|
this.maxLines = 1,
|
|
});
|
|
|
|
final TextEditingController controller;
|
|
final String label;
|
|
final String placeholder;
|
|
final String helper;
|
|
final ValueChanged<String> onChanged;
|
|
final String error;
|
|
final int maxLines;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
final hasError = error.trim().isNotEmpty;
|
|
// The label is laid out as normal wrapping text on both platforms. A
|
|
// Material floating label is single-line and ellipsizes the workspace label
|
|
// at narrow widths or large text, dropping required words. It is a compact
|
|
// secondary line, matching the web field label, so the section title is the
|
|
// one emphasised line in the group.
|
|
final labelWidget = ExcludeSemantics(
|
|
child: Text(
|
|
label,
|
|
style: theme.textTheme.labelMedium?.copyWith(
|
|
color: theme.colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
);
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
labelWidget,
|
|
const SizedBox(height: settingsFieldGap),
|
|
Semantics(
|
|
label: label,
|
|
child: TextField(
|
|
controller: controller,
|
|
onChanged: onChanged,
|
|
keyboardType: TextInputType.url,
|
|
minLines: 1,
|
|
maxLines: maxLines,
|
|
autocorrect: false,
|
|
enableSuggestions: false,
|
|
textInputAction: TextInputAction.done,
|
|
decoration: InputDecoration(
|
|
hintText: placeholder,
|
|
// `helperText`/`errorText` single-line-ellipsize unless capped
|
|
// by `helperMaxLines`/`errorMaxLines`. Widgets wrap with no line
|
|
// cap, so the full instructions stay readable at 2x.
|
|
helper: hasError
|
|
? null
|
|
: Text(
|
|
helper,
|
|
style: theme.textTheme.bodySmall?.copyWith(
|
|
color: theme.colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
error: hasError
|
|
? Text(
|
|
error,
|
|
style: theme.textTheme.bodySmall?.copyWith(
|
|
color: theme.colorScheme.error,
|
|
),
|
|
)
|
|
: null,
|
|
border: const OutlineInputBorder(),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
/// The settings actions: the emphasised one filled, the other outlined.
|
|
/// Buttons wrap on a narrow window (or with large text) instead of
|
|
/// overflowing.
|
|
///
|
|
/// [primaryOutlined] turns the order of emphasis around for a primary action
|
|
/// that ends something (Disconnect): the secondary action leads as a tonal
|
|
/// button and the primary follows outlined, so the filled emphasis never sits
|
|
/// on the action that drops the connection.
|
|
class SettingsActions extends StatelessWidget {
|
|
const SettingsActions({
|
|
super.key,
|
|
required this.primaryLabel,
|
|
required this.secondaryLabel,
|
|
required this.onPrimary,
|
|
required this.onSecondary,
|
|
this.primaryKey,
|
|
this.secondaryKey,
|
|
this.primaryOutlined = false,
|
|
});
|
|
|
|
final String primaryLabel;
|
|
final String secondaryLabel;
|
|
final VoidCallback onPrimary;
|
|
final VoidCallback onSecondary;
|
|
final Key? primaryKey;
|
|
final Key? secondaryKey;
|
|
final bool primaryOutlined;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final primary = primaryOutlined
|
|
? OutlinedButton(
|
|
key: primaryKey,
|
|
onPressed: onPrimary,
|
|
child: Text(primaryLabel),
|
|
)
|
|
: FilledButton(
|
|
key: primaryKey,
|
|
onPressed: onPrimary,
|
|
child: Text(primaryLabel),
|
|
);
|
|
final secondary = primaryOutlined
|
|
? FilledButton.tonal(
|
|
key: secondaryKey,
|
|
onPressed: onSecondary,
|
|
child: Text(secondaryLabel),
|
|
)
|
|
: OutlinedButton(
|
|
key: secondaryKey,
|
|
onPressed: onSecondary,
|
|
child: Text(secondaryLabel),
|
|
);
|
|
return Wrap(
|
|
spacing: settingsControlGap,
|
|
runSpacing: settingsControlGap,
|
|
children: primaryOutlined
|
|
? <Widget>[secondary, primary]
|
|
: <Widget>[primary, secondary],
|
|
);
|
|
}
|
|
}
|