Skip to content

Commit 480aa01

Browse files
committed
fixes
1 parent 8fdd4e3 commit 480aa01

File tree

11 files changed

+186
-38
lines changed

11 files changed

+186
-38
lines changed

backend/NXTBackend.API.Domain/Entities/Comment.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
// ============================================================================
55

66
using System.ComponentModel.DataAnnotations.Schema;
7-
using Microsoft.EntityFrameworkCore;
87
using NXTBackend.API.Domain.Common;
98
using NXTBackend.API.Domain.Entities.Users;
109

1110
// ============================================================================
1211

13-
namespace NXTBackend.API.Domain.Entities.Evaluation;
12+
namespace NXTBackend.API.Domain.Entities;
1413

1514
// ============================================================================
1615

@@ -26,7 +25,10 @@ public Comment()
2625
UserId = Guid.Empty;
2726
}
2827

29-
[Column("markdown")]
28+
[Column("parent_id")]
29+
public Guid ParentId { get; set; }
30+
31+
[Column("markdown")]
3032
public string Markdown { get; set; }
3133

3234
[Column("user_id")]

frontend/src/app.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
--sidebar-ring: hsl(33 100% 60%); /* Consistent with main ring */
4141

4242
--radius: 0.5rem;
43+
44+
--header-height: 3.5rem; /* 56px */
4345
}
4446

4547
.dark {
@@ -135,6 +137,7 @@
135137
}
136138

137139
body {
140+
font-family: "Nunito Sans", sans-serif;
138141
--tw-gradient-from: currentColor;
139142
--tw-gradient-stops:
140143
var(--tw-gradient-from), var(--tw-gradient-to, rgba(255, 255, 255, 0));

frontend/src/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
77
<link rel="preconnect" href="https://fonts.googleapis.com">
88
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9-
<link href="https://fonts.googleapis.com/css2?family=Geist+Mono:[email protected]&display=swap" rel="stylesheet">
9+
<link href="https://fonts.googleapis.com/css2?family=Geist+Mono:[email protected]&family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap" rel="stylesheet">
1010
<meta name="viewport" content="width=device-width, initial-scale=1" />
1111
%sveltekit.head%
1212
</head>

frontend/src/lib/components/base.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
</div>
3535
</div>
3636
{:else if variant === "splitpane"}
37-
<div class="h-dvh w-full">
37+
<div class="h-[calc(100dvh-var(--header-height))] w-full">
3838
<Resizable.PaneGroup direction="horizontal">
39-
<Resizable.Pane minSize={30} maxSize={50} defaultSize={30}>
39+
<Resizable.Pane minSize={15} maxSize={25} defaultSize={20}>
4040
{@render left()}
4141
</Resizable.Pane>
4242
<Resizable.Handle withHandle />
43-
<Resizable.Pane minSize={50} maxSize={70}>
43+
<Resizable.Pane defaultSize={80}>
4444
{@render right()}
4545
</Resizable.Pane>
4646
</Resizable.PaneGroup>

frontend/src/lib/components/header.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
{/snippet}
6565

6666
<header
67-
class="bg-muted dark:bg-card z-50 flex h-(--header-height) w-full items-center justify-between gap-2 border-b p-3"
67+
class="bg-muted dark:bg-card z-50 flex h-[var(--header-height)] w-full items-center justify-between gap-2 border-b p-3"
6868
>
6969
<!-- Right side -->
7070
<div class="flex flex-1 items-center gap-2">

frontend/src/lib/components/ui/resizable/resizable-handle.svelte

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<script lang="ts">
22
import GripVerticalIcon from "@lucide/svelte/icons/grip-vertical";
33
import * as ResizablePrimitive from "paneforge";
4-
import { cn, type WithoutChildrenOrChild } from "$lib/utils.js";
4+
import type { WithoutChildrenOrChild } from "bits-ui";
5+
import { cn } from "$lib/utils";
56
67
let {
78
ref = $bindable(null),
@@ -17,14 +18,16 @@
1718
bind:ref
1819
data-slot="resizable-handle"
1920
class={cn(
20-
"bg-border focus-visible:ring-ring focus-visible:outline-hidden relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90",
21-
className
21+
"bg-border focus-visible:ring-ring focus-visible:outline-hidden relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90",
22+
className,
2223
)}
2324
{...restProps}
2425
>
2526
{#if withHandle}
26-
<div class="bg-border rounded-xs z-10 flex h-4 w-3 items-center justify-center border">
27-
<GripVerticalIcon class="size-2.5" />
27+
<div
28+
class="bg-border rounded-xs z-10 flex h-8 w-3 items-center justify-center border"
29+
>
30+
<GripVerticalIcon class="size-8" />
2831
</div>
2932
{/if}
3033
</ResizablePrimitive.PaneResizer>

frontend/src/lib/components/vfs/vfs.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@
152152
}}
153153
>
154154
<IconComponent class="h-4 min-w-4" />
155-
<span class={cn("truncate", isSelected && "line-through")}>{node.name}</span>
156-
<Check class={cn("h-4 w-4 ml-auto", !isSelected && "opacity-0 group-hover:opacity-100")} />
155+
<span>{node.name}</span>
157156
</Button>
158157
</li>
159158
{/if}
Lines changed: 126 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,142 @@
11
<script lang="ts">
2+
import Button from "$lib/components/ui/button/button.svelte";
3+
import { ArrowDown, FileUp, AlertTriangle, MessageSquare } from "lucide-svelte";
24
import type { VFSFile } from "../types";
5+
import Separator from "$lib/components/ui/separator/separator.svelte";
6+
import Textarea from "$lib/components/ui/textarea/textarea.svelte";
7+
import Badge from "$lib/components/ui/badge/badge.svelte";
8+
import { toast } from "svelte-sonner";
39
410
interface Props {
511
file: VFSFile;
612
}
713
814
const { file }: Props = $props();
915
let success = $state(true);
16+
let showRubricPanel = $state(false);
17+
let rubricFeedback = $state("");
18+
19+
function handleUpload(e: Event) {
20+
const input = e.target as HTMLInputElement;
21+
const uploadedFile = input.files?.[0];
22+
23+
if (uploadedFile) {
24+
// Here you would implement the actual upload logic
25+
toast.success(`${uploadedFile.name} has been uploaded for review`);
26+
input.value = "";
27+
}
28+
}
29+
30+
function submitFeedback() {
31+
// Here you would implement the logic to submit the textual feedback
32+
toast.success(`Your correction notes have been saved`);
33+
showRubricPanel = false;
34+
}
1035
</script>
1136

12-
<div class="relative h-full w-full">
13-
<iframe
14-
title="Word Document"
15-
src="https://view.officeapps.live.com/op/embed.aspx?src={file.content}"
16-
width="100%"
17-
height="100%"
18-
frameborder="0"
19-
onerror={() => (success = false)}
20-
>This is an embedded <a target="_blank" href="http://office.com">Microsoft Office</a>
21-
document, powered by
22-
<a target="_blank" href="http://office.com/webapps">Office Online</a>.</iframe
23-
>
24-
25-
{#if !success}
26-
<div
27-
class="absolute inset-0 flex flex-col items-center justify-center bg-white/90 p-4"
37+
<div class="relative flex h-full w-full flex-col">
38+
39+
<!-- Controls Menu -->
40+
<menu class="bg-muted sticky top-0 z-50 flex items-center gap-3 p-3 shadow">
41+
42+
<!-- Download -->
43+
<Button
44+
variant="outline"
45+
title="Download document"
46+
onclick={() => {
47+
const link = document.createElement("a");
48+
link.href = file.content;
49+
link.download = file.name || "document.docx";
50+
link.click();
51+
}}
52+
>
53+
Download
54+
<ArrowDown class="ml-2 h-4 w-4" />
55+
</Button>
56+
57+
<!-- Upload correction docx -->
58+
<Button variant="secondary" class="relative" title="Upload correction document">
59+
<FileUp class="mr-2 h-4 w-4" />
60+
Upload Corrections
61+
<input
62+
type="file"
63+
accept=".docx,.doc"
64+
class="absolute inset-0 cursor-pointer opacity-0"
65+
onchange={handleUpload}
66+
/>
67+
</Button>
68+
69+
<!-- Rubric feedback toggle -->
70+
<Button
71+
variant={showRubricPanel ? "default" : "outline"}
72+
onclick={() => (showRubricPanel = !showRubricPanel)}
2873
>
29-
<div class="max-w-md rounded border border-red-400 bg-red-100 p-4 text-red-700">
30-
<p class="mb-2 text-lg font-bold">Error Loading Document</p>
31-
<p>
32-
The document could not be loaded. Please check the file format or try again
33-
later.
34-
</p>
74+
<MessageSquare class="mr-2 h-4 w-4" />
75+
{showRubricPanel ? "Hide Feedback" : "Add Feedback"}
76+
</Button>
77+
</menu>
78+
79+
<!-- Preview Banner -->
80+
<div class="border-b border-amber-200 bg-amber-50 p-2 text-center text-amber-800">
81+
<AlertTriangle class="mr-1 inline-block h-4 w-4" />
82+
<span class="font-medium">Preview Only</span>
83+
<span class="ml-1 text-sm">— Submit corrections using the options below</span>
84+
</div>
85+
86+
<!-- Rubric Feedback Panel -->
87+
{#if showRubricPanel}
88+
<div class="border-b bg-white p-4 shadow-sm">
89+
<h3 class="mb-2 font-medium">Correction Notes</h3>
90+
<Textarea
91+
placeholder="Enter your feedback and correction notes here..."
92+
class="mb-3 min-h-[100px]"
93+
bind:value={rubricFeedback}
94+
/>
95+
<div class="flex justify-end gap-2">
96+
<Button variant="outline" onclick={() => (showRubricPanel = false)}>
97+
Cancel
98+
</Button>
99+
<Button onclick={submitFeedback}>Submit Feedback</Button>
35100
</div>
36101
</div>
37102
{/if}
103+
104+
<!-- Document Viewer -->
105+
<div class="relative flex-1">
106+
<iframe
107+
title="Word Document"
108+
src="https://view.officeapps.live.com/op/embed.aspx?src={file.content}"
109+
width="100%"
110+
height="100%"
111+
frameborder="0"
112+
onerror={() => (success = false)}
113+
class="absolute inset-0 inset-shadow-xl"
114+
>This is an embedded <a target="_blank" href="http://office.com">Microsoft Office</a
115+
>
116+
document, powered by
117+
<a target="_blank" href="http://office.com/webapps">Office Online</a>.
118+
</iframe>
119+
120+
<!-- Error State -->
121+
{#if !success}
122+
<div
123+
class="absolute inset-0 flex flex-col items-center justify-center bg-white/90 p-4"
124+
>
125+
<div class="max-w-md rounded border border-red-400 bg-red-100 p-4 text-red-700">
126+
<p class="mb-2 text-lg font-bold">Error Loading Document</p>
127+
<p>
128+
The document could not be loaded. Please check the file format or try again
129+
later.
130+
</p>
131+
</div>
132+
</div>
133+
{/if}
134+
135+
<!-- Watermark -->
136+
<div class="pointer-events-none absolute bottom-0 right-0 m-20">
137+
<div class="rotate-[-30deg] scale-150 transform text-lg font-bold text-red-500/20">
138+
PREVIEW ONLY
139+
</div>
140+
</div>
141+
</div>
38142
</div>

frontend/src/routes/(app)/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030

3131
<Tooltip.Provider>
3232
<ModeWatcher defaultMode="system"/>
33+
<Toaster closeButton richColors duration={8000} />
3334
<DialogProvider />
3435
{#if data.session}
35-
<Toaster closeButton richColors duration={8000} />
3636
<Header />
3737
{/if}
3838
<main>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<script lang="ts">
2+
import * as Select from "$lib/components/ui/select/index.js";
3+
import { Button } from "$lib/components/ui/button/index.js";
4+
import { Input } from "$lib/components/ui/input/index.js";
5+
import { Search } from "lucide-svelte";
6+
7+
let { children, data } = $props();
8+
9+
// Status options
10+
const statusOptions = [
11+
{ value: "", label: "All" },
12+
{ value: "pending", label: "Pending" },
13+
{ value: "in-progress", label: "In Progress" },
14+
{ value: "completed", label: "Completed" },
15+
{ value: "failed", label: "Failed" },
16+
];
17+
18+
// Sort options
19+
const sortOptions = [
20+
{ value: "newest", label: "Newest first" },
21+
{ value: "oldest", label: "Oldest first" },
22+
{ value: "name-asc", label: "Name A-Z" },
23+
];
24+
25+
let statusValue = $state("");
26+
let sortValue = $state("newest");
27+
28+
const statusTriggerContent = $derived(
29+
statusOptions.find((opt) => opt.value === statusValue)?.label ?? "Status: All",
30+
);
31+
32+
const sortTriggerContent = $derived(
33+
sortOptions.find((opt) => opt.value === sortValue)?.label ?? "Sort: Newest first",
34+
);
35+
</script>
36+
37+
{@render children?.()}

0 commit comments

Comments
 (0)