mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 13:31:12 -05:00
Compare commits
7 Commits
edit/edt-9
...
edit/edt-5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6087b54213 | ||
|
|
68384156ab | ||
|
|
5cc5d3eab6 | ||
|
|
706e36c847 | ||
|
|
a1beba6996 | ||
|
|
d7158756ef | ||
|
|
3330a8fac9 |
@@ -10,6 +10,7 @@ interface DetailedViewCollapsibleProps {
|
||||
children: React.ReactNode;
|
||||
fieldCount?: number;
|
||||
className?: string;
|
||||
staggerIndex?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,8 +22,11 @@ export function DetailedViewCollapsible({
|
||||
onToggle,
|
||||
children,
|
||||
fieldCount,
|
||||
className
|
||||
className,
|
||||
staggerIndex = 0
|
||||
}: DetailedViewCollapsibleProps) {
|
||||
// Calculate stagger delay: 50ms per item, max 300ms
|
||||
const staggerDelay = Math.min(staggerIndex * 50, 300);
|
||||
return (
|
||||
<Collapsible open={!isCollapsed} onOpenChange={() => onToggle()}>
|
||||
<div className={cn("mt-6 pt-6 border-t", className)}>
|
||||
@@ -59,7 +63,13 @@ export function DetailedViewCollapsible({
|
||||
</Button>
|
||||
</CollapsibleTrigger>
|
||||
|
||||
<CollapsibleContent className="mt-3">
|
||||
<CollapsibleContent
|
||||
className="mt-3"
|
||||
style={{
|
||||
animationDelay: `${staggerDelay}ms`,
|
||||
transitionDelay: `${staggerDelay}ms`
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</CollapsibleContent>
|
||||
</div>
|
||||
|
||||
@@ -135,7 +135,7 @@ export const SubmissionItemsList = memo(function SubmissionItemsList({
|
||||
}
|
||||
|
||||
// Render item with appropriate display component
|
||||
const renderItem = (item: SubmissionItemData) => {
|
||||
const renderItem = (item: SubmissionItemData, index: number = 0) => {
|
||||
// SubmissionItemData from submissions.ts has item_data property
|
||||
const entityData = item.item_data;
|
||||
const actionType = item.action_type || 'create';
|
||||
@@ -201,6 +201,7 @@ export const SubmissionItemsList = memo(function SubmissionItemsList({
|
||||
isCollapsed={isCollapsed}
|
||||
onToggle={toggle}
|
||||
fieldCount={countFields(entityData)}
|
||||
staggerIndex={index}
|
||||
>
|
||||
<SubmissionChangesDisplay
|
||||
item={item}
|
||||
@@ -225,6 +226,7 @@ export const SubmissionItemsList = memo(function SubmissionItemsList({
|
||||
isCollapsed={isCollapsed}
|
||||
onToggle={toggle}
|
||||
fieldCount={countFields(entityData)}
|
||||
staggerIndex={index}
|
||||
>
|
||||
<SubmissionChangesDisplay
|
||||
item={item}
|
||||
@@ -249,6 +251,7 @@ export const SubmissionItemsList = memo(function SubmissionItemsList({
|
||||
isCollapsed={isCollapsed}
|
||||
onToggle={toggle}
|
||||
fieldCount={countFields(entityData)}
|
||||
staggerIndex={index}
|
||||
>
|
||||
<SubmissionChangesDisplay
|
||||
item={item}
|
||||
@@ -273,6 +276,7 @@ export const SubmissionItemsList = memo(function SubmissionItemsList({
|
||||
isCollapsed={isCollapsed}
|
||||
onToggle={toggle}
|
||||
fieldCount={countFields(entityData)}
|
||||
staggerIndex={index}
|
||||
>
|
||||
<SubmissionChangesDisplay
|
||||
item={item}
|
||||
@@ -297,6 +301,7 @@ export const SubmissionItemsList = memo(function SubmissionItemsList({
|
||||
isCollapsed={isCollapsed}
|
||||
onToggle={toggle}
|
||||
fieldCount={countFields(entityData)}
|
||||
staggerIndex={index}
|
||||
>
|
||||
<SubmissionChangesDisplay
|
||||
item={item}
|
||||
@@ -334,9 +339,9 @@ export const SubmissionItemsList = memo(function SubmissionItemsList({
|
||||
)}
|
||||
|
||||
{/* Show regular submission items */}
|
||||
{items.map((item) => (
|
||||
{items.map((item, index) => (
|
||||
<div key={item.id} className={view === 'summary' ? 'border-l-2 border-primary/20 pl-3' : ''}>
|
||||
{renderItem(item)}
|
||||
{renderItem(item, index)}
|
||||
</div>
|
||||
))}
|
||||
|
||||
|
||||
@@ -50,8 +50,10 @@ export function useDetailedViewState(): UseDetailedViewStateReturn {
|
||||
});
|
||||
}
|
||||
|
||||
if (data?.moderation_preferences) {
|
||||
const prefs = data.moderation_preferences as ModerationPreferences;
|
||||
// Type assertion needed until Supabase regenerates types after migration
|
||||
const preferences = (data as any)?.moderation_preferences;
|
||||
if (preferences) {
|
||||
const prefs = preferences as ModerationPreferences;
|
||||
setIsCollapsed(prefs.detailed_view_collapsed ?? true);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -7,6 +7,7 @@ import { twMerge } from "tailwind-merge";
|
||||
*
|
||||
* @param inputs - Class values to combine (strings, objects, arrays)
|
||||
* @returns Merged class string with Tailwind conflicts resolved
|
||||
* @example cn('px-2 py-1', 'px-4') // Returns 'py-1 px-4'
|
||||
*/
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
|
||||
@@ -207,8 +207,8 @@ const handler = async (req: Request, context: { supabase: any; user: any; span:
|
||||
p_moderator_id: user.id,
|
||||
p_submitter_id: submission.user_id,
|
||||
p_request_id: requestId,
|
||||
p_trace_id: rootSpan.traceId,
|
||||
p_parent_span_id: rpcSpan.spanId
|
||||
p_approval_mode: 'selective',
|
||||
p_idempotency_key: idempotencyKey
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user