Plus léger et plus rapide : compression des fichiers, fiche et listes chargées à la demande
deploy / deploy (push) Successful in 42s
deploy / deploy (push) Successful in 42s
- nginx : compression gzip des fichiers de l'app (JS, CSS, JSON, SVG) ; ils partaient bruts (fichier principal 387 Ko envoyés au lieu de ~116 Ko). gzip_http_version 1.0 car le proxy en façade parle HTTP/1.0 - Fiche d'un titre, recherche d'ajout, onglets Journal et Listes, listes partagées : chargés à la demande (préchargés au repos, gardés par le service worker) - « Nouvelle liste » dans son propre fichier (n'embarque plus tout l'onglet Listes) - Fichier principal : 387 → 270 Ko (116 → 85 Ko compressés) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
8 files changed
+92
-58
No files matched your search
@@ -9,6 +9,7 @@ import ConfirmDialog from './ConfirmDialog'
|
||||
import { MediaCard } from './MediaCard'
|
||||
import Poster from './Poster'
|
||||
import { EmptyState } from './ui'
|
||||
import { NewListForm } from './NewListForm'
|
||||
import { useLibraryActions } from './library/useLibraryActions'
|
||||
import { SharedListsSection } from './social/SharedLists'
|
||||
|
||||
@@ -28,38 +29,6 @@ function Mosaic({ items }: { items: MediaItem[] }) {
|
||||
)
|
||||
}
|
||||
|
||||
export function NewListForm({ onCreated, autoFocus }: { onCreated?: (list: CustomList) => void; autoFocus?: boolean }) {
|
||||
const { createList } = useMedia()
|
||||
const [name, setName] = useState('')
|
||||
// Pas de <form> ici : ce champ peut vivre à l'intérieur du formulaire d'une fiche
|
||||
const submit = () => {
|
||||
if (!name.trim()) return
|
||||
onCreated?.(createList(name))
|
||||
setName('')
|
||||
}
|
||||
return (
|
||||
<div className="flex gap-2">
|
||||
<input
|
||||
className="field"
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
submit()
|
||||
}
|
||||
}}
|
||||
placeholder={t('lists.newListPh')}
|
||||
autoFocus={autoFocus}
|
||||
enterKeyHint="done"
|
||||
/>
|
||||
<button type="button" onClick={submit} disabled={!name.trim()} className="btn btn-light shrink-0 px-4 text-sm">
|
||||
{t('lists.create')}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function ListDetail({ list, onBack, onOpen }: { list: CustomList; onBack: () => void; onOpen: (item: MediaItem) => void }) {
|
||||
const { items, renameList, deleteList, toggleInList } = useMedia()
|
||||
const actions = useLibraryActions()
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import { useState } from 'react'
|
||||
import { t } from '../i18n'
|
||||
import { useMedia } from '../store'
|
||||
import type { CustomList } from '../types'
|
||||
|
||||
/**
|
||||
* Champ « Nouvelle liste » (onglet Listes, fiche d'un titre, sélection multiple).
|
||||
* Dans son propre fichier : l'importer n'embarque pas tout l'onglet Listes (chargé à la demande).
|
||||
*/
|
||||
export function NewListForm({ onCreated, autoFocus }: { onCreated?: (list: CustomList) => void; autoFocus?: boolean }) {
|
||||
const { createList } = useMedia()
|
||||
const [name, setName] = useState('')
|
||||
// Pas de <form> ici : ce champ peut vivre à l'intérieur du formulaire d'une fiche
|
||||
const submit = () => {
|
||||
if (!name.trim()) return
|
||||
onCreated?.(createList(name))
|
||||
setName('')
|
||||
}
|
||||
return (
|
||||
<div className="flex gap-2">
|
||||
<input
|
||||
className="field"
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
submit()
|
||||
}
|
||||
}}
|
||||
placeholder={t('lists.newListPh')}
|
||||
autoFocus={autoFocus}
|
||||
enterKeyHint="done"
|
||||
/>
|
||||
<button type="button" onClick={submit} disabled={!name.trim()} className="btn btn-light shrink-0 px-4 text-sm">
|
||||
{t('lists.create')}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import { GuestError, useMedia } from '../../store'
|
||||
import type { MediaItem, WatchStatus } from '../../types'
|
||||
import { StatusDot } from '../Badges'
|
||||
import ConfirmDialog from '../ConfirmDialog'
|
||||
import { NewListForm } from '../ListsView'
|
||||
import { NewListForm } from '../NewListForm'
|
||||
import { useToast } from '../Toast'
|
||||
import { useLibraryActions } from './useLibraryActions'
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import type { MediaItem } from '../../types'
|
||||
import type { PeekOwner } from './ItemPeek'
|
||||
import { useOnResume } from '../../lib/onResume'
|
||||
import WelcomeProfile, { RANDOM_USERNAME } from './WelcomeProfile'
|
||||
import { InvitePeople, SharedListSheet } from './SharedLists'
|
||||
import { getAniListById, type SearchResult } from '../../lib/catalogApi'
|
||||
import { TYPE_BY_VALUE } from '../../lib/constants'
|
||||
import type { SharedListItem } from '../../lib/cloud/sharedLists'
|
||||
@@ -47,6 +46,7 @@ const socialLoaders = {
|
||||
ProfileView: () => import('./ProfileView'),
|
||||
TitleReviews: () => import('./TitleReviews'),
|
||||
ItemPeek: () => import('./ItemPeek'),
|
||||
SharedLists: () => import('./SharedLists'),
|
||||
}
|
||||
const NotificationsSheet = lazy(socialLoaders.NotificationsSheet)
|
||||
const EditProfile = lazy(socialLoaders.EditProfile)
|
||||
@@ -55,6 +55,8 @@ const PeopleSearch = lazy(socialLoaders.PeopleSearch)
|
||||
const ProfileView = lazy(socialLoaders.ProfileView)
|
||||
const TitleReviews = lazy(socialLoaders.TitleReviews)
|
||||
const ItemPeek = lazy(socialLoaders.ItemPeek)
|
||||
const SharedListSheet = lazy(() => socialLoaders.SharedLists().then((m) => ({ default: m.SharedListSheet })))
|
||||
const InvitePeople = lazy(() => socialLoaders.SharedLists().then((m) => ({ default: m.InvitePeople })))
|
||||
export function preloadSocial() {
|
||||
for (const load of Object.values(socialLoaders)) void load().catch(() => {})
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import type { MediaInput, MediaItem, WatchStatus } from '../../types'
|
||||
import ConfirmDialog from '../ConfirmDialog'
|
||||
import EpisodeList from '../EpisodeList'
|
||||
import { useSocial } from '../social/SocialProvider'
|
||||
import { NewListForm } from '../ListsView'
|
||||
import { NewListForm } from '../NewListForm'
|
||||
import Poster from '../Poster'
|
||||
import { RatingInput } from '../Rating'
|
||||
import SharePreview from '../SharePreview'
|
||||
|
||||
Reference in new issue
Block a user