open a file in the diff panel via clide ui open diff
Adds diff as a fourth ui.open target. The diff extension now retains an app-scoped DiffController and subscribes to its builtin.diff/selection channel: a selection reveals the diff tab and focuses the file, which the view scrolls into view and highlights. Retaining the controller in the extension (not the view) lets a focus survive the tab being revealed/remounted, mirroring the ReaderNav viewers. Closes T-233. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,16 @@ void main() {
|
||||
expect(published[1].data, {'path': 'docs/initial-plan.md'});
|
||||
});
|
||||
|
||||
test('diff keys on path and publishes a builtin.diff selection (T-233)', () async {
|
||||
wire();
|
||||
final r = await open(['diff', 'lib/main.dart']);
|
||||
expect(r.ok, isTrue, reason: r.error?.message);
|
||||
expect(r.data['opened'], isTrue);
|
||||
expect(published.single.publisher, 'builtin.diff');
|
||||
expect(published.single.channel, 'selection');
|
||||
expect(published.single.data, {'path': 'lib/main.dart'});
|
||||
});
|
||||
|
||||
test('named args work too (reader/ref)', () async {
|
||||
wire();
|
||||
final r = await d.dispatch(IpcRequest(id: '1', cmd: 'ui.open', args: {'reader': 'tickets', 'ref': 'T-7'}));
|
||||
|
||||
Reference in New Issue
Block a user