feat(photos): add adaptive folder navigation - #245
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb9b73ae00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f72c67059c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1fa8474e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…owse-state # Conflicts: # ui/src/commonMain/kotlin/dev/obiente/nextcloudnative/app/NextcloudNativeApp.kt
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 456720e6f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (state.complete || state.truncationReason != null || state.safetyStopReason != null) { | ||
| return state |
There was a problem hiding this comment.
Revalidate a completed folder inventory
When the user revisits Folders after server media has been uploaded, moved, or deleted, MediaScreen invokes the same session-scoped pager, but this guard returns before loadPage; the pager generation remains fixed and no other path rebuilds its repository, so stale folders and counts persist until the session is recreated. Fresh evidence relative to the earlier stale-snapshot concern is this terminal complete path; start a new inventory generation while retaining the existing publication during revalidation.
AGENTS.md reference: AGENTS.md:L207-L208
Useful? React with 👍 / 👎.
| .take(maximumSelectionRecords) | ||
| .toList() |
There was a problem hiding this comment.
Page the selected-folder media window
When a folder or recursive scope contains more than 2,000 media records, this silently retains only the first maximumSelectionRecords; the summary still reports the complete count, but the grid, list, and viewer expose no continuation mechanism for the remaining items. Fresh evidence after the inventory-paging change is this separate bounded selection window, so make it pageable or clearly expose the partial state and a way to continue loading.
AGENTS.md reference: AGENTS.md:L240-L242
Useful? React with 👍 / 👎.
| refreshError: String?, | ||
| ): PhotoFolderInventoryReadiness = when { | ||
| hasInventory && refreshError != null -> PhotoFolderInventoryReadiness.Stale | ||
| hasInventory -> PhotoFolderInventoryReadiness.Ready |
There was a problem hiding this comment.
Mark in-progress inventory publications as partial
When an account requires multiple timeline pages, the pager publishes after each accepted page with loading still true, but this branch classifies any publication without an error as Ready. The folder browser therefore presents interim folders and counts as complete, potentially for many network requests, with no indexing indicator; include loading/completion in readiness and explain that the visible inventory is still expanding.
AGENTS.md reference: AGENTS.md:L240-L242
Useful? React with 👍 / 👎.
| photoFolderState.scope, | ||
| ) { | ||
| folderPagingState.publication?.let { | ||
| folderInventoryState.pager.selectionSnapshot(photoFolderState) |
There was a problem hiding this comment.
Move inventory snapshot construction off the UI thread
When the account index is large, every page publication and every folder, query, or scope change executes selectionSnapshot synchronously inside this composition-time remember. That call can scan all 50,000 retained records and rebuild the complete folder summary before Compose can render the next frame, so navigating folders or typing a search can visibly stall Android and desktop UI; construct and publish the immutable snapshot from a background dispatcher instead.
Useful? React with 👍 / 👎.
Summary
User impact
Photos now has stable top-level destinations and a folder browser that scales from phones to desktop. People can search folder paths, choose whether nested media is included, move back through folder context before leaving Photos, and switch between grid and list views. Large libraries publish usable partial folder results while paging continues, and safety stops are visible instead of silently presenting an incomplete library as complete.
This advances rather than closes #243. Media-metadata search, representative folder thumbnails, additional sort controls, renamed/moved/deleted-folder recovery, exhaustive recursion-mode visual coverage, and final emulator interaction acceptance remain tracked there.
Advances #243
Validation
:ui:desktopTest --tests '*PhotoFolderInventoryPagingTest' --tests '*PhotoFolderBrowsingTest' --tests '*MediaStackingTest' --tests '*MediaViewerNavigationTest' --tests '*MarketingPhotoFolderCaptureScenarioTest':androidApp:compileDebugKotlin:ui:captureMarketingScreenshotscaptured 24 real Compose scenarios without a devicenpm run --prefix website verify:captures:freshverified all 24 synthetic captures against the exact source treebash tools/check-repository.shgit diff --checkphoto-folder-browser-mobile.pngandphoto-folder-browser-desktop.png