Skip to content

Make the directory toggle visible, move it under the shareable link, self-heal the link - #112

Merged
ehsan6sha merged 2 commits into
mainfrom
fix/listing-toggle-visible-and-selfheal
Aug 24, 2026
Merged

Make the directory toggle visible, move it under the shareable link, self-heal the link#112
ehsan6sha merged 2 commits into
mainfrom
fix/listing-toggle-visible-and-selfheal

Conversation

@ehsan6sha

Copy link
Copy Markdown
Member

Three reasons a user could not find the directory toggle, and the reason the directory kept showing the raw gateway URL.

It hid itself on any failure. The switch rendered nothing whenever the server state could not be read - reasoning that a wrong switch is worse than no switch. That was wrong. The listing endpoint was not deployed, so the control silently ceased to exist and the only signal was a user hunting for a feature that looked unshipped. It now always renders: disabled with Directory unavailable right now, or Checking… while it loads.

It was in the wrong place. It lived inside a generation-history card, gated on that card being the newest completed build - so finding it meant scrolling past the assets into the history, where exactly one card had it. It now sits directly under the Shareable link block at the top.

Deliberately below that block rather than inside it: the link card collapses to a spinner while the IPNS pointer publishes, and to nothing when there is no pointer. Nesting the switch there would make it vanish whenever an unrelated thing was loading - the same bug class as hiding it on an unreadable server state.

The link needed a manual toggle flip to repair. A site listed before this client began sending the stable link has listing_url NULL server-side, so the directory falls back to the per-generation gateway URL - which points at ONE build and goes stale on regeneration. The server cannot derive the real address: the IPNS pointer lives in the user's encrypted manifest and is published to w3name from the browser.

Rather than ask a user to toggle listing off and on to fix data they did not break, opening the site now pushes the front door once - guarded by listed AND NOT hasStableUrl AND a known pointer, at most once per group per session, failures swallowed. hasStableUrl is read off the GET (already returned, previously discarded), and a toggle records whether the server ACCEPTED the URL rather than assuming it, so a rejected link cannot suppress the repair.

Drops _GenerationCard.isLatestCompleted and _latestCompletedId, now unused.

CI green: analyze clean, unit tests pass. Not verified locally - flutter cannot run on this machine, PID 15560 is holding over a million handles and every fork fails.

Three separate reasons a user saw no toggle at all, and the same reason
the directory kept showing the raw gateway URL.

IT HID ITSELF ON ANY FAILURE
The switch rendered nothing whenever the server state could not be read,
on the reasoning that a wrong switch is worse than no switch. That was
wrong. When the listing endpoint was unreachable - which it was, because
the endpoint had not been deployed - the control silently ceased to
exist, and the only signal was a user hunting for a feature that looked
unshipped. It now always renders: disabled, saying the directory is
unavailable, or Checking while it loads. A disabled control that says
why is honest; an absent one is not.

IT WAS IN THE WRONG PLACE
It sat below the Open / Copy / Recreate actions, reading as an
afterthought. Listing is a statement about the shareable link, so the
switch now sits directly under it.

THE LINK NEEDED A MANUAL TOGGLE FLIP TO REPAIR
A site listed before this client began sending the stable share link has
listing_url NULL server-side, so the directory falls back to the raw
per-generation gateway URL - which points at ONE build and goes stale on
the next regeneration. The server CANNOT work the real address out: the
IPNS pointer lives in the user's encrypted manifest and is published to
w3name from the browser, so only the client can supply it.

Rather than ask a user to toggle listing off and on to fix data they did
not break, opening the site now pushes the front door once, guarded by
listed AND NOT hasStableUrl AND a known pointer, attempted at most once
per group per session, failures swallowed. hasStableUrl is now read off
the GET (it was already returned and thrown away), and a toggle records
whether the server ACCEPTED the URL rather than assuming it - a rejected
link must not suppress the repair.

NOT VERIFIED LOCALLY: flutter analyze cannot run on this machine, PID
15560 is holding 1,002,673 handles and every fork fails. CI is the gate.
Placed as asked, and the placement matters more than it looks. The
switch was inside a generation-history card, gated on that card being
the newest completed build - so finding it meant scrolling past the
assets and into the history, and only one card in that list had it.

It now sits directly under the Shareable link block at the top of the
screen.

Deliberately BELOW that block rather than inside it: the link card
collapses to a spinner while the IPNS pointer is publishing, and to
nothing at all when there is no pointer yet. Nesting the switch there
would have made it vanish again whenever an unrelated thing was loading
- the same class of bug as hiding it when the server state could not be
read. It is its own bordered section keyed only on there being a
completed generation.

Drops _GenerationCard.isLatestCompleted and _latestCompletedId, now
unused, in favour of a _latestCompleted getter returning the generation
itself.

Still CI-verified only - flutter cannot run here, PID 15560 is holding
over a million handles.
@ehsan6sha
ehsan6sha merged commit 0424053 into main Aug 24, 2026
1 check passed
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.

1 participant