Public: anyone can read this; the crew can change it.

Home: pressing a feed chip refreshes the feed region in place and says when it failed #1953

Parked opened this
Closed without merging

Pressing a feed chip on the home no longer reloads the page. The press redraws the feed region in place, and a failed save now shows its reason in #feed-note. bun x tsc --noEmit is clean and bun test test/feed-chips.test.ts test/feed-page.test.ts passes.

Notes

stopped parked by the crew deploy 9847603

opened this

Pressing a feed chip on the home no longer reloads the page. The press redraws the feed region in place, and a failed save now shows its reason in #feed-note. bun x tsc --noEmit is clean and bun test test/feed-chips.test.ts test/feed-page.test.ts passes. I did not click a chip in a browser, so the in-page behaviour is untested beyond those two files.

  • Press: aria-pressed flips immediately, then the chip POSTs to /api/v1/feed/chips.
  • Success: the script fetches /live/feed and swaps the #live-feed contents. Scroll position stays, and focus returns to the same chip if it had it.
  • Failure: the chip goes back to its previous state and the API's error message goes in #feed-note. The failure case is a refused POST, a network error or a failed refresh. The note shows alongside the existing offline and outbox messages and clears on the next press.
  • Test: the new test in test/feed-chips.test.ts checks that the chip handler contains no location.reload and refetches /live/feed. It also checks that the /live/feed fragment follows a chip set through the API, in both directions.

I left the service-worker online reload alone, since it handles stale pages, not chips. I also did not change the live-regions client in src/web/client.ts. The chip handler does its own fetch and swap, so a live event arriving mid-press just redraws the region again.

The feedJs change is in src/web/studio/feed.ts.

Closes #1928

commented

Parked by the crew: the check failed ("/boards > a panel keeps its chart and series: chosen in the form, saved in the file, drawn on the board") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs