remove logging
parent
47f6ee2fe8
commit
ec28044fa9
|
|
@ -226,11 +226,6 @@ class TimelineService {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> dispose() async {
|
Future<void> dispose() async {
|
||||||
// #region agent log (H6 device)
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] TimelineService.dispose origin=$origin totalAssets=$_totalAssets bufferLen=${_buffer.length} bufferOffset=$_bufferOffset',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
await _bucketSubscription?.cancel();
|
await _bucketSubscription?.cancel();
|
||||||
_bucketSubscription = null;
|
_bucketSubscription = null;
|
||||||
_buffer = [];
|
_buffer = [];
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,6 @@ import 'package:logging/logging.dart';
|
||||||
import 'package:timezone/data/latest.dart';
|
import 'package:timezone/data/latest.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
// #region agent log (VERIFY device)
|
|
||||||
// This MUST show in `flutter run -d Phone` output immediately after hot restart.
|
|
||||||
// If you don't see it, you're not running the updated build.
|
|
||||||
print('[AGENT_LOG] main.dart:main ENTER ts=${DateTime.now().toIso8601String()}');
|
|
||||||
// #endregion
|
|
||||||
ImmichWidgetsBinding();
|
ImmichWidgetsBinding();
|
||||||
unawaited(BackgroundWorkerLockService(BackgroundWorkerLockApi()).lock());
|
unawaited(BackgroundWorkerLockService(BackgroundWorkerLockApi()).lock());
|
||||||
final (isar, drift, logDb) = await Bootstrap.initDB();
|
final (isar, drift, logDb) = await Bootstrap.initDB();
|
||||||
|
|
@ -72,10 +67,6 @@ void main() async {
|
||||||
child: const MainWidget(),
|
child: const MainWidget(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// #region agent log (VERIFY device)
|
|
||||||
print('[AGENT_LOG] main.dart:main AFTER runApp ts=${DateTime.now().toIso8601String()}');
|
|
||||||
// #endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initApp() async {
|
Future<void> initApp() async {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
|
|
@ -58,72 +57,6 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
// #region agent log helper
|
|
||||||
void _agentLog({
|
|
||||||
required String hypothesisId,
|
|
||||||
required String location,
|
|
||||||
required String message,
|
|
||||||
Map<String, Object?> data = const {},
|
|
||||||
}) {
|
|
||||||
// Print to console as immediate verification
|
|
||||||
print('[AGENT_LOG] $location: $message');
|
|
||||||
// Best-effort logging only; never throw from UI code.
|
|
||||||
() async {
|
|
||||||
try {
|
|
||||||
final logEntry = jsonEncode({
|
|
||||||
'sessionId': 'debug-session',
|
|
||||||
'runId': 'run1',
|
|
||||||
'hypothesisId': hypothesisId,
|
|
||||||
'location': location,
|
|
||||||
'message': message,
|
|
||||||
'data': data,
|
|
||||||
'timestamp': DateTime.now().millisecondsSinceEpoch,
|
|
||||||
});
|
|
||||||
// Write directly to file (Dart/Flutter approach)
|
|
||||||
try {
|
|
||||||
final file = File('/Users/timonthegoat/code/oss/immich/.cursor/debug.log');
|
|
||||||
await file.writeAsString('$logEntry\n', mode: FileMode.append, flush: true);
|
|
||||||
print('[AGENT_LOG] File write SUCCESS: $location');
|
|
||||||
} catch (e) {
|
|
||||||
print('[AGENT_LOG] File write FAILED: $location - $e');
|
|
||||||
}
|
|
||||||
// Also try HTTP as backup
|
|
||||||
try {
|
|
||||||
final client = HttpClient();
|
|
||||||
final req = await client.postUrl(
|
|
||||||
Uri.parse('http://127.0.0.1:7242/ingest/9f2496b1-d42f-425c-9b63-abfeb2cdbe71'),
|
|
||||||
);
|
|
||||||
req.headers.contentType = ContentType.json;
|
|
||||||
req.write(logEntry);
|
|
||||||
await req.close();
|
|
||||||
client.close(force: true);
|
|
||||||
print('[AGENT_LOG] HTTP write SUCCESS: $location');
|
|
||||||
} catch (e) {
|
|
||||||
print('[AGENT_LOG] HTTP write FAILED: $location - $e');
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
print('[AGENT_LOG] Logging error: $e');
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
}
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
// #region agent log (VERIFY) - immediate entry point
|
|
||||||
_agentLog(
|
|
||||||
hypothesisId: 'VERIFY',
|
|
||||||
location: 'gallery_viewer.page.dart:build:ENTRY',
|
|
||||||
message: 'GalleryViewer build ENTRY - logging system test',
|
|
||||||
data: {'test': true, 'timestamp': DateTime.now().toIso8601String()},
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
// #region agent log (VERIFY device) - plain print (no async/file/http)
|
|
||||||
// This MUST appear in `flutter run` output as soon as the viewer route builds.
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] gallery_viewer.page.dart:ENTRY_PRINT isIOS=${Platform.isIOS} orientation=${MediaQuery.orientationOf(context).name} size=${MediaQuery.sizeOf(context).width}x${MediaQuery.sizeOf(context).height}',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
final totalAssets = useState(renderList.totalAssets);
|
final totalAssets = useState(renderList.totalAssets);
|
||||||
final isZoomed = useState(false);
|
final isZoomed = useState(false);
|
||||||
final stackIndex = useState(0);
|
final stackIndex = useState(0);
|
||||||
|
|
@ -132,25 +65,6 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
final loadAsset = renderList.loadAsset;
|
final loadAsset = renderList.loadAsset;
|
||||||
final isPlayingMotionVideo = ref.watch(isPlayingMotionVideoProvider);
|
final isPlayingMotionVideo = ref.watch(isPlayingMotionVideoProvider);
|
||||||
final isCasting = ref.watch(castProvider.select((c) => c.isCasting));
|
final isCasting = ref.watch(castProvider.select((c) => c.isCasting));
|
||||||
final showControls = ref.watch(showControlsProvider);
|
|
||||||
|
|
||||||
// #region agent log (H1) build snapshot
|
|
||||||
_agentLog(
|
|
||||||
hypothesisId: 'H1',
|
|
||||||
location: 'gallery_viewer.page.dart:build',
|
|
||||||
message: 'GalleryViewer build',
|
|
||||||
data: {
|
|
||||||
'isIOS': Platform.isIOS,
|
|
||||||
'orientation': MediaQuery.orientationOf(context).name,
|
|
||||||
'size': {'w': MediaQuery.sizeOf(context).width, 'h': MediaQuery.sizeOf(context).height},
|
|
||||||
'devicePixelRatio': MediaQuery.devicePixelRatioOf(context),
|
|
||||||
'showControls': showControls,
|
|
||||||
'isZoomed': isZoomed.value,
|
|
||||||
'currentIndex': currentIndex.value,
|
|
||||||
'totalAssets': totalAssets.value,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
final videoPlayerKeys = useRef<Map<int, GlobalKey>>({});
|
final videoPlayerKeys = useRef<Map<int, GlobalKey>>({});
|
||||||
|
|
||||||
|
|
@ -193,21 +107,6 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
|
||||||
}
|
}
|
||||||
|
|
||||||
// #region agent log (H1) init ui mode
|
|
||||||
_agentLog(
|
|
||||||
hypothesisId: 'H1',
|
|
||||||
location: 'gallery_viewer.page.dart:useEffect(init)',
|
|
||||||
message: 'Initial SystemChrome.setEnabledSystemUIMode',
|
|
||||||
data: {
|
|
||||||
'initialShowControls': initialShowControls,
|
|
||||||
'mode': (initialShowControls ? SystemUiMode.edgeToEdge : SystemUiMode.immersive).name,
|
|
||||||
'isIOS': Platform.isIOS,
|
|
||||||
'orientation': MediaQuery.orientationOf(context).name,
|
|
||||||
'size': {'w': MediaQuery.sizeOf(context).width, 'h': MediaQuery.sizeOf(context).height},
|
|
||||||
},
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
// Delay this a bit so we can finish loading the page
|
// Delay this a bit so we can finish loading the page
|
||||||
Timer(const Duration(milliseconds: 400), () {
|
Timer(const Duration(milliseconds: 400), () {
|
||||||
precacheNextImage(currentIndex.value + 1);
|
precacheNextImage(currentIndex.value + 1);
|
||||||
|
|
@ -304,22 +203,6 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
ref.listen(showControlsProvider, (_, show) {
|
ref.listen(showControlsProvider, (_, show) {
|
||||||
// #region agent log (H1) controls -> system ui mode
|
|
||||||
_agentLog(
|
|
||||||
hypothesisId: 'H1',
|
|
||||||
location: 'gallery_viewer.page.dart:ref.listen(showControlsProvider)',
|
|
||||||
message: 'showControls changed; applying SystemChrome mode',
|
|
||||||
data: {
|
|
||||||
'show': show,
|
|
||||||
'isIOS': Platform.isIOS,
|
|
||||||
'willSetMode': (show || Platform.isIOS ? SystemUiMode.edgeToEdge : SystemUiMode.immersive).name,
|
|
||||||
'orientation': MediaQuery.orientationOf(context).name,
|
|
||||||
'size': {'w': MediaQuery.sizeOf(context).width, 'h': MediaQuery.sizeOf(context).height},
|
|
||||||
'currentIndex': currentIndex.value,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
if (show || Platform.isIOS) {
|
if (show || Platform.isIOS) {
|
||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
return;
|
return;
|
||||||
|
|
@ -340,32 +223,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
handleSwipeUpDown(details);
|
handleSwipeUpDown(details);
|
||||||
},
|
},
|
||||||
onTapDown: (_, __, ___) {
|
onTapDown: (_, __, ___) {
|
||||||
final prev = ref.read(showControlsProvider);
|
|
||||||
ref.read(showControlsProvider.notifier).toggle();
|
ref.read(showControlsProvider.notifier).toggle();
|
||||||
final next = ref.read(showControlsProvider);
|
|
||||||
// #region agent log (H1) user tapped to toggle controls
|
|
||||||
_agentLog(
|
|
||||||
hypothesisId: 'H1',
|
|
||||||
location: 'gallery_viewer.page.dart:buildImage.onTapDown',
|
|
||||||
message: 'Tap to toggle viewer controls',
|
|
||||||
data: {
|
|
||||||
'prev': prev,
|
|
||||||
'next': next,
|
|
||||||
'isIOS': Platform.isIOS,
|
|
||||||
'orientation': MediaQuery.orientationOf(context).name,
|
|
||||||
'size': {'w': MediaQuery.sizeOf(context).width, 'h': MediaQuery.sizeOf(context).height},
|
|
||||||
'asset': {
|
|
||||||
'id': asset.id,
|
|
||||||
'type': asset.type.toString(),
|
|
||||||
'isRemote': asset.isRemote,
|
|
||||||
'isLocal': asset.isLocal,
|
|
||||||
'remoteIdPresent': asset.remoteId != null,
|
|
||||||
'localIdPresent': asset.localId != null,
|
|
||||||
},
|
|
||||||
'currentIndex': currentIndex.value,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
},
|
},
|
||||||
onLongPressStart: asset.isMotionPhoto
|
onLongPressStart: asset.isMotionPhoto
|
||||||
? (_, __, ___) {
|
? (_, __, ___) {
|
||||||
|
|
@ -423,56 +281,8 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newAsset.isImage && !isPlayingMotionVideo) {
|
if (newAsset.isImage && !isPlayingMotionVideo) {
|
||||||
// #region agent log (H5) asset builder for current page
|
|
||||||
if (index == currentIndex.value) {
|
|
||||||
_agentLog(
|
|
||||||
hypothesisId: 'H5',
|
|
||||||
location: 'gallery_viewer.page.dart:buildAsset',
|
|
||||||
message: 'Built page options for current index (image path)',
|
|
||||||
data: {
|
|
||||||
'index': index,
|
|
||||||
'isIOS': Platform.isIOS,
|
|
||||||
'orientation': MediaQuery.orientationOf(context).name,
|
|
||||||
'size': {'w': MediaQuery.sizeOf(context).width, 'h': MediaQuery.sizeOf(context).height},
|
|
||||||
'showControls': ref.read(showControlsProvider),
|
|
||||||
'isZoomed': isZoomed.value,
|
|
||||||
'asset': {
|
|
||||||
'id': newAsset.id,
|
|
||||||
'type': newAsset.type.toString(),
|
|
||||||
'isRemote': newAsset.isRemote,
|
|
||||||
'isLocal': newAsset.isLocal,
|
|
||||||
'stackIdPresent': newAsset.stackId != null,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// #endregion
|
|
||||||
return buildImage(newAsset);
|
return buildImage(newAsset);
|
||||||
}
|
}
|
||||||
// #region agent log (H5) asset builder for current page (video path)
|
|
||||||
if (index == currentIndex.value) {
|
|
||||||
_agentLog(
|
|
||||||
hypothesisId: 'H5',
|
|
||||||
location: 'gallery_viewer.page.dart:buildAsset',
|
|
||||||
message: 'Built page options for current index (video path)',
|
|
||||||
data: {
|
|
||||||
'index': index,
|
|
||||||
'isIOS': Platform.isIOS,
|
|
||||||
'orientation': MediaQuery.orientationOf(context).name,
|
|
||||||
'size': {'w': MediaQuery.sizeOf(context).width, 'h': MediaQuery.sizeOf(context).height},
|
|
||||||
'showControls': ref.read(showControlsProvider),
|
|
||||||
'isZoomed': isZoomed.value,
|
|
||||||
'asset': {
|
|
||||||
'id': newAsset.id,
|
|
||||||
'type': newAsset.type.toString(),
|
|
||||||
'isRemote': newAsset.isRemote,
|
|
||||||
'isLocal': newAsset.isLocal,
|
|
||||||
'stackIdPresent': newAsset.stackId != null,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// #endregion
|
|
||||||
return buildVideo(context, newAsset);
|
return buildVideo(context, newAsset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -499,29 +309,6 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
gaplessPlayback: true,
|
gaplessPlayback: true,
|
||||||
loadingBuilder: (context, event, index) {
|
loadingBuilder: (context, event, index) {
|
||||||
final asset = loadAsset(index);
|
final asset = loadAsset(index);
|
||||||
// #region agent log (H2) stuck on loading builder
|
|
||||||
if (index == currentIndex.value) {
|
|
||||||
_agentLog(
|
|
||||||
hypothesisId: 'H2',
|
|
||||||
location: 'gallery_viewer.page.dart:PhotoViewGallery.loadingBuilder',
|
|
||||||
message: 'PhotoViewGallery loadingBuilder for current index',
|
|
||||||
data: {
|
|
||||||
'index': index,
|
|
||||||
'isIOS': Platform.isIOS,
|
|
||||||
'orientation': MediaQuery.orientationOf(context).name,
|
|
||||||
'size': {'w': MediaQuery.sizeOf(context).width, 'h': MediaQuery.sizeOf(context).height},
|
|
||||||
'showControls': ref.read(showControlsProvider),
|
|
||||||
'isZoomed': isZoomed.value,
|
|
||||||
'asset': {
|
|
||||||
'id': asset.id,
|
|
||||||
'type': asset.type.toString(),
|
|
||||||
'isRemote': asset.isRemote,
|
|
||||||
'isLocal': asset.isLocal,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// #endregion
|
|
||||||
return ClipRect(
|
return ClipRect(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
fit: StackFit.expand,
|
fit: StackFit.expand,
|
||||||
|
|
@ -542,19 +329,6 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
itemCount: totalAssets.value,
|
itemCount: totalAssets.value,
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
onPageChanged: (value, _) {
|
onPageChanged: (value, _) {
|
||||||
// #region agent log (VERIFY) page changed
|
|
||||||
_agentLog(
|
|
||||||
hypothesisId: 'VERIFY',
|
|
||||||
location: 'gallery_viewer.page.dart:onPageChanged',
|
|
||||||
message: 'PhotoViewGallery page changed',
|
|
||||||
data: {
|
|
||||||
'from': currentIndex.value,
|
|
||||||
'to': value,
|
|
||||||
'isIOS': Platform.isIOS,
|
|
||||||
'orientation': MediaQuery.orientationOf(context).name,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
final next = currentIndex.value < value ? value + 1 : value - 1;
|
final next = currentIndex.value < value ? value + 1 : value - 1;
|
||||||
|
|
||||||
ref.read(hapticFeedbackProvider.notifier).selectionClick();
|
ref.read(hapticFeedbackProvider.notifier).selectionClick();
|
||||||
|
|
|
||||||
|
|
@ -151,24 +151,11 @@ class MapPage extends HookConsumerWidget {
|
||||||
Future<void> onMarkerTapped() async {
|
Future<void> onMarkerTapped() async {
|
||||||
final assetId = selectedMarker.value?.marker.assetRemoteId;
|
final assetId = selectedMarker.value?.marker.assetRemoteId;
|
||||||
if (assetId == null) {
|
if (assetId == null) {
|
||||||
// #region agent log (VERIFY device)
|
|
||||||
// Device-friendly runtime evidence: prints show up in `flutter run` output.
|
|
||||||
print('[AGENT_LOG] map.page.dart:onMarkerTapped assetId=null');
|
|
||||||
// #endregion
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// #region agent log (VERIFY device)
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] map.page.dart:onMarkerTapped start assetId=$assetId orientation=${MediaQuery.orientationOf(context).name} size=${MediaQuery.sizeOf(context).width}x${MediaQuery.sizeOf(context).height}',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
final asset = await ref.read(dbProvider).assets.getByRemoteId(assetId);
|
final asset = await ref.read(dbProvider).assets.getByRemoteId(assetId);
|
||||||
if (asset == null) {
|
if (asset == null) {
|
||||||
// #region agent log (VERIFY device)
|
|
||||||
print('[AGENT_LOG] map.page.dart:onMarkerTapped asset not found in db remoteId=$assetId');
|
|
||||||
// #endregion
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -179,11 +166,6 @@ class MapPage extends HookConsumerWidget {
|
||||||
if (asset.isVideo) {
|
if (asset.isVideo) {
|
||||||
ref.read(showControlsProvider.notifier).show = false;
|
ref.read(showControlsProvider.notifier).show = false;
|
||||||
}
|
}
|
||||||
// #region agent log (VERIFY device)
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] map.page.dart:onMarkerTapped push GalleryViewerRoute assetType=${asset.type} isVideo=${asset.isVideo} isRemote=${asset.isRemote} isLocal=${asset.isLocal}',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
unawaited(context.pushRoute(GalleryViewerRoute(initialIndex: 0, heroOffset: 0, renderList: renderList)));
|
unawaited(context.pushRoute(GalleryViewerRoute(initialIndex: 0, heroOffset: 0, renderList: renderList)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -376,17 +376,7 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
|
||||||
|
|
||||||
void _onTapDown(_, __, ___) {
|
void _onTapDown(_, __, ___) {
|
||||||
if (!showingBottomSheet) {
|
if (!showingBottomSheet) {
|
||||||
// #region agent log (H1 device)
|
|
||||||
final before = ref.read(assetViewerProvider.select((s) => s.showingControls));
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] asset_viewer.page.dart:_onTapDown toggleControls before=$before orientation=${MediaQuery.orientationOf(context).name} size=${MediaQuery.sizeOf(context).width}x${MediaQuery.sizeOf(context).height}',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
ref.read(assetViewerProvider.notifier).toggleControls();
|
ref.read(assetViewerProvider.notifier).toggleControls();
|
||||||
// #region agent log (H1 device)
|
|
||||||
final after = ref.read(assetViewerProvider.select((s) => s.showingControls));
|
|
||||||
print('[AGENT_LOG] asset_viewer.page.dart:_onTapDown toggleControls after=$after');
|
|
||||||
// #endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -526,12 +516,6 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _placeholderBuilder(BuildContext ctx, ImageChunkEvent? progress, int index) {
|
Widget _placeholderBuilder(BuildContext ctx, ImageChunkEvent? progress, int index) {
|
||||||
// #region agent log (H2 device)
|
|
||||||
final show = ref.read(assetViewerProvider.select((s) => s.showingControls));
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] asset_viewer.page.dart:PhotoViewGallery.loadingBuilder index=$index showControls=$show orientation=${MediaQuery.orientationOf(ctx).name} size=${MediaQuery.sizeOf(ctx).width}x${MediaQuery.sizeOf(ctx).height} progress=${progress == null ? "null" : "${progress.cumulativeBytesLoaded}/${progress.expectedTotalBytes}"}',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
return const Center(child: ImmichLoadingIndicator());
|
return const Center(child: ImmichLoadingIndicator());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -552,12 +536,6 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
|
||||||
|
|
||||||
// If asset is not available in buffer, return a placeholder
|
// If asset is not available in buffer, return a placeholder
|
||||||
if (asset == null) {
|
if (asset == null) {
|
||||||
// #region agent log (H6 device)
|
|
||||||
final show = ref.read(assetViewerProvider.select((s) => s.showingControls));
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] asset_viewer.page.dart:_assetBuilder asset=null index=$index totalAssets=${timelineService.totalAssets} showControls=$show orientation=${MediaQuery.orientationOf(ctx).name} size=${MediaQuery.sizeOf(ctx).width}x${MediaQuery.sizeOf(ctx).height}',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
return PhotoViewGalleryPageOptions.customChild(
|
return PhotoViewGalleryPageOptions.customChild(
|
||||||
heroAttributes: PhotoViewHeroAttributes(tag: 'loading_$index'),
|
heroAttributes: PhotoViewHeroAttributes(tag: 'loading_$index'),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
@ -569,14 +547,6 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// #region agent log (H6 device)
|
|
||||||
if (index == (pageController.hasClients ? pageController.page?.round() : null)) {
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] asset_viewer.page.dart:_assetBuilder asset!=null index=$index heroTag=${asset.heroTag} type=${asset.type} hasLocal=${asset.hasLocal} hasRemote=${asset.hasRemote}',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
BaseAsset displayAsset = asset;
|
BaseAsset displayAsset = asset;
|
||||||
final stackChildren = ref.read(stackChildrenNotifier(asset)).valueOrNull;
|
final stackChildren = ref.read(stackChildrenNotifier(asset)).valueOrNull;
|
||||||
if (stackChildren != null && stackChildren.isNotEmpty) {
|
if (stackChildren != null && stackChildren.isNotEmpty) {
|
||||||
|
|
@ -676,11 +646,6 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
|
||||||
|
|
||||||
// Listen for control visibility changes and change system UI mode accordingly
|
// Listen for control visibility changes and change system UI mode accordingly
|
||||||
ref.listen(assetViewerProvider.select((value) => value.showingControls), (_, showingControls) async {
|
ref.listen(assetViewerProvider.select((value) => value.showingControls), (_, showingControls) async {
|
||||||
// #region agent log (H1 device)
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] asset_viewer.page.dart:showingControlsChanged=$showingControls -> SystemUiMode=${(showingControls ? SystemUiMode.edgeToEdge : SystemUiMode.immersiveSticky).name} orientation=${MediaQuery.orientationOf(context).name} size=${MediaQuery.sizeOf(context).width}x${MediaQuery.sizeOf(context).height}',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
if (showingControls) {
|
if (showingControls) {
|
||||||
unawaited(SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge));
|
unawaited(SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -64,11 +64,6 @@ class LocalFullImageProvider extends CancellableImageProvider<LocalFullImageProv
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void cancel() {
|
void cancel() {
|
||||||
// #region agent log (H7 device)
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] LocalFullImageProvider.cancel id=$id size=${size.width}x${size.height} isCancelledWas=$isCancelled',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
super.cancel();
|
super.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,11 +74,6 @@ class LocalFullImageProvider extends CancellableImageProvider<LocalFullImageProv
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ImageStreamCompleter loadImage(LocalFullImageProvider key, ImageDecoderCallback decode) {
|
ImageStreamCompleter loadImage(LocalFullImageProvider key, ImageDecoderCallback decode) {
|
||||||
// #region agent log (H7 device)
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] LocalFullImageProvider.loadImage id=${key.id} size=${key.size.width}x${key.size.height} isCancelled=$isCancelled keyHash=${key.hashCode} instHash=${hashCode}',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
return OneFramePlaceholderImageStreamCompleter(
|
return OneFramePlaceholderImageStreamCompleter(
|
||||||
_codec(key, decode),
|
_codec(key, decode),
|
||||||
initialImage: getInitialImage(LocalThumbProvider(id: key.id, assetType: key.assetType)),
|
initialImage: getInitialImage(LocalThumbProvider(id: key.id, assetType: key.assetType)),
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,6 @@ class RemoteFullImageProvider extends CancellableImageProvider<RemoteFullImagePr
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void cancel() {
|
void cancel() {
|
||||||
// #region agent log (H7 device)
|
|
||||||
print('[AGENT_LOG] RemoteFullImageProvider.cancel assetId=$assetId isCancelledWas=$isCancelled');
|
|
||||||
// #endregion
|
|
||||||
super.cancel();
|
super.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,11 +77,6 @@ class RemoteFullImageProvider extends CancellableImageProvider<RemoteFullImagePr
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ImageStreamCompleter loadImage(RemoteFullImageProvider key, ImageDecoderCallback decode) {
|
ImageStreamCompleter loadImage(RemoteFullImageProvider key, ImageDecoderCallback decode) {
|
||||||
// #region agent log (H7 device)
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] RemoteFullImageProvider.loadImage assetId=${key.assetId} isCancelled=$isCancelled keyHash=${key.hashCode} instHash=${hashCode}',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
return OneFramePlaceholderImageStreamCompleter(
|
return OneFramePlaceholderImageStreamCompleter(
|
||||||
_codec(key, decode),
|
_codec(key, decode),
|
||||||
initialImage: getInitialImage(RemoteThumbProvider(assetId: key.assetId)),
|
initialImage: getInitialImage(RemoteThumbProvider(assetId: key.assetId)),
|
||||||
|
|
|
||||||
|
|
@ -116,16 +116,13 @@ class _DriftMapState extends ConsumerState<DriftMap> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// #region agent log (H6 device)
|
|
||||||
// When the AssetViewer is open, the DriftMap route stays alive in the background.
|
// When the AssetViewer is open, the DriftMap route stays alive in the background.
|
||||||
// If we continue to update bounds, the map-scoped timeline service gets recreated and the previous one disposed,
|
// If we continue to update bounds, the map-scoped timeline service gets recreated and the previous one disposed,
|
||||||
// which can invalidate the TimelineService instance that was passed into AssetViewerRoute (causing "loading forever").
|
// which can invalidate the TimelineService instance that was passed into AssetViewerRoute (causing "loading forever").
|
||||||
final currentRoute = ref.read(currentRouteNameProvider);
|
final currentRoute = ref.read(currentRouteNameProvider);
|
||||||
if (currentRoute == AssetViewerRoute.name || currentRoute == GalleryViewerRoute.name) {
|
if (currentRoute == AssetViewerRoute.name || currentRoute == GalleryViewerRoute.name) {
|
||||||
print('[AGENT_LOG] DriftMap.setBounds SKIP currentRoute=$currentRoute');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// #endregion
|
|
||||||
|
|
||||||
final bounds = await controller.getVisibleRegion();
|
final bounds = await controller.getVisibleRegion();
|
||||||
unawaited(
|
unawaited(
|
||||||
|
|
|
||||||
|
|
@ -155,11 +155,6 @@ class _AssetTileWidget extends ConsumerWidget {
|
||||||
if (multiSelectState.forceEnable || multiSelectState.isEnabled) {
|
if (multiSelectState.forceEnable || multiSelectState.isEnabled) {
|
||||||
ref.read(multiSelectProvider.notifier).toggleAssetSelection(asset);
|
ref.read(multiSelectProvider.notifier).toggleAssetSelection(asset);
|
||||||
} else {
|
} else {
|
||||||
// #region agent log (VERIFY device)
|
|
||||||
print(
|
|
||||||
'[AGENT_LOG] timeline.assetTile:onTap open AssetViewerRoute index=$assetIndex assetType=${asset.type} isRemote=${asset is RemoteAsset} heroOffset=$heroOffset',
|
|
||||||
);
|
|
||||||
// #endregion
|
|
||||||
await ref.read(timelineServiceProvider).loadAssets(assetIndex, 1);
|
await ref.read(timelineServiceProvider).loadAssets(assetIndex, 1);
|
||||||
ref.read(isPlayingMotionVideoProvider.notifier).playing = false;
|
ref.read(isPlayingMotionVideoProvider.notifier).playing = false;
|
||||||
AssetViewer.setAsset(ref, asset);
|
AssetViewer.setAsset(ref, asset);
|
||||||
|
|
|
||||||
|
|
@ -19,17 +19,6 @@ class AppNavigationObserver extends AutoRouterObserver {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didPush(Route route, Route? previousRoute) {
|
void didPush(Route route, Route? previousRoute) {
|
||||||
// #region agent log (VERIFY device)
|
|
||||||
// Keep this targeted to reduce noise; we care about the Places -> (Drift)Map -> AssetViewer flow.
|
|
||||||
final name = route.settings.name;
|
|
||||||
final prev = previousRoute?.settings.name;
|
|
||||||
if (name == MapRoute.name ||
|
|
||||||
name == DriftMapRoute.name ||
|
|
||||||
name == GalleryViewerRoute.name ||
|
|
||||||
name == AssetViewerRoute.name) {
|
|
||||||
print('[AGENT_LOG] nav.didPush route=$name prev=$prev');
|
|
||||||
}
|
|
||||||
// #endregion
|
|
||||||
_handleLockedViewState(route, previousRoute);
|
_handleLockedViewState(route, previousRoute);
|
||||||
_handleDriftLockedFolderState(route, previousRoute);
|
_handleDriftLockedFolderState(route, previousRoute);
|
||||||
Future(() {
|
Future(() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue