App: run tabs under the header on wide layouts, stable Artifacts tab, spelled-out pipeline status, shared list selection, code block header and edge fades
- 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>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import '../../../../ui/layout/app_list_row.dart';
|
||||
import '../../../../core/servers/chat/federated_chat_gateway.dart';
|
||||
import '../../../../core/servers/server_context.dart';
|
||||
import 'dart:async';
|
||||
@@ -127,7 +128,18 @@ class ChatCompactSidebar extends StatelessWidget {
|
||||
duration: MediaQuery.disableAnimationsOf(context)
|
||||
? Duration.zero
|
||||
: const Duration(milliseconds: 200),
|
||||
color: selected ? Colors.transparent : color.withValues(alpha: .07),
|
||||
// The lists' shared open-row style: the tonal fill and one leading
|
||||
// bar in the chat's colour.
|
||||
color: selected
|
||||
? AppListRow.selectedColor(context)
|
||||
: color.withValues(alpha: .07),
|
||||
foregroundDecoration: selected
|
||||
? BoxDecoration(
|
||||
border: BorderDirectional(
|
||||
start: BorderSide(color: color, width: kAppListRowBarWidth),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
child: Draggable<JsonMap>(
|
||||
// A mouse drags at once (a click still opens the chat); the chip
|
||||
// follows the pointer.
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'chat_color_palette.dart';
|
||||
|
||||
/// A chat's colour identifies it; this animated edge identifies where it is
|
||||
/// visible. The active chat has a stronger edge in both list presentations.
|
||||
/// visible. A chat shown in another pane (visible, not the open one) keeps a
|
||||
/// thin leading bar. The open chat is marked by the lists' shared selection
|
||||
/// style on its row (`AppListRow.selected`: tonal fill and one leading bar),
|
||||
/// the same in every list, so this adds nothing more to it.
|
||||
class ChatVisibilityMarker extends StatelessWidget {
|
||||
const ChatVisibilityMarker({
|
||||
super.key,
|
||||
@@ -19,41 +21,24 @@ class ChatVisibilityMarker extends StatelessWidget {
|
||||
final bool active;
|
||||
final Widget child;
|
||||
|
||||
/// The thin bar of a chat visible in another pane.
|
||||
static const double visibleBarWidth = 3;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final dark = chatColorDarkSurface(context);
|
||||
// The open chat: selected and shown beside the list.
|
||||
final open = active && visible;
|
||||
final elsewhere = visible && !active;
|
||||
final row = AnimatedContainer(
|
||||
key: ValueKey('chat-visibility-$sessionId'),
|
||||
duration: MediaQuery.disableAnimationsOf(context)
|
||||
? Duration.zero
|
||||
: const Duration(milliseconds: 220),
|
||||
curve: Curves.easeInOut,
|
||||
// The open chat is unmistakable: a strong fill in its colour, a full
|
||||
// outline, a thick leading bar and (below) a pointer toward the
|
||||
// conversation shown beside the list. A chat visible elsewhere keeps a
|
||||
// thin leading bar.
|
||||
decoration: BoxDecoration(
|
||||
color: open
|
||||
? color.withValues(alpha: dark ? .40 : .28)
|
||||
: active
|
||||
? color.withValues(alpha: dark ? .30 : .22)
|
||||
: null,
|
||||
),
|
||||
foregroundDecoration: BoxDecoration(
|
||||
border: open
|
||||
? BorderDirectional(
|
||||
start: BorderSide(color: color, width: 8),
|
||||
top: BorderSide(color: color, width: 2),
|
||||
end: BorderSide(color: color, width: 2),
|
||||
bottom: BorderSide(color: color, width: 2),
|
||||
)
|
||||
: BorderDirectional(
|
||||
start: visible
|
||||
? BorderSide(color: color, width: 3)
|
||||
: BorderSide.none,
|
||||
),
|
||||
border: BorderDirectional(
|
||||
start: elsewhere
|
||||
? BorderSide(color: color, width: visibleBarWidth)
|
||||
: BorderSide.none,
|
||||
),
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
@@ -64,56 +49,7 @@ class ChatVisibilityMarker extends StatelessWidget {
|
||||
? 'Visible chat'
|
||||
: null,
|
||||
selected: active,
|
||||
// Always a Stack, so selecting a chat never rebuilds its row.
|
||||
child: Stack(
|
||||
children: [
|
||||
row,
|
||||
if (open)
|
||||
PositionedDirectional(
|
||||
end: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
child: IgnorePointer(
|
||||
child: Center(
|
||||
child: CustomPaint(
|
||||
key: Key('chat-active-pointer-$sessionId'),
|
||||
size: const Size(9, 18),
|
||||
painter: _Pointer(
|
||||
color: color,
|
||||
rtl: Directionality.of(context) == TextDirection.rtl,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: row,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// A small triangle on the row's trailing edge, pointing toward the open
|
||||
/// conversation beside the list.
|
||||
class _Pointer extends CustomPainter {
|
||||
const _Pointer({required this.color, required this.rtl});
|
||||
|
||||
final Color color;
|
||||
final bool rtl;
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final path = rtl
|
||||
? (Path()
|
||||
..moveTo(size.width, 0)
|
||||
..lineTo(0, size.height / 2)
|
||||
..lineTo(size.width, size.height))
|
||||
: (Path()
|
||||
..moveTo(0, 0)
|
||||
..lineTo(size.width, size.height / 2)
|
||||
..lineTo(0, size.height));
|
||||
canvas.drawPath(path..close(), Paint()..color = color);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(_Pointer old) => old.color != color || old.rtl != rtl;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,9 @@ import 'chat_awaiting.dart';
|
||||
/// An unread chat is emphasised (heavier title, accent time) with an accent
|
||||
/// dot ending its line; a starred chat shows a small star after its title; a
|
||||
/// running chat carries an activity badge on its avatar. A chat with a colour
|
||||
/// wears a faint row tint and a coloured avatar. An animated leading edge
|
||||
/// marks visible chats, growing wider for the active chat. The menu remains
|
||||
/// wears a faint row tint and a coloured avatar. The open chat wears the
|
||||
/// lists' shared selection (tonal fill and one leading bar); a thin animated
|
||||
/// leading edge marks a chat visible elsewhere. The menu remains
|
||||
/// the row's way to its actions.
|
||||
class ChatSessionRow extends StatelessWidget {
|
||||
const ChatSessionRow({
|
||||
@@ -80,7 +81,7 @@ class ChatSessionRow extends StatelessWidget {
|
||||
id: id,
|
||||
color: tint == null ? background : Color.alphaBlend(tint, background),
|
||||
marker: marker,
|
||||
markerWidth: visible ? (selected ? 10 : 3) : 0,
|
||||
markerWidth: selected ? kAppListRowBarWidth : (visible ? 3 : 0),
|
||||
child: draggable
|
||||
? Draggable<JsonMap>(
|
||||
// A mouse drags at once (a click still opens the chat); the chip
|
||||
@@ -130,7 +131,9 @@ class ChatSessionRow extends StatelessWidget {
|
||||
child: AppListRow(
|
||||
key: Key('chat-row-$id'),
|
||||
selected: selected,
|
||||
selectedFill: Colors.transparent,
|
||||
// The shared open-row style (tonal fill and one leading bar), the
|
||||
// bar in the chat's own colour when it has one.
|
||||
selectionAccent: marker,
|
||||
emphasized: unread,
|
||||
divider: divider,
|
||||
onTap: () => onOpen(session),
|
||||
|
||||
@@ -116,9 +116,14 @@ class _CopyPosition extends SingleChildLayoutDelegate {
|
||||
anchor != oldDelegate.anchor;
|
||||
}
|
||||
|
||||
/// The copy slot always occupies the same space, so hover never shifts code.
|
||||
/// Keyboard focus also reveals it; a touch on the code still selects normally.
|
||||
class ChatCodeCopyRegion extends StatefulWidget {
|
||||
/// A fenced code block as one framed piece: a header strip with the
|
||||
/// language label and Copy, then the code on its own fill.
|
||||
///
|
||||
/// Copy is always in the header (a touch screen has no hover to reveal it),
|
||||
/// outside the selectable document, so selecting the code never takes the
|
||||
/// button's label with it. Light mode keeps the code fill light, framed by a
|
||||
/// hairline, so code text keeps its full contrast; dark mode lifts it a step.
|
||||
class ChatCodeCopyRegion extends StatelessWidget {
|
||||
const ChatCodeCopyRegion({
|
||||
super.key,
|
||||
required this.code,
|
||||
@@ -127,49 +132,57 @@ class ChatCodeCopyRegion extends StatefulWidget {
|
||||
});
|
||||
final String code;
|
||||
final Widget label, child;
|
||||
@override
|
||||
State<ChatCodeCopyRegion> createState() => _ChatCodeCopyRegionState();
|
||||
}
|
||||
|
||||
class _ChatCodeCopyRegionState extends State<ChatCodeCopyRegion> {
|
||||
bool _hover = false, _focus = false;
|
||||
/// The block's corner radius.
|
||||
static const double radius = 8;
|
||||
|
||||
/// The code body's fill.
|
||||
static Color fill(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return scheme.brightness == Brightness.light
|
||||
? scheme.surfaceContainerLow
|
||||
: scheme.surfaceContainerHighest;
|
||||
}
|
||||
|
||||
/// The header strip's fill, one step from the body's.
|
||||
static Color headerFill(BuildContext context) =>
|
||||
Theme.of(context).colorScheme.surfaceContainerHigh;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final visible = _hover || _focus;
|
||||
return MouseRegion(
|
||||
onEnter: (_) => setState(() => _hover = true),
|
||||
onExit: (_) => setState(() => _hover = false),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: widget.label),
|
||||
Focus(
|
||||
skipTraversal: true,
|
||||
onFocusChange: (value) => setState(() => _focus = value),
|
||||
child: ExcludeSemantics(
|
||||
excluding: !visible,
|
||||
child: IgnorePointer(
|
||||
ignoring: !visible,
|
||||
child: Opacity(
|
||||
opacity: visible ? 1 : 0,
|
||||
child: SelectionContainer.disabled(
|
||||
child: ChatCopyButton(
|
||||
text: widget.code,
|
||||
showLabel: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final header = ColoredBox(
|
||||
key: const Key('chat-code-header'),
|
||||
color: headerFill(context),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 12, end: 4),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(child: label),
|
||||
SelectionContainer.disabled(
|
||||
child: ChatCopyButton(text: code, showLabel: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
return DecoratedBox(
|
||||
position: DecorationPosition.foreground,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: scheme.outlineVariant),
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
child: ColoredBox(
|
||||
key: const Key('chat-code-body'),
|
||||
color: fill(context),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [header, child],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
widget.child,
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import '../../../../ui/layout/wheel_scroll_forwarding.dart';
|
||||
|
||||
/// Native, persistent overflow affordances for a code block or table. The
|
||||
/// footer is outside the selectable document and never overlays its content.
|
||||
/// Native, persistent overflow affordances for a code block or table: the
|
||||
/// side with more content fades out under a small chevron, and the scrollbar
|
||||
/// thumb stays visible. The chevrons are outside the selectable document and
|
||||
/// take no taps; the semantics hint names the gestures and keys.
|
||||
class ChatHorizontalViewport extends StatefulWidget {
|
||||
const ChatHorizontalViewport({
|
||||
super.key,
|
||||
@@ -89,20 +91,67 @@ class _ChatHorizontalViewportState extends State<ChatHorizontalViewport> {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// The width over which content fades out at a side with more to scroll.
|
||||
static const double _fadeWidth = 32;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
final focusColor = Theme.of(context).colorScheme.primary;
|
||||
final view = Padding(
|
||||
padding: EdgeInsets.only(bottom: _overflow ? 12 : 0),
|
||||
Widget view = Padding(
|
||||
padding: EdgeInsets.only(bottom: _overflow ? 10 : 0),
|
||||
child: HorizontalScrollView(controller: _controller, child: widget.child),
|
||||
);
|
||||
if (_left || _right) {
|
||||
// The side with more content fades out, the usual sign that a row
|
||||
// continues past the edge; content at rest is never covered.
|
||||
view = ShaderMask(
|
||||
key: const Key('chat-horizontal-fade'),
|
||||
blendMode: BlendMode.dstIn,
|
||||
shaderCallback: (bounds) {
|
||||
final fade = bounds.width <= 0
|
||||
? 0.0
|
||||
: (_fadeWidth / bounds.width).clamp(0.0, 0.5);
|
||||
const shown = Colors.white;
|
||||
const hidden = Color(0x00FFFFFF);
|
||||
return LinearGradient(
|
||||
colors: [
|
||||
_left ? hidden : shown,
|
||||
shown,
|
||||
shown,
|
||||
_right ? hidden : shown,
|
||||
],
|
||||
stops: [0, fade, 1 - fade, 1],
|
||||
).createShader(bounds);
|
||||
},
|
||||
child: view,
|
||||
);
|
||||
}
|
||||
final scrollbar = Scrollbar(
|
||||
controller: _controller,
|
||||
thumbVisibility: _overflow,
|
||||
trackVisibility: _overflow,
|
||||
child: view,
|
||||
);
|
||||
Widget chevron(bool left) => Positioned(
|
||||
left: left ? 0 : null,
|
||||
right: left ? null : 0,
|
||||
top: 0,
|
||||
bottom: 10,
|
||||
child: IgnorePointer(
|
||||
child: Center(
|
||||
child: Icon(
|
||||
left ? Icons.chevron_left : Icons.chevron_right,
|
||||
key: Key(
|
||||
left ? 'chat-horizontal-more-left' : 'chat-horizontal-more-right',
|
||||
),
|
||||
size: 18,
|
||||
// Physical sides: the arrow points where the content continues.
|
||||
textDirection: TextDirection.ltr,
|
||||
color: color.withValues(alpha: .7),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
return NotificationListener<ScrollMetricsNotification>(
|
||||
onNotification: (notification) {
|
||||
if (notification.metrics.axis == Axis.horizontal) _scheduleMetrics();
|
||||
@@ -127,35 +176,17 @@ class _ChatHorizontalViewportState extends State<ChatHorizontalViewport> {
|
||||
color: _focused ? focusColor : Colors.transparent,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
child: Stack(
|
||||
children: [
|
||||
scrollbar,
|
||||
if (_overflow)
|
||||
SelectionContainer.disabled(
|
||||
child: ExcludeSemantics(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Row(
|
||||
if (_left || _right)
|
||||
Positioned.fill(
|
||||
child: SelectionContainer.disabled(
|
||||
child: ExcludeSemantics(
|
||||
child: Stack(
|
||||
children: [
|
||||
Icon(
|
||||
_left && _right
|
||||
? Icons.swap_horiz
|
||||
: _left
|
||||
? Icons.arrow_back
|
||||
: Icons.arrow_forward,
|
||||
size: 16,
|
||||
textDirection: TextDirection.ltr,
|
||||
color: color,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Flexible(
|
||||
child: Text(
|
||||
'Scroll horizontally',
|
||||
style: TextStyle(color: color),
|
||||
),
|
||||
),
|
||||
if (_left) chevron(true),
|
||||
if (_right) chevron(false),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -260,22 +260,19 @@ class _ChatMarkdownViewState extends State<ChatMarkdownView> {
|
||||
return ChatCodeCopyRegion(
|
||||
code: code,
|
||||
label: Text(markdownCodeLabel(language), style: labelStyle),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(color: _codeFill(context)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: ChatTranscriptHorizontalScrollView(
|
||||
label: 'code block',
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
children: _linked(
|
||||
context,
|
||||
code,
|
||||
(part) => TextSpan(text: part),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: ChatTranscriptHorizontalScrollView(
|
||||
label: 'code block',
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
children: _linked(
|
||||
context,
|
||||
code,
|
||||
(part) => TextSpan(text: part),
|
||||
),
|
||||
style: const TextStyle(fontFamily: appMonospaceFamily),
|
||||
),
|
||||
style: const TextStyle(fontFamily: appMonospaceFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user