sheets view: add refresh button for annotations
Build and deploy the latest docker container / deploy (push) Successful in 1m22s
Build and release the latest android apk / rolling-release-apk (push) Successful in 5m25s

This commit is contained in:
2026-07-04 11:26:04 +02:00
parent 984e32cd03
commit 416979ab3d
2 changed files with 44 additions and 9 deletions
@@ -15,24 +15,26 @@ class AnnotationSyncService {
AnnotationSyncService({
required ApiClient apiClient,
required StorageService storageService,
}) : _apiClient = apiClient,
_storageService = storageService;
}) : _apiClient = apiClient,
_storageService = storageService;
/// Downloads annotations from server and merges with local storage.
///
/// For each page, compares server's lastModified with local lastModified.
/// If server is newer, overwrites local. Local annotations that are newer
/// are preserved.
Future<void> syncFromServer(String sheetUuid) async {
Future<void> syncAnnotationsFromServer(String sheetUuid) async {
try {
_log.info('Syncing annotations from server for sheet $sheetUuid');
// Fetch all annotations from server
final serverAnnotations = await _apiClient.fetchAnnotations(sheetUuid);
_log.fine('Fetched annotations from server for sheet $sheetUuid');
// Get all local annotations with metadata
final localAnnotations =
await _storageService.readAllAnnotationsWithMetadata(sheetUuid);
final localAnnotations = await _storageService
.readAllAnnotationsWithMetadata(sheetUuid);
int updatedCount = 0;
@@ -118,7 +120,8 @@ class AnnotationSyncService {
return false;
} catch (e) {
_log.warning(
'Unexpected error uploading annotation, queuing for later: $e');
'Unexpected error uploading annotation, queuing for later: $e',
);
await _queueForLaterUpload(
sheetUuid: sheetUuid,
page: page,