Repository navigation
The file view walks up when its folder is deleted - #247
Merged
Merged
Conversation
A folder whose listing is 404, other than a volume's root, is gone, of the folder controller, rather than an error, and the volume's page shows the folder above it, in place of it in the history, and the tree's selection follows, which walks up, in turn, to the nearest folder which is there, or finds the folder the volume's root shows again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Active issues allow deleted-folder recovery to emit expected 404 notifications, let stale requests navigate away from valid folders, and overwrite another page’s history entry.
3 open issues
What changed in this PR
This PR addresses the remaining folder-navigation work from #218, following the sorting changes in #244 and #245. It adds recovery when the displayed folder is deleted.
Changes:
- Treat non-root folder listing 404s as missing folders and notify the view through
onGone. - Walk up to an existing parent, replacing the history entry and updating tree selection.
- Add controller tests and document the recovery behavior.
| File | Description |
|---|---|
frontend/test/folder.test.ts |
Distinguishes missing folders from server failures and tests 404 handling. |
frontend/src/volumes/view.ts |
Handles missing folders through parent navigation or root-folder rediscovery. |
frontend/src/folder/controller.ts |
Adds onGone callbacks for non-root listing 404s. |
frontend/README.md |
Documents deleted-folder recovery behavior. |
Review effort: Balanced
…hich is there, of the volume's page A folder's 404 is gone only of the folder which is opened, of its generation, rather than a response to when it was opened before. The volume's page finds the nearest folder above it which is there, first, so the tree reveals only folders which are, and walks up only while it shows the folder, rather than another page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #218. Sorting landed in #244 and #245; this is the other half, going up when the open folder is deleted.
Behaviour: if the folder being shown is deleted, its listing returns 404. The view then moves to the nearest folder above it that still exists, and selects it in the tree. There's no error notification.
How
FolderController: a 404 while listing a folder other than the volume's root now calls the newonGone(volume, path)callback, once, and only for the folder still being shown. The listing comes back empty, not as an error. A 404 on the root is still an error, as before.VolumeElement.gone: if the gone folder is the one in the location, the page moves to its parent withhistory.replaceState, so Back doesn't return to a missing folder. The tree's selection follows the route. If the parent is gone too, its own 404 walks up again.