summaryrefslogtreecommitdiff
path: root/apps/web/lib
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-07 05:45:41 -0800
committerFuwn <[email protected]>2026-02-07 05:45:41 -0800
commit6368c74432ced80e0ac6ad2c5fe9c2495d1bc6ae (patch)
treec8b583a21bd489170b8f664e8c028fbbd9d95d49 /apps/web/lib
parentfix: resolve 6 pre-ship audit bugs (diff)
downloadasa.news-6368c74432ced80e0ac6ad2c5fe9c2495d1bc6ae.tar.xz
asa.news-6368c74432ced80e0ac6ad2c5fe9c2495d1bc6ae.zip
feat: resolve 7 pre-ship QoL items
- Space/Shift+Space: page down/up in detail panel (80% scroll) - Content font: sans-serif/serif/monospace selector in appearance settings, applied to article content in detail panel - Accessibility: entry-list-item uses button instead of div, folder toggles have aria-expanded, shortcut keys have aria-labels - Share notes: replaced window.prompt with proper modal dialog matching existing UI patterns - Worker .env.example: template with all 10 environment variables - Worker poisoned messages: archive unprocessable queue messages instead of leaving them stuck forever - Worker pool Submit: check return value, reschedule dropped feeds 30s into the future, log warnings for rejected submissions
Diffstat (limited to 'apps/web/lib')
-rw-r--r--apps/web/lib/hooks/use-keyboard-navigation.ts14
-rw-r--r--apps/web/lib/stores/user-interface-store.ts8
2 files changed, 22 insertions, 0 deletions
diff --git a/apps/web/lib/hooks/use-keyboard-navigation.ts b/apps/web/lib/hooks/use-keyboard-navigation.ts
index 24a4761..8685396 100644
--- a/apps/web/lib/hooks/use-keyboard-navigation.ts
+++ b/apps/web/lib/hooks/use-keyboard-navigation.ts
@@ -368,6 +368,7 @@ export function useKeyboardNavigation() {
function handleDetailPanelKeyDown(event: KeyboardEvent) {
const SCROLL_AMOUNT = 100
+ const PAGE_SCROLL_FRACTION = 0.8
const detailArticle = document.querySelector<HTMLElement>(
"[data-detail-article]"
)
@@ -385,6 +386,19 @@ export function useKeyboardNavigation() {
if (detailArticle) detailArticle.scrollTop -= SCROLL_AMOUNT
break
}
+ case " ": {
+ event.preventDefault()
+ if (detailArticle) {
+ const pageScrollAmount =
+ detailArticle.clientHeight * PAGE_SCROLL_FRACTION
+ if (event.shiftKey) {
+ detailArticle.scrollTop -= pageScrollAmount
+ } else {
+ detailArticle.scrollTop += pageScrollAmount
+ }
+ }
+ break
+ }
case "?": {
event.preventDefault()
toggleShortcutsDialog()
diff --git a/apps/web/lib/stores/user-interface-store.ts b/apps/web/lib/stores/user-interface-store.ts
index 01dceba..fdee347 100644
--- a/apps/web/lib/stores/user-interface-store.ts
+++ b/apps/web/lib/stores/user-interface-store.ts
@@ -7,6 +7,8 @@ type DisplayDensity = "compact" | "default" | "spacious"
type FontSize = "small" | "default" | "large"
+type ContentFont = "sans-serif" | "serif" | "monospace"
+
type TimeDisplayFormat = "relative" | "absolute"
type FocusedPanel = "sidebar" | "entryList" | "detailPanel"
@@ -38,6 +40,7 @@ interface UserInterfaceState {
showFeedFavicons: boolean
focusFollowsInteraction: boolean
fontSize: FontSize
+ contentFont: ContentFont
timeDisplayFormat: TimeDisplayFormat
showEntryImages: boolean
showReadingTime: boolean
@@ -62,6 +65,7 @@ interface UserInterfaceState {
setShowFeedFavicons: (show: boolean) => void
setFocusFollowsInteraction: (enabled: boolean) => void
setFontSize: (size: FontSize) => void
+ setContentFont: (font: ContentFont) => void
setTimeDisplayFormat: (format: TimeDisplayFormat) => void
setShowEntryImages: (show: boolean) => void
setShowReadingTime: (show: boolean) => void
@@ -90,6 +94,7 @@ export const useUserInterfaceStore = create<UserInterfaceState>()(
showFeedFavicons: true,
focusFollowsInteraction: false,
fontSize: "default",
+ contentFont: "sans-serif",
timeDisplayFormat: "relative",
showEntryImages: true,
showReadingTime: true,
@@ -134,6 +139,8 @@ export const useUserInterfaceStore = create<UserInterfaceState>()(
setFontSize: (size) => set({ fontSize: size }),
+ setContentFont: (font) => set({ contentFont: font }),
+
setTimeDisplayFormat: (format) => set({ timeDisplayFormat: format }),
setShowEntryImages: (show) => set({ showEntryImages: show }),
@@ -187,6 +194,7 @@ export const useUserInterfaceStore = create<UserInterfaceState>()(
focusFollowsInteraction: state.focusFollowsInteraction,
expandedFolderIdentifiers: state.expandedFolderIdentifiers,
fontSize: state.fontSize,
+ contentFont: state.contentFont,
timeDisplayFormat: state.timeDisplayFormat,
showEntryImages: state.showEntryImages,
showReadingTime: state.showReadingTime,