Feat/library#136
Conversation
Import the keepsimple Library feature source from github.com/keepsimpleio/library into keepsimple's existing folder structure, namespaced under `library/` to avoid collisions: - components atoms/molecules/organisms -> src/components/library/ - templates -> src/layouts/library/ - types (+ d.ts type shims) -> src/local-types/library/ - utils -> src/utils/library/ - hooks -> src/hooks/library/ - constants (+ config/seo.config.ts) -> src/constants/library/ - contexts -> src/components/Context/library/ - axios/cookie libs -> src/lib/library/ - client services (src/api + app/api) -> src/api/library/ - code-imported assets -> src/assets/library/ - shared scss -> src/styles/library/ - AGENT.md -> src/components/library/LIBRARY_AGENT.md Excluded per task: package.json/lockfile, node_modules, CI/workflows, .claude/.husky/.idea, eslint/tsconfig, README/docs, Storybook (.storybook + *.stories.*), App-Router routing/infra (app/page, app/layout, loading, app/auth), all NextAuth setup, and route handlers (libraries proxy, geoip /api/user, test-login mock). Imports/deps/auth/route are fixed in later steps.
Copy Library's public/images into public/library/images so they don't collide with keepsimple's public root, and rewrite the three absolute public references in the imported code from /images/... to /library/images/...: - atoms/Icon/Icon.tsx — SVG sprite href (/library/images/icons/all.svg) - constants/library/seo.config.ts — default OG image path - layouts/library/Home/Home.tsx — landing cover image JS module imports of assets (@/assets/images/*) are alias rewrites, handled in Step 4.
Add only the runtime packages the migrated Library code imports that
keepsimple was missing (versions from Library, since these are new —
no shared-version conflict). Shared packages (react, react-dom, next,
next-auth, classnames, react-tooltip, date-fns, sass, geoip-lite) keep
keepsimple's existing versions.
Added (dependencies):
- axios ^1.13.4 — Library Strapi client (src/lib/library/axios)
- js-cookie ^3.0.5 — cookie helper (src/lib/library/cookie)
- zod ^4.3.6 — form/validation schemas (src/utils/library/schema)
- react-hook-form ^7.71.1 — forms in modals
- @hookform/resolvers ^5.2.2 — zod<->react-hook-form bridge
- react-dropzone ^15.0.0 — ImageDropzone molecule
- react-day-picker ^10.0.0 — DatePicker molecule
- @dnd-kit/core ^6.3.1, @dnd-kit/sortable ^10.0.0, @dnd-kit/utilities ^3.2.2
— ReorderGrid drag-and-drop
Added (devDependencies):
- @types/js-cookie ^3.0.6 — js-cookie ships no types
Not added: commander/fs-extra (Library generators — not migrated),
Storybook/vitest/playwright tooling (excluded). Single yarn install run
with yarn classic (v1) to keep yarn.lock in its canonical v1 format.
Rewrite Library's @/* aliases to keepsimple's per-folder aliases, relocate assets under @iCons, strip 'use client', convert next/navigation to next/router, and rewire auth to keepsimple's NextAuth + @api/auth. Make the next-auth.d.ts a proper module augmentation so it no longer clobbers next-auth's default export. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add Pages Router entry points for the migrated Library feature: /library (Home) and /library/[username] (dashboard). Both use getServerSideProps for SSR and reuse keepsimple's SeoGenerator instead of next/head blocks. Scope a sassOptions.additionalData injection in next.config.js to library SCSS modules only, so the placeholder selectors the original app injected globally resolve without touching keepsimple's own styles. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add the Library nav item (flagged via isLibraryEnabled), a "My Library" shortcut in the user-profile dropdown, and notFound guards on the library pages when the feature is disabled. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Switch the sticky global header to #F8F1E5 on /library paths (including the dark-theme variant, since the library has no dark mode) so it blends with the library surface. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Retire the old library Header organism in favor of a sticky LibraryToolbar: shelf jump-pills with overflow arrows, a Search Everywhere input, and an Add shelf control that disables at the 21-shelf cap. Adds Input onKeyDown for the search and MAX_SHELVES_PER_LIBRARY. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move the library's global CSS behind a single library-global entry imported from _app, scope resets under .library, and wrap portaled menus/modals in a .library container so they inherit the tokens. Self-host Source Serif 4 (the Google Fonts @import is blocked by CSP) and declare font-family vars. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Override SVGO's removeViewBox in the SVGR loader so downscaled shelf icons keep their coordinate system instead of cropping, and strip stray blue frame-outline artifacts from the book and video glyphs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Edit a shelf name by clicking it (drop the settings-menu edit entry), drop the doubled brown border on the settings-trigger dropdown, append new shelves at the end with an inline loader instead of a full-screen swap, hide private shelves from non-owners, give overflowing object rows a 12px #C0B6AE scrollbar with 40px top headroom, and glide cards to their new slots after a reorder via a FLIP animation. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add the reorderObjects/reorderShelves endpoints and wire the step-2 ReorderGrid to persist on save. Resolve the shelf id from a passed-in fallback so edit mode no longer silently skips, and sort populated shelves/objects by order:asc so the saved sequence survives a refetch. Stop swallowing reorder errors — log status + body, roll back the optimistic order, and message the user. Also derive the ImageDropzone preview synchronously so the cover no longer flashes empty. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Prefer the optimistically updated currentShelves over the stale one-shot library fetch for the sidebar book/video/song totals so counts bump on upload, and load the tag list on mount so the Tags panel isn't empty until the first mutation. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Always render the tag column (even when empty) and fix container dimensions so book/audio/video cards keep a consistent width with or without tags, and paint the book cover gradient immediately so freshly uploaded covers don't flash blank. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Stamp publishedAt when creating a tag (the content type is draftAndPublish), so newly created tags don't vanish on the next load. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Claude finished @MaryWylde's task in 2m 37s —— View job PR Review: Feat/library
|
- flatten src/api/library/library/ up one level and split strapi.ts into per-call files (getLibrariesList, getLibrariesPaginated, getSingleLibrary, user/getUserInfo, shared libraryCardPopulate); drop dead getShelves - remove App-Router leftovers: molecules/SEO, molecules/SignInModal, molecules/UserDropDown, utils/library/seo.ts (host reuses SeoGenerator, login modal, and keepsimple header) - consolidate library fonts into globals.scss; delete styles/library/fonts.scss - Dropdown: move inline styles into module.scss classes - AudioCard: replace hardcoded focus color with --focus-ring var - AuthContext: reset in-memory token/account on logout, use js-cookie helpers - GlobalStateContext: drop unconditional first fetch (double-load), type libraries as StrapiLibrariesResponse; simplify Sidebar narrowing - createTag: explicit response type; getTagsList: drop dead SSR header branch - UserProfile: fill in hy (Armenian) menu labels - gitignore LIBRARY_TODO.md scratch file Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

No description provided.