Skip to content

The file view walks up when its folder is deleted - #247

Merged
djthorpe merged 2 commits into
mainfrom
djt/1123/walk-up
Nov 23, 2026
Merged

djthorpe merged 2 commits into
mainfrom
djt/1123/walk-up

Conversation

@djthorpe

@djthorpe djthorpe commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

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 new onGone(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 with history.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.
  • Root's folder: if the gone folder was the one the volume's root had picked to show, the page finds that folder again instead.

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>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 18:54
@djthorpe djthorpe self-assigned this Nov 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread frontend/src/folder/controller.ts Resolved
Comment thread frontend/src/volumes/view.ts Resolved
Comment thread frontend/src/volumes/view.ts Resolved
…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>
@djthorpe
djthorpe merged commit 77dc04a into main Nov 23, 2026
8 checks passed
@djthorpe
djthorpe deleted the djt/1123/walk-up branch November 23, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: sort the file view, and walk up when its folder is deleted

2 participants