Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/app/app_metadata.dart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const busyMarkAppVersion = '0.7.0';
const busyMarkAppVersion = '0.7.1';
4 changes: 2 additions & 2 deletions lib/src/workspace/presentation/workspace_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions linux/io.busystack.busymark.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<url type="bugtracker">https://github.com/busystack/busymark/issues</url>
<content_rating type="oars-1.1" />
<releases>
<release version="0.7.1" date="2026-11-14" />
<release version="0.7.0" date="2026-10-22" />
<release version="0.6.3" date="2026-10-15" />
<release version="0.6.2" date="2026-10-08" />
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
214 changes: 208 additions & 6 deletions test/src/app_smoke_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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_');
Expand All @@ -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<void>();
final container = ProviderContainer(
overrides: [
Expand Down Expand Up @@ -7717,7 +7726,10 @@ code
startupPathProvider.overrideWithValue(workspaceRoot),
if (git)
gitControllerProvider.overrideWith(
() => _PresetGitController(_gitDiffState(temp.path)),
() => _PresetGitController(
gitState,
initiallyDiscovered: repositoryDiscovered,
),
),
],
);
Expand Down Expand Up @@ -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<shared.GitFeatureSidebar>(
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 {
Expand Down Expand Up @@ -22885,17 +23082,18 @@ 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<String> stagedPaths = const [];
int branchLoadCount = 0;
int compareWithCurrentCount = 0;
int commitComparisonCount = 0;

@override
GitState build() => initialState;
GitState build() => initiallyDiscovered ? initialState : const GitState();

void replaceStatus(GitStatusSnapshot status) {
state = state.copyWith(statusSnapshot: status);
Expand All @@ -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
Expand Down Expand Up @@ -23832,6 +24033,7 @@ Future<void> _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;
});
Expand Down
22 changes: 20 additions & 2 deletions test/src/local_history_workspace_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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');
Expand Down Expand Up @@ -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(
() =>
Expand Down
6 changes: 3 additions & 3 deletions test/src/visualization_packaging_audit_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -59,7 +59,7 @@ void main() {
),
),
);
expect(metainfo, contains('<release version="0.7.0"'));
expect(metainfo, contains('<release version="0.7.1"'));
expect(pubspec, isNot(contains('0.6.11')));
expect(snapcraft, isNot(contains('0.6.11')));
});
Expand Down
Loading
Loading