From 950479ae02ebcdf217b5856cbba73e3d8441b0fc Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 13 Nov 2026 18:43:45 -0700 Subject: [PATCH 1/7] fix: allow Git sidebar discovery from workspace view selector --- .../presentation/workspace_screen.dart | 4 +- test/src/app_smoke_test.dart | 214 +++++++++++++++++- tools/git_sidebar_discovery_native.py | 167 ++++++++++++++ tools/view_selector_native_acceptance.py | 9 +- 4 files changed, 385 insertions(+), 9 deletions(-) create mode 100644 tools/git_sidebar_discovery_native.py diff --git a/lib/src/workspace/presentation/workspace_screen.dart b/lib/src/workspace/presentation/workspace_screen.dart index 0a5db429..65311ff1 100644 --- a/lib/src/workspace/presentation/workspace_screen.dart +++ b/lib/src/workspace/presentation/workspace_screen.dart @@ -2354,8 +2354,8 @@ IconData _sidebarTabIcon(_SidebarTab tab, TextDirection direction) { } bool _sidebarTabAvailable(WidgetRef ref, _SidebarTab tab) => switch (tab) { - _SidebarTab.git || - _SidebarTab.gitLog => ref.read(gitControllerProvider).repositoryInfo != null, + // The folder workspace tabs expose Git before discovery; selecting either + // view starts the shared sidebar's discovery and trust flow. _SidebarTab.outline => ref.read(workspaceControllerProvider).activeBuffer != null, _ => true, diff --git a/test/src/app_smoke_test.dart b/test/src/app_smoke_test.dart index 22f1eff3..b0ccfdc0 100644 --- a/test/src/app_smoke_test.dart +++ b/test/src/app_smoke_test.dart @@ -192,8 +192,9 @@ void main() { expect({ for (final e in menus.entries) e['label']: e['mnemonic'], }, expected); - expect(menus.enabled('Commit'), isFalse); - expect(menus.enabled('Git Log'), isFalse); + expect(container.read(gitControllerProvider).repositoryInfo, isNull); + expect(menus.enabled('Commit'), isTrue); + expect(menus.enabled('Git Log'), isTrue); expect(menus.enabled('Files'), isTrue); menus.close(); await tester.pumpAndSettle(); @@ -7669,6 +7670,9 @@ code bool descendantWorkspace = false, bool switchingWorkspace = false, bool delayDiscovery = false, + bool repositoryDiscovered = true, + bool hasRepository = true, + bool nestedRepository = false, WorkspaceKind kind = WorkspaceKind.markdownFolder, }) async { final temp = Directory.systemTemp.createTempSync('busymark_tab_actions_'); @@ -7689,7 +7693,12 @@ code paths: paths, kind: kind, ); - final sharedClient = _SearchableGitReadFixture(_gitDiffState(temp.path)); + final repositoryRoot = nestedRepository ? '${temp.path}/nested' : temp.path; + Directory(repositoryRoot).createSync(recursive: true); + final gitState = _gitDiffState(repositoryRoot); + final sharedClient = _SearchableGitReadFixture( + hasRepository ? gitState : const GitState(), + ); if (delayDiscovery) sharedClient.discoveryGate = Completer(); final container = ProviderContainer( overrides: [ @@ -7717,7 +7726,10 @@ code startupPathProvider.overrideWithValue(workspaceRoot), if (git) gitControllerProvider.overrideWith( - () => _PresetGitController(_gitDiffState(temp.path)), + () => _PresetGitController( + gitState, + initiallyDiscovered: repositoryDiscovered, + ), ), ], ); @@ -7792,6 +7804,191 @@ code ); } + for (final kind in [ + WorkspaceKind.markdownFolder, + WorkspaceKind.writersideModule, + ]) { + for (final view in ['Commit', 'Git Log']) { + testWidgets( + '${kind.name} Sidebar selector opens $view before discovery and confirms trust explicitly', + (tester) async { + tester.view.physicalSize = const Size(1440, 1000); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + final fixture = await tabWorkspace( + tester, + git: true, + openGitComparisons: false, + trustGit: false, + delayDiscovery: true, + repositoryDiscovered: false, + kind: kind, + ); + final container = fixture.container; + final workspace = container + .read(workspaceControllerProvider) + .workspace!; + final buffer = container + .read(workspaceControllerProvider) + .activeBuffer; + expect(container.read(gitControllerProvider).repositoryInfo, isNull); + expect(fixture.sharedClient.discoveryEntered.isCompleted, isFalse); + final menus = NativeMenuProbe(tester); + await tester.tap( + find.byKey(const ValueKey('workspace-sidebar-view-menu')), + ); + await tester.pumpAndSettle(); + expect(menus.enabled('Commit'), isTrue); + expect(menus.enabled('Git Log'), isTrue); + await menus.choose(view, settle: false); + await pumpUntil( + tester, + () => fixture.sharedClient.discoveryEntered.isCompleted, + operation: 'start $view discovery through the Sidebar selector', + ); + expect(container.read(gitControllerProvider).repositoryInfo, isNull); + expect(find.byType(shared.GitFeatureSidebar), findsNothing); + fixture.sharedClient.discoveryGate!.complete(); + await pumpUntil( + tester, + () => find.byType(shared.GitFeatureSidebar).evaluate().isNotEmpty, + operation: 'discover the authoring workspace root', + ); + final sidebar = tester.widget( + find.byType(shared.GitFeatureSidebar), + ); + expect( + sidebar.view, + view == 'Git Log' + ? shared.GitSidebarView.log + : shared.GitSidebarView.commit, + ); + expect( + sidebar.controller.session.repository.root, + workspace.rootPath, + ); + expect(fixture.sharedClient.statusReads, greaterThan(0)); + expect(sidebar.trusted, isFalse); + expect( + container + .read(appSettingsControllerProvider) + .trustsGitWorkspace(workspace.rootPath), + isFalse, + ); + if (view == 'Git Log') { + expect(find.byType(shared.GitLogView), findsOneWidget); + await tester.tap( + find.byKey(const ValueKey('workspace-sidebar-view-menu')), + ); + await tester.pumpAndSettle(); + await menus.choose('Commit'); + } + expect(find.text(l10n.gitOperationsRequireTrust), findsOneWidget); + expect(find.byType(shared.GitCommitView), findsNothing); + await tester.tap(find.text(l10n.gitTrustWorkspace)); + await pumpUntil( + tester, + () => find.byType(shared.GitNativeDialog).evaluate().isNotEmpty, + operation: 'show explicit trust confirmation', + ); + expect( + container + .read(appSettingsControllerProvider) + .trustsGitWorkspace(workspace.rootPath), + isFalse, + ); + expect(find.textContaining(workspace.rootPath), findsOneWidget); + await tester.tap( + find.byKey(const ValueKey('busy-mark-git-trust-confirm')), + ); + await pumpUntil( + tester, + () => find.byType(shared.GitCommitView).evaluate().isNotEmpty, + operation: 'show authorized Commit after confirmation', + ); + expect( + container + .read(appSettingsControllerProvider) + .trustsGitWorkspace(workspace.rootPath), + isTrue, + ); + expect( + container.read(workspaceControllerProvider).activeBuffer, + same(buffer), + ); + expect(fixture.service.saveCount, 0); + expect(_comparisonTabs(container).entries, isEmpty); + expect(tester.takeException(), isNull); + }, + ); + + for (final outcome in ['non-Git', 'failure', 'ancestor', 'nested']) { + testWidgets( + '${kind.name} Sidebar selector opens $view with $outcome discovery UI', + (tester) async { + tester.view.physicalSize = const Size(1440, 1000); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + final fixture = await tabWorkspace( + tester, + git: true, + openGitComparisons: false, + trustGit: false, + repositoryDiscovered: false, + hasRepository: outcome != 'non-Git', + descendantWorkspace: outcome == 'ancestor', + nestedRepository: outcome == 'nested', + kind: kind, + ); + expect( + fixture.container.read(gitControllerProvider).repositoryInfo, + isNull, + ); + if (outcome == 'failure') { + fixture.sharedClient.discoveryError = const shared.GitException( + shared.GitErrorCode.disconnected, + ); + } + await _chooseNativeSidebar(tester, view); + await pumpUntil( + tester, + () => switch (outcome) { + 'non-Git' => + find.text(l10n.gitNotRepositoryMessage).evaluate().isNotEmpty, + 'failure' => + find.byType(shared.GitFailurePanel).evaluate().isNotEmpty, + _ => + find + .text(l10n.gitWorkspaceRootRequired) + .evaluate() + .isNotEmpty, + }, + operation: 'retain the existing $outcome discovery UI', + ); + expect(fixture.sharedClient.discoveryEntered.isCompleted, isTrue); + expect(fixture.sharedClient.statusReads, 0); + expect(find.byType(shared.GitCommitView), findsNothing); + expect(find.byType(shared.GitLogView), findsNothing); + expect(find.text(l10n.gitTrustWorkspace), findsNothing); + expect( + find.text(l10n.gitHostInitializeHere), + outcome == 'non-Git' ? findsOneWidget : findsNothing, + ); + expect( + find.text(l10n.gitHostCloneRepository2), + outcome == 'non-Git' ? findsOneWidget : findsNothing, + ); + expect(fixture.service.saveCount, 0); + expect(_comparisonTabs(fixture.container).entries, isEmpty); + expect(tester.takeException(), isNull); + }, + ); + } + } + } + testWidgets( 'a discovery retry leaves its failure state and reaches exclusive trust', (tester) async { @@ -22885,9 +23082,10 @@ class _DeferredWorkspaceSearchService extends WorkspaceService { } class _PresetGitController extends GitController { - _PresetGitController(this.initialState); + _PresetGitController(this.initialState, {this.initiallyDiscovered = true}); final GitState initialState; + final bool initiallyDiscovered; String? loadedFileHistoryPath; List stagedPaths = const []; int branchLoadCount = 0; @@ -22895,7 +23093,7 @@ class _PresetGitController extends GitController { int commitComparisonCount = 0; @override - GitState build() => initialState; + GitState build() => initiallyDiscovered ? initialState : const GitState(); void replaceStatus(GitStatusSnapshot status) { state = state.copyWith(statusSnapshot: status); @@ -22919,6 +23117,9 @@ class _PresetGitController extends GitController { // real association and metadata replacement have separate Git regressions. expect(repository.root, initialState.repositoryInfo!.rootPath); expect(repository.gitDir, initialState.repositoryInfo!.gitDirPath); + if (!initiallyDiscovered) { + state = initialState.copyWith(attachedWorkspace: workspace); + } } @override @@ -23832,6 +24033,7 @@ Future _chooseNativeSidebar(WidgetTester tester, String label) async { (entry) => (entry as Map)['label'] == label, ); expect(index, greaterThanOrEqualTo(0)); + expect((entries[index] as Map)['enabled'], isTrue); selected = true; return index; }); diff --git a/tools/git_sidebar_discovery_native.py b/tools/git_sidebar_discovery_native.py new file mode 100644 index 00000000..ca0baad5 --- /dev/null +++ b/tools/git_sidebar_discovery_native.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python3 +"""Exercise Git discovery through the shipping Sidebar selector on private X11. + +Requires BUSYSTACK_NATIVE_RECEIPT for the sealed binary. --installed uses the +ordinary confined Snap launcher and private profile/bus. --project copies a +local reproduction project, including its index and unsaved-on-disk changes. +""" +import argparse +import json +import os +from pathlib import Path +import shutil +import subprocess + +from git_native_smoke import DesktopRun +from sidebar_native_acceptance import wait_state + + +class SnapRun(DesktopRun): + def __init__(self, binary, output, repository, scale): + self.output = output + self.catalog = json.loads(Path('lib/l10n/app_en.arb').read_text()) + self.rtl = False + self.log = (output / 'desktop.log').open('w') + env = dict(os.environ, BUSYSTACK_NATIVE_APP_SETTINGS=str( + output / 'xdg_data_home/io.busystack.busymark/settings.json')) + self.process = subprocess.Popen([ + '/usr/bin/python3', 'tools/git_native_snap_session.py', + str(binary), str(output), str(repository), str(scale)], + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=self.log, + text=True, bufsize=1, env=env) + self.width, self.height = self.read(lambda value: 'pid' in value)['size'] + + +def visible(rows, text): + return any(row['showing'] and text in row['name'] for row in rows) + + +def select(desktop, view): + desktop.key('Control_L', 'Shift_L', 'F9') + rows = wait_state(desktop, lambda rows: any(row['showing'] and + row['role'] == 'check menu item' for row in rows), '_selector-open') + entries = [row for row in rows if row['showing'] and + row['role'] == 'check menu item'] + for label in ['Commit', 'Git Log']: + matches = [row for row in entries if row['name'] == label] + if len(matches) != 1 or not matches[0]['enabled']: + raise RuntimeError('Git entry unavailable before discovery: ' + label) + desktop.capture('selector-' + view.replace(' ', '-')) + desktop.key('c' if view == 'Commit' else 'g') + wait_state(desktop, lambda rows: not any(row['showing'] and + row['role'] == 'check menu item' for row in rows), '_selector-closed') + + +def run(binary, output, root, initial, outcome, installed): + output.mkdir(parents=True) + settings = output / 'xdg_data_home/io.busystack.busymark/settings.json' + settings.parent.mkdir(parents=True) + settings.write_text(json.dumps({'localeTag': 'en', 'autoSave': False, + 'sidebarVisible': True, 'documentViewMode': 'source', + 'trustedGitWorkspacePaths': []})) + os.environ['BUSYSTACK_NATIVE_PLAIN_DIRECTORY'] = '1' if outcome == 'plain' else '0' + desktop = (SnapRun if installed else DesktopRun)(binary, output, root, 1.0) + try: + select(desktop, initial) + catalog = desktop.catalog + if outcome in {'plain', 'ancestor'}: + messages = ([catalog[key] for key in ['gitNotRepositoryMessage', + 'gitHostInitializeHere', 'gitHostCloneRepository2']] + if outcome == 'plain' else [catalog['gitWorkspaceRootRequired']]) + for view in [initial, 'Git Log' if initial == 'Commit' else 'Commit']: + if view != initial: + select(desktop, view) + wait_state(desktop, lambda rows: all(visible(rows, message) + for message in messages), '_discovery-result') + desktop.capture('discovery-' + view.replace(' ', '-')) + else: + if initial == 'Git Log': + wait_state(desktop, lambda rows: visible(rows, + catalog['gitUiGitLog']), '_restricted-log') + desktop.capture('restricted-log') + select(desktop, 'Commit') + notice = catalog['gitOperationsRequireTrust'] + trust = catalog['gitTrustWorkspace'] + wait_state(desktop, lambda rows: visible(rows, notice), '_untrusted-commit') + desktop.capture('exclusive-trust-notice') + desktop.send('activateAccessible', name=trust) + wait_state(desktop, lambda rows: visible(rows, + catalog['gitTrustRequiredMessage']) and visible(rows, str(root)), + '_trust-confirmation') + desktop.capture('explicit-trust-confirmation') + desktop.send('activateAccessible', name=catalog['cancel']) + wait_state(desktop, lambda rows: visible(rows, notice) and + not visible(rows, catalog['gitTrustRequiredMessage']), '_trust-cancelled') + desktop.send('activateAccessible', name=trust) + wait_state(desktop, lambda rows: visible(rows, + catalog['gitTrustRequiredMessage']), '_trust-confirmation-again') + # The underlying notice and the modal both expose the same caption; + # keyboard confirmation targets the modal's suggested action. + desktop.key('Return') + wait_state(desktop, lambda rows: not visible(rows, notice) and + visible(rows, catalog['gitUiCommitAndPush']), '_trusted-commit') + desktop.capture('trusted-commit') + select(desktop, 'Git Log') + wait_state(desktop, lambda rows: visible(rows, + catalog['gitUiGitLog']), '_trusted-log') + desktop.capture('trusted-log') + desktop.close() + finally: + if desktop.process.poll() is None: + desktop.process.terminate() + desktop.process.wait(timeout=20) + desktop.log.close() + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('binary', type=Path) + parser.add_argument('output', type=Path) + parser.add_argument('--installed', action='store_true') + parser.add_argument('--project', type=Path) + args = parser.parse_args() + args.output = args.output.resolve() + args.output.mkdir(parents=True, exist_ok=True) + cases = [('markdown', False, 'git'), ('writerside', True, 'git'), + ('plain-markdown', False, 'plain'), ('plain-writerside', True, 'plain'), + ('ancestor-writerside', True, 'ancestor')] + if args.project: + cases.append(('project-copy', True, 'git')) + results = [] + for name, writerside, outcome in cases: + for initial in ['Commit', 'Git Log']: + case = args.output / (name + '-' + initial.replace(' ', '-')) + parent = case / 'fixture' + parent.mkdir(parents=True) + root = parent / 'workspace' + if name == 'project-copy': + shutil.copytree(args.project.expanduser(), root) + elif writerside: + shutil.copytree('test/fixtures/writerside/toc_ui', root) + else: + root.mkdir() + (root / 'home.md').write_text('# Git discovery acceptance\n') + if outcome != 'plain' and name != 'project-copy': + repository = parent if outcome == 'ancestor' else root + for command in [['init', '-b', 'main'], + ['-c', 'user.name=Discovery acceptance', '-c', + 'user.email=discovery@example.invalid', 'commit', + '--allow-empty', '--no-gpg-sign', '-m', 'Discovery fixture']]: + subprocess.run(['git', '-C', str(repository), *command], + check=True, stdout=subprocess.DEVNULL) + result = {'case': case.name, 'passed': False} + try: + run(args.binary.resolve(), case / 'native', root, initial, + outcome, args.installed) + result['passed'] = True + except Exception as error: + result['error'] = str(error) + results.append(result) + (args.output / 'results.json').write_text(json.dumps(results, indent=2)) + print(json.dumps(result), flush=True) + if not all(result['passed'] for result in results): + raise SystemExit('Git discovery native acceptance failed') + + +if __name__ == '__main__': + main() diff --git a/tools/view_selector_native_acceptance.py b/tools/view_selector_native_acceptance.py index 581ad78a..209ac141 100644 --- a/tools/view_selector_native_acceptance.py +++ b/tools/view_selector_native_acceptance.py @@ -150,7 +150,7 @@ def closed(): if [row['name'] for row in rows if row['checked']] != [previous_sidebar]: raise RuntimeError('Sidebar mnemonic did not activate its fixed view') matching = [row for row in rows if row['name'] == label] - available = (letter != 'T' or writerside) and (letter not in 'CG' or git) + available = letter != 'T' or writerside if available and (len(matching) != 1 or not matching[0]['enabled']): raise RuntimeError('Available native view is missing or disabled: ' + label) if not available and any(row['enabled'] for row in matching): @@ -160,6 +160,13 @@ def closed(): closed() desktop.capture('sidebar-' + letter) previous_sidebar = label + if letter in 'CG' and not git: + wait_state(desktop, lambda rows: all(any( + row['showing'] and text in row['name'] for row in rows) + for text in [desktop.catalog['gitNotRepositoryMessage'], + desktop.catalog['gitHostInitializeHere'], + desktop.catalog['gitHostCloneRepository2']]), + '_non-git-discovery-ready') else: wait_state(desktop, lambda rows: bool(menu_rows(rows)), '_unavailable-still-open') desktop.key('Escape'); closed() From 2ecd8446309ebcde810871156934e90d9064bca3 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 13 Nov 2026 18:44:58 -0700 Subject: [PATCH 2/7] test: preserve each native Git selector capture --- tools/git_sidebar_discovery_native.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/git_sidebar_discovery_native.py b/tools/git_sidebar_discovery_native.py index ca0baad5..a8d66a4e 100644 --- a/tools/git_sidebar_discovery_native.py +++ b/tools/git_sidebar_discovery_native.py @@ -46,7 +46,8 @@ def select(desktop, view): matches = [row for row in entries if row['name'] == label] if len(matches) != 1 or not matches[0]['enabled']: raise RuntimeError('Git entry unavailable before discovery: ' + label) - desktop.capture('selector-' + view.replace(' ', '-')) + desktop.selector_count = getattr(desktop, 'selector_count', 0) + 1 + desktop.capture(f'selector-{desktop.selector_count}-' + view.replace(' ', '-')) desktop.key('c' if view == 'Commit' else 'g') wait_state(desktop, lambda rows: not any(row['showing'] and row['role'] == 'check menu item' for row in rows), '_selector-closed') From af5807cbc9486cd1d4d51aa72d11523f8e3f91b4 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 13 Nov 2026 18:53:47 -0700 Subject: [PATCH 3/7] test: wait for workspace startup before native Git selection --- tools/git_sidebar_discovery_native.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/git_sidebar_discovery_native.py b/tools/git_sidebar_discovery_native.py index a8d66a4e..5c7b7935 100644 --- a/tools/git_sidebar_discovery_native.py +++ b/tools/git_sidebar_discovery_native.py @@ -3,7 +3,7 @@ Requires BUSYSTACK_NATIVE_RECEIPT for the sealed binary. --installed uses the ordinary confined Snap launcher and private profile/bus. --project copies a -local reproduction project, including its index and unsaved-on-disk changes. +local reproduction project, including its index and working files. """ import argparse import json @@ -37,6 +37,8 @@ def visible(rows, text): def select(desktop, view): + wait_state(desktop, lambda rows: visible(rows, + desktop.catalog['sidebarViewMenu']), '_sidebar-ready') desktop.key('Control_L', 'Shift_L', 'F9') rows = wait_state(desktop, lambda rows: any(row['showing'] and row['role'] == 'check menu item' for row in rows), '_selector-open') From 020ff40f3c78871b46c1e289a8a88fa3ff0e9961 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 13 Nov 2026 19:00:24 -0700 Subject: [PATCH 4/7] test: activate the explicit native trust confirmation --- tools/git_sidebar_discovery_native.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/git_sidebar_discovery_native.py b/tools/git_sidebar_discovery_native.py index 5c7b7935..ea3d7920 100644 --- a/tools/git_sidebar_discovery_native.py +++ b/tools/git_sidebar_discovery_native.py @@ -98,9 +98,7 @@ def run(binary, output, root, initial, outcome, installed): desktop.send('activateAccessible', name=trust) wait_state(desktop, lambda rows: visible(rows, catalog['gitTrustRequiredMessage']), '_trust-confirmation-again') - # The underlying notice and the modal both expose the same caption; - # keyboard confirmation targets the modal's suggested action. - desktop.key('Return') + desktop.send('activateAccessible', name=trust) wait_state(desktop, lambda rows: not visible(rows, notice) and visible(rows, catalog['gitUiCommitAndPush']), '_trusted-commit') desktop.capture('trusted-commit') From 3396085bd1737d55e4ad3bd0449777cf97efc184 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 13 Nov 2026 19:31:42 -0700 Subject: [PATCH 5/7] test: isolate plain Git discovery fixtures from checkout ancestors --- tools/git_sidebar_discovery_native.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/git_sidebar_discovery_native.py b/tools/git_sidebar_discovery_native.py index ea3d7920..0616aa18 100644 --- a/tools/git_sidebar_discovery_native.py +++ b/tools/git_sidebar_discovery_native.py @@ -11,6 +11,7 @@ from pathlib import Path import shutil import subprocess +import tempfile from git_native_smoke import DesktopRun from sidebar_native_acceptance import wait_state @@ -123,6 +124,12 @@ def main(): args = parser.parse_args() args.output = args.output.resolve() args.output.mkdir(parents=True, exist_ok=True) + # A plain fixture below this checkout would discover BusyMark's ancestor + # repository. Snap fixtures also need a path visible through confinement. + fixture_parent = Path.home() / 'snap/busymark/common' if args.installed else Path('/tmp') + fixture_parent.mkdir(parents=True, exist_ok=True) + fixtures = Path(tempfile.mkdtemp(prefix='git-sidebar-fixtures-', dir=fixture_parent)) + (args.output / 'fixtures-root.txt').write_text(str(fixtures)) cases = [('markdown', False, 'git'), ('writerside', True, 'git'), ('plain-markdown', False, 'plain'), ('plain-writerside', True, 'plain'), ('ancestor-writerside', True, 'ancestor')] @@ -132,7 +139,7 @@ def main(): for name, writerside, outcome in cases: for initial in ['Commit', 'Git Log']: case = args.output / (name + '-' + initial.replace(' ', '-')) - parent = case / 'fixture' + parent = fixtures / case.name parent.mkdir(parents=True) root = parent / 'workspace' if name == 'project-copy': From ff302eb5ca1db669d8b62633cfc75a79c132cb96 Mon Sep 17 00:00:00 2001 From: albert Date: Sat, 14 Nov 2026 01:48:39 -0700 Subject: [PATCH 6/7] chore: bump BusyMark version to 0.7.1 --- lib/src/app/app_metadata.dart | 2 +- linux/io.busystack.busymark.metainfo.xml | 1 + pubspec.yaml | 2 +- snap/snapcraft.yaml | 2 +- test/src/visualization_packaging_audit_test.dart | 6 +++--- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/src/app/app_metadata.dart b/lib/src/app/app_metadata.dart index 1761dcb9..ade34c77 100644 --- a/lib/src/app/app_metadata.dart +++ b/lib/src/app/app_metadata.dart @@ -1 +1 @@ -const busyMarkAppVersion = '0.7.0'; +const busyMarkAppVersion = '0.7.1'; diff --git a/linux/io.busystack.busymark.metainfo.xml b/linux/io.busystack.busymark.metainfo.xml index a5a1c4fd..39bc9634 100644 --- a/linux/io.busystack.busymark.metainfo.xml +++ b/linux/io.busystack.busymark.metainfo.xml @@ -88,6 +88,7 @@ https://github.com/busystack/busymark/issues + diff --git a/pubspec.yaml b/pubspec.yaml index 1884be72..5ec74aee 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: busymark description: Local-first Markdown and Writerside-compatible documentation editor. publish_to: 'none' -version: 0.7.0 +version: 0.7.1 environment: sdk: ">=3.12.1 <4.0.0" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 14b47211..8f2508b8 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ name: busymark title: BusyMark -version: "0.7.0" +version: "0.7.1" summary: Markdown and Writerside documentation editor # Snap Store listing translations are managed outside this Flutter package. # Update store metadata when approved translated listing text is supplied. diff --git a/test/src/visualization_packaging_audit_test.dart b/test/src/visualization_packaging_audit_test.dart index 668d4362..88279817 100644 --- a/test/src/visualization_packaging_audit_test.dart +++ b/test/src/visualization_packaging_audit_test.dart @@ -29,10 +29,10 @@ void main() { 'linux/io.busystack.busymark.metainfo.xml', ).readAsStringSync(); - expect(pubspec, contains(RegExp(r'^version: 0\.7\.0$', multiLine: true))); + expect(pubspec, contains(RegExp(r'^version: 0\.7\.1$', multiLine: true))); expect( snapcraft, - contains(RegExp(r'^version: "0\.7\.0"$', multiLine: true)), + contains(RegExp(r'^version: "0\.7\.1"$', multiLine: true)), ); expect(snapcraft, contains(RegExp(r'^grade: stable$', multiLine: true))); expect( @@ -59,7 +59,7 @@ void main() { ), ), ); - expect(metainfo, contains(' Date: Sat, 14 Nov 2026 04:41:41 -0700 Subject: [PATCH 7/7] test: settle Save As history before fixture cleanup --- test/src/local_history_workspace_test.dart | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test/src/local_history_workspace_test.dart b/test/src/local_history_workspace_test.dart index 6ffcdeb0..04db6ebe 100644 --- a/test/src/local_history_workspace_test.dart +++ b/test/src/local_history_workspace_test.dart @@ -3665,8 +3665,13 @@ void main() { test( 'cancelled named Save As detaches source history and reopens separately', () async { - final sourcePath = p.join(root.path, 'A.md'); - final destinationPath = p.join(root.path, 'B.md'); + // Keep the history store outside the watched authoring workspace, as in + // the application, so its staging renames are not external file moves. + final workspaceRoot = await Directory( + p.join(root.path, 'workspace'), + ).create(); + final sourcePath = p.join(workspaceRoot.path, 'A.md'); + final destinationPath = p.join(workspaceRoot.path, 'B.md'); await File(sourcePath).writeAsString('Original A\n'); final historyRoot = Directory(p.join(root.path, 'history')); final diskStore = FileLocalHistoryStore( @@ -3688,6 +3693,12 @@ void main() { final history = harness.container.read( localHistoryControllerProvider.notifier, ); + // Provider disposal cancels future work but cannot await accepted I/O. + // Settle it before disposing either controller or deleting historyRoot. + addTearDown(() async { + expect(await history.flushAll(harness.state.documentBuffers), isTrue); + await harness.controller.flushPersistence(); + }); await harness.controller.openPath(sourcePath); final sourceId = (await diskStore.load()).documents.single.id; harness.controller.updateActiveText('Save As B\n'); @@ -3772,6 +3783,13 @@ void main() { final reopenedHistory = reopened.container.read( localHistoryControllerProvider.notifier, ); + addTearDown(() async { + expect( + await reopenedHistory.flushAll(reopened.state.documentBuffers), + isTrue, + ); + await reopened.controller.flushPersistence(); + }); await reopened.controller.openPath(sourcePath); await _waitFor( () =>