From 36df630862a6c1565ed00ebdae9bb7bc3539d223 Mon Sep 17 00:00:00 2001 From: Patrick Stel Date: Sat, 3 Oct 2026 09:32:52 +0200 Subject: [PATCH] Make Switch site go round the favourites instead of between the two most recent sites (#100) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue #75 asked for a way between two sites, and the switch walked the history for it: the first entry not on this site. That is why the reporter's third site never came up — the two most recent sites trade places for ever. The switch now goes round the favourites in tile order, each at the last page seen on that site, and falls back to the old walk when there is no round to go. The site-rules harness holds both. Also records the reopened #100 in INTERNALS: the page sent does not carry the freeze (the report keeps one launch back, and that launch had TikTok open for seconds without a video), and where the hold is not — a page that has not finished loading. --- CLAUDE.md | 4 +- docs/INTERNALS.md | 57 +++++++++++++++++++++--- src/common/SiteRules.cs | 88 +++++++++++++++++++++++++++++++++----- src/nui/NuiBrowserApp.cs | 11 ++--- tools/siterules/Program.cs | 61 +++++++++++++++++++++++--- tools/siterules/run.sh | 10 +++-- 6 files changed, 199 insertions(+), 32 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 19d8e76..eba1ae1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -228,8 +228,8 @@ you to another of its own hosts, too wide and a suffix test lets file to the name a site is remembered under, what a rule covers and what it must not, the third state (a field nobody set follows the browser-wide switch rather than meaning "off"), a round trip through the disk, a hand-edited file that cannot -stop the browser starting, and the alternation the switch key depends on. It -also compiles `src/nui/ProxyAddress.cs` (issue #97) and holds it to the one +stop the browser starting, the round of favourites the switch key walks and the +two-site alternation it falls back to. It also compiles `src/nui/ProxyAddress.cs` (issue #97) and holds it to the one thing that must not go wrong there: the proxy login reaches the engine's login call and nothing that is shown, logged or served on `:8081`. Needs only the .NET 6 SDK under `~/.dotnet-local`. diff --git a/docs/INTERNALS.md b/docs/INTERNALS.md index 3b3be2f..d89e210 100644 --- a/docs/INTERNALS.md +++ b/docs/INTERNALS.md @@ -2182,13 +2182,28 @@ television that will not stop reloading is a different order of bad. ### Switching sites -`SiteRules.OtherSite` walks the history — which is kept most-recent-first — and -returns the first entry that is not on this site. From a page on B that is the +`SiteRules.OtherSite` goes round the favourites, in the order their tiles sit on +the start screen: from a site with a favourite to the next favourite's site, +wrapping at the end, and from a site with none to the first. Two tiles on one site +are one stop. Each stop opens the last page the history has on that site, so a +return to Spotify lands where Spotify was left; the tile's own address is the +answer only for a site never visited. With no round to go — no favourites, or every +favourite on the site already open — it falls back to the first shape below, and +from the start screen it opens the most recent site either way. It needs no new +screen: a list of sites is what the start screen already is, and the reporter had +said he did not want to go there. + +**The first shape walked the history, and could only ever reach two sites.** It +returned the first history entry not on this site: from a page on B that is the page on A the user came from, and from A it is the page on B they just left, so -one action alternates between the two sites somebody is going back and forth -between. That is #75 as it was asked, and it needs no new screen: a list of recent -sites is what the start screen already is, and the reporter had said he did not -want to go there. +one action alternated between the two sites somebody is going back and forth +between. That is #75 as it was asked — "between two sites" — and it is also why +his third site never came up (#100, 2026-10-03: "it only switches between 2 sites +instagram and spotify not to 3rd favourite tiktok"): the history is always ordered +by what was just left, so the two most recent sites trade places for ever and the +third is never the first entry off the current site. His own word for the fix, +"favourite", is the list he already keeps in an order he can see, so that is the +round. **It is a menu row before it is a key.** Every digit and `Info` were already spoken for, so the only button left on a Samsung remote is the red / A one — and which @@ -3428,6 +3443,36 @@ the one its report has to come from. The state is: reels and on a live stream, and the issue closes on that report. If a freeze near a live stream ever does come back, the `dur`/`live page` markers from `build-e1a648d` are already in the probe and the reading above still applies. + **It came back the same evening (2026-10-02, 17:08 UTC), and #100 was reopened + on 2026-10-03:** "Video freeze occured again because of livestream", plus a + second complaint, that *Switch site* "only switches between 2 sites instagram and + spotify not to 3rd favourite tiktok". The page attached to it does not carry the + freeze, and the reason is worth saying once: the report keeps one launch back, + and the launch in its `previous run` block (22:23:58–22:36:14 on the TV's clock) + has TikTok open twice, for six seconds at launch and for eleven seconds from a + start-screen tile at 22:33, with no `mse:` line, no `hold:` line and no + `load finished` for either — he left for the start screen both times before the + page had finished loading. Between them is an Instagram reels session (fifteen + `