Fix: Reader Store Refactor (Issue #11) & Feat: Drag n Drop (WIP)

This commit is contained in:
Youwes09
2026-03-28 17:15:01 -05:00
parent 4b6d0780c9
commit 62e41e5f07
15 changed files with 1633 additions and 673 deletions
+1
View File
@@ -154,6 +154,7 @@ export const CACHE_GROUPS = {
export const CACHE_KEYS = {
LIBRARY: "library",
ALL_MANGA: "all_manga_unfiltered",
CATEGORIES: "categories",
DISCOVER: "discover_all_manga", // Discover's unfiltered fetch — separate from library
SOURCES: "sources",
POPULAR: "popular",
+89
View File
@@ -191,6 +191,95 @@ export const GET_DOWNLOADS_PATH = `
}
`;
// ── Categories ────────────────────────────────────────────────────────────────
export const GET_CATEGORIES = `
query GetCategories {
categories {
nodes {
id
name
order
default
includeInUpdate
includeInDownload
mangas {
nodes {
id
title
thumbnailUrl
inLibrary
downloadCount
unreadCount
}
}
}
}
}
`;
export const CREATE_CATEGORY = `
mutation CreateCategory($name: String!) {
createCategory(input: { name: $name }) {
category {
id
name
order
default
includeInUpdate
includeInDownload
}
}
}
`;
export const UPDATE_CATEGORY = `
mutation UpdateCategory($id: Int!, $name: String) {
updateCategory(input: { id: $id, patch: { name: $name } }) {
category {
id
name
order
}
}
}
`;
export const DELETE_CATEGORY = `
mutation DeleteCategory($id: Int!) {
deleteCategory(input: { categoryId: $id }) {
category {
id
}
}
}
`;
export const UPDATE_CATEGORY_ORDER = `
mutation UpdateCategoryOrder($id: Int!, $position: Int!) {
updateCategoryOrder(input: { id: $id, position: $position }) {
categories {
id
name
order
default
includeInUpdate
includeInDownload
}
}
}
`;
export const UPDATE_MANGA_CATEGORIES = `
mutation UpdateMangaCategories($mangaId: Int!, $addTo: [Int!]!, $removeFrom: [Int!]!) {
updateMangaCategories(input: { id: $mangaId, patch: { addToCategories: $addTo, removeFromCategories: $removeFrom } }) {
manga {
id
}
}
}
`;
// ── Downloads ─────────────────────────────────────────────────────────────────
export const GET_DOWNLOAD_STATUS = `
+12
View File
@@ -1,3 +1,15 @@
export interface Category {
id: number;
name: string;
order: number;
default: boolean;
includeInUpdate: string;
includeInDownload: string;
mangas?: {
nodes: Manga[];
};
}
export interface Manga {
id: number;
title: string;