mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-21 06:08:06 +02:00
Implements the approved design proposal across every screen. - Layout: feeds · list · reader panes on desktop (≥1280px), list + reader with the feeds in a drawer on tablets, one column with a bottom tab bar (À lire, Focus, Favoris, Flux) on phones. - List: dense rows with an unread dot, feed initial and square thumbnail instead of large cards; touch swipe reveals the action (→ lu, ← favori). The magazine grid stays available as a view toggle. - Reader: inline pane on desktop, full screen on phones with a bottom action bar (favori, partager, original, Suivant); collapsible "Résumé IA" block; "Aa" settings become a bottom sheet on phones. - Search: the existing /articles/search endpoint gets a UI — ⌘K / "/" palette on desktop, full screen on phones, with recent searches. - Mobile "Mes flux" screen: views, subscriptions with errors, theme, OPML import/export, logout. - Focus mode: progress bar, counter and labelled buttons. - Tokens: new paper / deep-forest palette (all text ≥4.5:1), Newsreader + Inter replace Playfair + Lora (two families instead of four), shared Icon and FeedAvatar components. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UPyU2LbJ2rTrsgZqQKhH3j
106 lines
3.6 KiB
TypeScript
106 lines
3.6 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
tailwindcss(),
|
|
VitePWA({
|
|
// Never reload the page under the reader: the app shows an update toast.
|
|
registerType: 'prompt',
|
|
includeAssets: ['favicon.svg', 'theme-init.js'],
|
|
manifest: {
|
|
name: 'FlowReader',
|
|
short_name: 'FlowReader',
|
|
description: 'Lecteur RSS minimaliste et rapide',
|
|
lang: 'fr',
|
|
theme_color: '#1B6B43',
|
|
background_color: '#F6F4EE',
|
|
display: 'standalone',
|
|
start_url: '/',
|
|
icons: [
|
|
{
|
|
src: 'favicon.svg',
|
|
sizes: 'any',
|
|
type: 'image/svg+xml',
|
|
purpose: 'any',
|
|
},
|
|
],
|
|
},
|
|
workbox: {
|
|
// App shell + Latin font subsets only (other subsets load on demand).
|
|
globPatterns: ['**/*.{js,css,html,svg}', '**/*-latin-wght-*.woff2', '**/*-latin-[47]00-*.woff2'],
|
|
navigateFallbackDenylist: [/^\/api\//, /^\/health/],
|
|
cleanupOutdatedCaches: true,
|
|
// Activate new versions immediately. A waiting worker would keep
|
|
// serving a stale app shell to clients that never send SKIP_WAITING
|
|
// (e.g. tabs still running a previous build), so the old UI would talk
|
|
// to the new API. The app shows a reload toast instead of reloading.
|
|
skipWaiting: true,
|
|
clientsClaim: true,
|
|
runtimeCaching: [
|
|
{
|
|
// Opened articles stay readable offline.
|
|
urlPattern: ({ url, request }) =>
|
|
request.method === 'GET' && /^\/api\/v1\/articles\/[0-9a-f-]{36}$/.test(url.pathname),
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'api-articles',
|
|
networkTimeoutSeconds: 4,
|
|
expiration: { maxEntries: 200, maxAgeSeconds: 60 * 60 * 24 * 7 },
|
|
cacheableResponse: { statuses: [200] },
|
|
},
|
|
},
|
|
{
|
|
urlPattern: ({ url, request }) =>
|
|
request.method === 'GET' &&
|
|
/^\/api\/v1\/(articles|feeds)(\/|$|\?)/.test(url.pathname) &&
|
|
!url.pathname.startsWith('/api/v1/feeds/export'),
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'api-lists',
|
|
networkTimeoutSeconds: 4,
|
|
expiration: { maxEntries: 60, maxAgeSeconds: 60 * 60 * 24 },
|
|
cacheableResponse: { statuses: [200] },
|
|
},
|
|
},
|
|
// No image route: feed images are cross-origin, and a fetch() from
|
|
// the worker is bound by the CSP's connect-src 'self', so it would
|
|
// fail every cover. The browser's HTTP cache handles them instead.
|
|
{
|
|
urlPattern: ({ request }) => request.destination === 'font',
|
|
handler: 'CacheFirst',
|
|
options: {
|
|
cacheName: 'fonts',
|
|
expiration: { maxEntries: 30, maxAgeSeconds: 60 * 60 * 24 * 365 },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
})
|
|
],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
// Long-lived vendor chunk: app deploys don't invalidate React/Query.
|
|
manualChunks: {
|
|
vendor: ['react', 'react-dom', 'react-dom/client', 'scheduler', 'react-router-dom', '@tanstack/react-query', 'zustand'],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: process.env.VITE_API_TARGET ?? 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
})
|