From dc79349d9eb6f5908a34654c0e5c38f6cebc1633 Mon Sep 17 00:00:00 2001 From: JakeBreath Date: Thu, 17 Sep 2026 23:44:27 -0500 Subject: [PATCH] Online defaults to order:hot, with an Account toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New online_hot_default preference (on by default, so guests and accounts that never saved preferences get it): opening /online without a search replaces the URL with ?tags=order:hot — e621's metatag for the order the Hot page uses — so it is visible in the search field and shareable. Existing searches are never touched: they live in the URL, so a refresh or back/forward keeps them, while a fresh visit (nav pill, first time, after a long time away) gets the hot default again. Turning the toggle off opens Online on the site-wide newest posts as before. The toggle sits in Account -> Browsing preferences and saves with the rest of the settings; the backend validates the new boolean (400 for non-boolean input). --- backend/apps/accounts/serializers.py | 2 ++ .../src/features/account/PreferencesCard.tsx | 22 +++++++++++++++++++ frontend/src/features/online/OnlinePage.tsx | 16 +++++++++++++- frontend/src/lib/types.ts | 1 + 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/backend/apps/accounts/serializers.py b/backend/apps/accounts/serializers.py index ba2f02a..0df54f8 100644 --- a/backend/apps/accounts/serializers.py +++ b/backend/apps/accounts/serializers.py @@ -127,3 +127,5 @@ class PreferencesSerializer(serializers.Serializer): ordering = serializers.CharField(max_length=30, required=False) per_page = serializers.IntegerField(min_value=12, max_value=200, required=False) zoom = serializers.IntegerField(min_value=120, max_value=400, required=False) + # Open Online with the order:hot metatag when no search is given. + online_hot_default = serializers.BooleanField(required=False) diff --git a/frontend/src/features/account/PreferencesCard.tsx b/frontend/src/features/account/PreferencesCard.tsx index edeafab..591cd25 100644 --- a/frontend/src/features/account/PreferencesCard.tsx +++ b/frontend/src/features/account/PreferencesCard.tsx @@ -170,6 +170,28 @@ export function PreferencesCard() { /> + +