summaryrefslogtreecommitdiff
path: root/apps/web/lib/queries
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-07 03:26:15 -0800
committerFuwn <[email protected]>2026-02-07 03:26:15 -0800
commitf2a5d1c04b9787bbd9f41af699345be6c0345ca8 (patch)
treeffbbacd807f0d3d30efb7110058bd70d6404681e /apps/web/lib/queries
parentstyle: lowercase all user-facing strings and add custom eslint rule (diff)
downloadasa.news-f2a5d1c04b9787bbd9f41af699345be6c0345ca8.tar.xz
asa.news-f2a5d1c04b9787bbd9f41af699345be6c0345ca8.zip
feat: pre-ship polish — UI improvements, keyboard shortcuts, appearance settings
- Rename "muted keywords" to "muted phrases" throughout settings UI - Add header with navigation to auth pages (sign-in, sign-up, etc.) - Merge security tab (TOTP setup) into account settings tab - Fix TOTP name input truncation on Safari (w-64 → flex-1 min-w-0) - Add appearance settings: font size, time display format, entry images toggle, reading time toggle - Add keyboard shortcuts dialog (? key) with all keybindings documented - Add extended vim shortcuts: gg, G, n/N (next/prev unread), Ctrl+h/l (panel focus) - Add command palette shortcut (⌘K) to shortcuts dialog - Add icon URL fields for folders and custom feeds (DB + queries + settings UI) - Add data-has-unreads attribute for sidebar keyboard navigation - Fix SSR prerendering crash from Zustand persist and react-resizable-panels localStorage access - Add detail panel layout persistence via useDefaultLayout - Update marketing copy to advertise vim-like keyboard navigation
Diffstat (limited to 'apps/web/lib/queries')
-rw-r--r--apps/web/lib/queries/use-custom-feed-mutations.ts17
-rw-r--r--apps/web/lib/queries/use-custom-feeds.ts4
-rw-r--r--apps/web/lib/queries/use-folder-mutations.ts7
-rw-r--r--apps/web/lib/queries/use-muted-keyword-mutations.ts8
-rw-r--r--apps/web/lib/queries/use-subscriptions.ts4
5 files changed, 27 insertions, 13 deletions
diff --git a/apps/web/lib/queries/use-custom-feed-mutations.ts b/apps/web/lib/queries/use-custom-feed-mutations.ts
index ad6b328..0afa19c 100644
--- a/apps/web/lib/queries/use-custom-feed-mutations.ts
+++ b/apps/web/lib/queries/use-custom-feed-mutations.ts
@@ -64,21 +64,26 @@ export function useUpdateCustomFeed() {
query,
matchMode,
sourceFolderIdentifier,
+ iconUrl,
}: {
customFeedIdentifier: string
name: string
query: string
matchMode: "and" | "or"
sourceFolderIdentifier: string | null
+ iconUrl?: string | null
}) => {
+ const updatePayload: Record<string, unknown> = {
+ name,
+ query,
+ match_mode: matchMode,
+ source_folder_id: sourceFolderIdentifier,
+ }
+ if (iconUrl !== undefined) updatePayload.icon_url = iconUrl
+
const { error } = await supabaseClient
.from("custom_feeds")
- .update({
- name,
- query,
- match_mode: matchMode,
- source_folder_id: sourceFolderIdentifier,
- })
+ .update(updatePayload)
.eq("id", customFeedIdentifier)
if (error) throw error
diff --git a/apps/web/lib/queries/use-custom-feeds.ts b/apps/web/lib/queries/use-custom-feeds.ts
index a93e431..f2918b5 100644
--- a/apps/web/lib/queries/use-custom-feeds.ts
+++ b/apps/web/lib/queries/use-custom-feeds.ts
@@ -12,6 +12,7 @@ interface CustomFeedRow {
match_mode: string
source_folder_id: string | null
position: number
+ icon_url: string | null
}
export function useCustomFeeds() {
@@ -28,7 +29,7 @@ export function useCustomFeeds() {
const { data, error } = await supabaseClient
.from("custom_feeds")
- .select("id, name, query, match_mode, source_folder_id, position")
+ .select("id, name, query, match_mode, source_folder_id, position, icon_url")
.eq("user_id", user.id)
.order("position")
@@ -42,6 +43,7 @@ export function useCustomFeeds() {
matchMode: row.match_mode as "and" | "or",
sourceFolderIdentifier: row.source_folder_id,
position: row.position,
+ iconUrl: row.icon_url,
})
)
},
diff --git a/apps/web/lib/queries/use-folder-mutations.ts b/apps/web/lib/queries/use-folder-mutations.ts
index 642bd96..4bc1247 100644
--- a/apps/web/lib/queries/use-folder-mutations.ts
+++ b/apps/web/lib/queries/use-folder-mutations.ts
@@ -82,13 +82,18 @@ export function useRenameFolder() {
mutationFn: async ({
folderIdentifier,
name,
+ iconUrl,
}: {
folderIdentifier: string
name: string
+ iconUrl?: string | null
}) => {
+ const updatePayload: Record<string, unknown> = { name }
+ if (iconUrl !== undefined) updatePayload.icon_url = iconUrl
+
const { error } = await supabaseClient
.from("folders")
- .update({ name })
+ .update(updatePayload)
.eq("id", folderIdentifier)
if (error) throw error
diff --git a/apps/web/lib/queries/use-muted-keyword-mutations.ts b/apps/web/lib/queries/use-muted-keyword-mutations.ts
index de4e03f..0b92dbd 100644
--- a/apps/web/lib/queries/use-muted-keyword-mutations.ts
+++ b/apps/web/lib/queries/use-muted-keyword-mutations.ts
@@ -28,12 +28,12 @@ export function useAddMutedKeyword() {
queryClient.invalidateQueries({ queryKey: queryKeys.mutedKeywords.all })
queryClient.invalidateQueries({ queryKey: queryKeys.timeline.all })
queryClient.invalidateQueries({ queryKey: queryKeys.userProfile.all })
- notify("keyword muted")
+ notify("phrase muted")
},
onError: (error: Error) => {
notify(error.message.includes("limit")
- ? "muted keyword limit reached for your plan"
- : "failed to mute keyword: " + error.message)
+ ? "muted phrase limit reached for your plan"
+ : "failed to mute phrase: " + error.message)
},
})
}
@@ -59,7 +59,7 @@ export function useDeleteMutedKeyword() {
queryClient.invalidateQueries({ queryKey: queryKeys.mutedKeywords.all })
queryClient.invalidateQueries({ queryKey: queryKeys.timeline.all })
queryClient.invalidateQueries({ queryKey: queryKeys.userProfile.all })
- notify("keyword unmuted")
+ notify("phrase unmuted")
},
onError: (error: Error) => {
notify("failed to unmute keyword: " + error.message)
diff --git a/apps/web/lib/queries/use-subscriptions.ts b/apps/web/lib/queries/use-subscriptions.ts
index ebf099d..e6b84ef 100644
--- a/apps/web/lib/queries/use-subscriptions.ts
+++ b/apps/web/lib/queries/use-subscriptions.ts
@@ -26,6 +26,7 @@ interface FolderRow {
id: string
name: string
position: number
+ icon_url: string | null
}
export function useSubscriptions() {
@@ -41,7 +42,7 @@ export function useSubscriptions() {
.order("position", { ascending: true }),
supabaseClient
.from("folders")
- .select("id, name, position")
+ .select("id, name, position, icon_url")
.order("position", { ascending: true }),
])
@@ -70,6 +71,7 @@ export function useSubscriptions() {
folderIdentifier: row.id,
name: row.name,
position: row.position,
+ iconUrl: row.icon_url,
}))
return { subscriptions, folders }