Changes: file list beside the selected diff on wide desktop panes
At a window of at least 1000 px with a pane of at least 720 px, the run Changes surface (final changes and visit pages) lists the files on the left (name over folder, line counts, selected row highlighted) and shows the selected file's diff on the right. j/k or ArrowDown/ArrowUp move between files while the list has focus; Enter opens the file's full diff page. Phones and narrow panes keep one row per file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import '../domain/change_wording.dart';
|
||||
import '../domain/file_change.dart';
|
||||
import '../domain/run_changes.dart';
|
||||
import 'capture_section.dart';
|
||||
import 'changes_split_view.dart';
|
||||
import 'change_style.dart';
|
||||
import 'file_diff_viewer.dart';
|
||||
import 'visit_pager.dart';
|
||||
@@ -97,7 +98,14 @@ class _ChangesViewerState extends State<ChangesViewer> {
|
||||
static const _query = '';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget build(BuildContext context) => LayoutBuilder(
|
||||
builder: (context, constraints) =>
|
||||
_build(context, split: changesSplitFits(context, constraints.maxWidth)),
|
||||
);
|
||||
|
||||
/// [split] shows the files beside the selected file's diff (a wide pane)
|
||||
/// rather than one row per file opening its own page.
|
||||
Widget _build(BuildContext context, {required bool split}) {
|
||||
final run = _run;
|
||||
final captures = _captures;
|
||||
final showSummary = widget.showSummary;
|
||||
@@ -106,6 +114,7 @@ class _ChangesViewerState extends State<ChangesViewer> {
|
||||
);
|
||||
final note = showSummary ? runChangesNote(run) : '';
|
||||
final visit = captures.isEmpty ? null : captures[_visitIndex];
|
||||
final visitFiles = visit?.capture?.files ?? const <FileChange>[];
|
||||
final hasVisitPager = !widget.finalOnly && captures.length > 1;
|
||||
final pager = hasVisitPager
|
||||
? ChangesVisitPager(
|
||||
@@ -158,7 +167,17 @@ class _ChangesViewerState extends State<ChangesViewer> {
|
||||
),
|
||||
if (showSummary) const Divider(height: 1),
|
||||
// The run's final changes: every changed path once, as it ended.
|
||||
if (widget.finalOnly)
|
||||
if (widget.finalOnly && split && run.files.isNotEmpty)
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: withBarClearance(context, EdgeInsets.zero),
|
||||
child: ChangesSplitView(
|
||||
key: const ValueKey<String>('changes-final-split'),
|
||||
files: run.files,
|
||||
),
|
||||
),
|
||||
)
|
||||
else if (widget.finalOnly)
|
||||
Expanded(
|
||||
child: run.files.isEmpty
|
||||
? SingleChildScrollView(
|
||||
@@ -184,7 +203,31 @@ class _ChangesViewerState extends State<ChangesViewer> {
|
||||
],
|
||||
),
|
||||
),
|
||||
if (!widget.finalOnly)
|
||||
if (!widget.finalOnly &&
|
||||
split &&
|
||||
visit != null &&
|
||||
visitFiles.isNotEmpty)
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: hasVisitPager
|
||||
? withBarClearance(context, EdgeInsets.zero)
|
||||
: withTopBarClearance(context, EdgeInsets.zero),
|
||||
child: ChangesSplitView(
|
||||
key: ValueKey<String>(
|
||||
'changes-visit-split-${visit.stage}-${visit.sequence}',
|
||||
),
|
||||
files: visitFiles,
|
||||
heading: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
StageCaptureHeading(stage: visit),
|
||||
const Divider(height: 1),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
else if (!widget.finalOnly)
|
||||
Expanded(
|
||||
child: visit == null
|
||||
? SingleChildScrollView(
|
||||
|
||||
Reference in New Issue
Block a user