fix: format phase 22 worktree files that were committed unformatted
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -67,9 +67,7 @@ export function AddToCollectionModal() {
|
|||||||
closeAddToCollection();
|
closeAddToCollection();
|
||||||
},
|
},
|
||||||
onError: (err) => {
|
onError: (err) => {
|
||||||
setError(
|
setError(err instanceof Error ? err.message : "Failed to add item");
|
||||||
err instanceof Error ? err.message : "Failed to add item",
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { useQueryClient } from "@tanstack/react-query";
|
|
||||||
import { useCategories } from "../hooks/useCategories";
|
import { useCategories } from "../hooks/useCategories";
|
||||||
import { useGlobalItem } from "../hooks/useGlobalItems";
|
import { useGlobalItem } from "../hooks/useGlobalItems";
|
||||||
import { useCreateThread, useThreads } from "../hooks/useThreads";
|
import { useCreateThread, useThreads } from "../hooks/useThreads";
|
||||||
@@ -12,9 +12,7 @@ export function AddToThreadModal() {
|
|||||||
(s) => s.addToThreadModal,
|
(s) => s.addToThreadModal,
|
||||||
);
|
);
|
||||||
const closeAddToThread = useUIStore((s) => s.closeAddToThread);
|
const closeAddToThread = useUIStore((s) => s.closeAddToThread);
|
||||||
const catalogSessionThreadId = useUIStore(
|
const catalogSessionThreadId = useUIStore((s) => s.catalogSessionThreadId);
|
||||||
(s) => s.catalogSessionThreadId,
|
|
||||||
);
|
|
||||||
const setCatalogSessionThreadId = useUIStore(
|
const setCatalogSessionThreadId = useUIStore(
|
||||||
(s) => s.setCatalogSessionThreadId,
|
(s) => s.setCatalogSessionThreadId,
|
||||||
);
|
);
|
||||||
@@ -26,13 +24,11 @@ export function AddToThreadModal() {
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const [mode, setMode] = useState<"pick" | "create">("pick");
|
const [mode, setMode] = useState<"pick" | "create">("pick");
|
||||||
const [selectedThreadId, setSelectedThreadId] = useState<number | null>(
|
const [selectedThreadId, setSelectedThreadId] = useState<number | null>(null);
|
||||||
|
const [newThreadName, setNewThreadName] = useState("");
|
||||||
|
const [newThreadCategoryId, setNewThreadCategoryId] = useState<number | null>(
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
const [newThreadName, setNewThreadName] = useState("");
|
|
||||||
const [newThreadCategoryId, setNewThreadCategoryId] = useState<
|
|
||||||
number | null
|
|
||||||
>(null);
|
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
@@ -63,7 +59,13 @@ export function AddToThreadModal() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [open]);
|
}, [
|
||||||
|
open,
|
||||||
|
activeThreads.length,
|
||||||
|
activeThreads.some,
|
||||||
|
activeThreads[0].id,
|
||||||
|
catalogSessionThreadId,
|
||||||
|
]);
|
||||||
|
|
||||||
// Reset form state when modal closes
|
// Reset form state when modal closes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -112,9 +114,7 @@ export function AddToThreadModal() {
|
|||||||
toast.success(`Added to "${thread?.name ?? "thread"}"`);
|
toast.success(`Added to "${thread?.name ?? "thread"}"`);
|
||||||
closeAddToThread();
|
closeAddToThread();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(
|
setError(err instanceof Error ? err.message : "Failed to add candidate");
|
||||||
err instanceof Error ? err.message : "Failed to add candidate",
|
|
||||||
);
|
|
||||||
} finally {
|
} finally {
|
||||||
setIsSubmitting(false);
|
setIsSubmitting(false);
|
||||||
}
|
}
|
||||||
@@ -142,9 +142,7 @@ export function AddToThreadModal() {
|
|||||||
toast.success(`Created "${trimmedName}" with first candidate`);
|
toast.success(`Created "${trimmedName}" with first candidate`);
|
||||||
closeAddToThread();
|
closeAddToThread();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(
|
setError(err instanceof Error ? err.message : "Failed to create thread");
|
||||||
err instanceof Error ? err.message : "Failed to create thread",
|
|
||||||
);
|
|
||||||
} finally {
|
} finally {
|
||||||
setIsSubmitting(false);
|
setIsSubmitting(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,14 +133,18 @@ function GlobalItemDetail() {
|
|||||||
<div className="flex gap-3 mb-6">
|
<div className="flex gap-3 mb-6">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => openAddToCollection(item.id, `${item.brand} ${item.model}`)}
|
onClick={() =>
|
||||||
|
openAddToCollection(item.id, `${item.brand} ${item.model}`)
|
||||||
|
}
|
||||||
className="bg-gray-700 text-white rounded-lg px-5 py-2.5 text-sm font-medium hover:bg-gray-800 transition-colors"
|
className="bg-gray-700 text-white rounded-lg px-5 py-2.5 text-sm font-medium hover:bg-gray-800 transition-colors"
|
||||||
>
|
>
|
||||||
Add to Collection
|
Add to Collection
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => openAddToThread(item.id, `${item.brand} ${item.model}`)}
|
onClick={() =>
|
||||||
|
openAddToThread(item.id, `${item.brand} ${item.model}`)
|
||||||
|
}
|
||||||
className="bg-white text-gray-700 border border-gray-200 rounded-lg px-5 py-2.5 text-sm font-medium hover:bg-gray-50 transition-colors"
|
className="bg-white text-gray-700 border border-gray-200 rounded-lg px-5 py-2.5 text-sm font-medium hover:bg-gray-50 transition-colors"
|
||||||
>
|
>
|
||||||
Add to Thread
|
Add to Thread
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ function ThreadDetailPage() {
|
|||||||
thread?.candidates ?? [],
|
thread?.candidates ?? [],
|
||||||
setupData?.items,
|
setupData?.items,
|
||||||
thread?.categoryId ?? 0,
|
thread?.categoryId ?? 0,
|
||||||
)
|
);
|
||||||
|
|
||||||
const [addCandidateOpen, setAddCandidateOpen] = useState(false);
|
const [addCandidateOpen, setAddCandidateOpen] = useState(false);
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ function ThreadDetailPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isError || !thread) {
|
if (isError || !thread) {
|
||||||
@@ -79,7 +79,7 @@ function ThreadDetailPage() {
|
|||||||
Back to planning
|
Back to planning
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isActive = thread.status === "active";
|
const isActive = thread.status === "active";
|
||||||
@@ -93,7 +93,7 @@ function ThreadDetailPage() {
|
|||||||
if (!tempItems) return;
|
if (!tempItems) return;
|
||||||
reorderMutation.mutate({
|
reorderMutation.mutate({
|
||||||
orderedIds: tempItems.map((c) => c.id),
|
orderedIds: tempItems.map((c) => c.id),
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -306,7 +306,7 @@ function ThreadDetailPage() {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AddCandidateModalProps {
|
interface AddCandidateModalProps {
|
||||||
@@ -392,10 +392,10 @@ function AddCandidateModal({ threadId, onClose }: AddCandidateModalProps) {
|
|||||||
{
|
{
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
setForm(INITIAL_MODAL_FORM);
|
setForm(INITIAL_MODAL_FORM);
|
||||||
onClose()
|
onClose();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -625,5 +625,5 @@ function AddCandidateModal({ threadId, onClose }: AddCandidateModalProps) {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,12 +59,20 @@ interface UIState {
|
|||||||
closeCatalogSearch: () => void;
|
closeCatalogSearch: () => void;
|
||||||
|
|
||||||
// Add-to-collection modal
|
// Add-to-collection modal
|
||||||
addToCollectionModal: { open: boolean; globalItemId: number | null; globalItemName: string | null };
|
addToCollectionModal: {
|
||||||
|
open: boolean;
|
||||||
|
globalItemId: number | null;
|
||||||
|
globalItemName: string | null;
|
||||||
|
};
|
||||||
openAddToCollection: (globalItemId: number, globalItemName: string) => void;
|
openAddToCollection: (globalItemId: number, globalItemName: string) => void;
|
||||||
closeAddToCollection: () => void;
|
closeAddToCollection: () => void;
|
||||||
|
|
||||||
// Add-to-thread modal
|
// Add-to-thread modal
|
||||||
addToThreadModal: { open: boolean; globalItemId: number | null; globalItemName: string | null };
|
addToThreadModal: {
|
||||||
|
open: boolean;
|
||||||
|
globalItemId: number | null;
|
||||||
|
globalItemName: string | null;
|
||||||
|
};
|
||||||
openAddToThread: (globalItemId: number, globalItemName: string) => void;
|
openAddToThread: (globalItemId: number, globalItemName: string) => void;
|
||||||
closeAddToThread: () => void;
|
closeAddToThread: () => void;
|
||||||
|
|
||||||
@@ -137,21 +145,41 @@ export const useUIStore = create<UIState>((set) => ({
|
|||||||
fabMenuOpen: false,
|
fabMenuOpen: false,
|
||||||
}),
|
}),
|
||||||
closeCatalogSearch: () =>
|
closeCatalogSearch: () =>
|
||||||
set({ catalogSearchOpen: false, catalogSearchMode: null, catalogSessionThreadId: null }),
|
set({
|
||||||
|
catalogSearchOpen: false,
|
||||||
|
catalogSearchMode: null,
|
||||||
|
catalogSessionThreadId: null,
|
||||||
|
}),
|
||||||
|
|
||||||
// Add-to-collection modal
|
// Add-to-collection modal
|
||||||
addToCollectionModal: { open: false, globalItemId: null, globalItemName: null },
|
addToCollectionModal: {
|
||||||
|
open: false,
|
||||||
|
globalItemId: null,
|
||||||
|
globalItemName: null,
|
||||||
|
},
|
||||||
openAddToCollection: (globalItemId, globalItemName) =>
|
openAddToCollection: (globalItemId, globalItemName) =>
|
||||||
set({ addToCollectionModal: { open: true, globalItemId, globalItemName } }),
|
set({ addToCollectionModal: { open: true, globalItemId, globalItemName } }),
|
||||||
closeAddToCollection: () =>
|
closeAddToCollection: () =>
|
||||||
set({ addToCollectionModal: { open: false, globalItemId: null, globalItemName: null } }),
|
set({
|
||||||
|
addToCollectionModal: {
|
||||||
|
open: false,
|
||||||
|
globalItemId: null,
|
||||||
|
globalItemName: null,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
// Add-to-thread modal
|
// Add-to-thread modal
|
||||||
addToThreadModal: { open: false, globalItemId: null, globalItemName: null },
|
addToThreadModal: { open: false, globalItemId: null, globalItemName: null },
|
||||||
openAddToThread: (globalItemId, globalItemName) =>
|
openAddToThread: (globalItemId, globalItemName) =>
|
||||||
set({ addToThreadModal: { open: true, globalItemId, globalItemName } }),
|
set({ addToThreadModal: { open: true, globalItemId, globalItemName } }),
|
||||||
closeAddToThread: () =>
|
closeAddToThread: () =>
|
||||||
set({ addToThreadModal: { open: false, globalItemId: null, globalItemName: null } }),
|
set({
|
||||||
|
addToThreadModal: {
|
||||||
|
open: false,
|
||||||
|
globalItemId: null,
|
||||||
|
globalItemName: null,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
// Session thread tracking
|
// Session thread tracking
|
||||||
catalogSessionThreadId: null,
|
catalogSessionThreadId: null,
|
||||||
|
|||||||
@@ -595,7 +595,8 @@ export const DEV_USER_ITEMS = [
|
|||||||
weightGrams: 179,
|
weightGrams: 179,
|
||||||
priceCents: 1200,
|
priceCents: 1200,
|
||||||
purchasePriceCents: null,
|
purchasePriceCents: null,
|
||||||
notes: "Backup water carry, also doubles as hot water bottle in sleep system.",
|
notes:
|
||||||
|
"Backup water carry, also doubles as hot water bottle in sleep system.",
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
},
|
},
|
||||||
] as const;
|
] as const;
|
||||||
|
|||||||
Reference in New Issue
Block a user