code-review-fix task 12.3: fix dark theme on annotation-types and span-label-types pages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marko Djordjevic 2026-02-18 20:36:31 +01:00
parent 6a194e81ac
commit fd4550d444
2 changed files with 68 additions and 68 deletions

View file

@ -158,7 +158,7 @@ export default function AnnotationTypesPage() {
if (loading) { if (loading) {
return ( return (
<div className="min-h-screen bg-gray-50 p-8"> <div className="min-h-screen bg-background p-8">
<div className="max-w-6xl mx-auto"> <div className="max-w-6xl mx-auto">
<p>Loading...</p> <p>Loading...</p>
</div> </div>
@ -167,12 +167,12 @@ export default function AnnotationTypesPage() {
} }
return ( return (
<div className="min-h-screen bg-gray-50 p-8"> <div className="min-h-screen bg-background p-8">
<div className="max-w-6xl mx-auto"> <div className="max-w-6xl mx-auto">
<div className="flex justify-between items-center mb-6"> <div className="flex justify-between items-center mb-6">
<div> <div>
<h1 className="text-3xl font-bold text-gray-900">Annotation Types</h1> <h1 className="text-3xl font-bold text-foreground">Annotation Types</h1>
<p className="text-gray-600 mt-1">Manage annotation types for your charts</p> <p className="text-muted-foreground mt-1">Manage annotation types for your charts</p>
</div> </div>
<div className="flex gap-2"> <div className="flex gap-2">
<Button onClick={() => window.location.href = '/'} variant="outline"> <Button onClick={() => window.location.href = '/'} variant="outline">
@ -192,14 +192,14 @@ export default function AnnotationTypesPage() {
</div> </div>
{showAddForm && ( {showAddForm && (
<div className="bg-white p-6 rounded-lg shadow mb-6"> <div className="bg-background border border-border p-6 rounded-lg shadow mb-6">
<h2 className="text-xl font-semibold mb-4"> <h2 className="text-xl font-semibold mb-4">
{editingId !== null ? 'Edit Annotation Type' : 'Add New Annotation Type'} {editingId !== null ? 'Edit Annotation Type' : 'Add New Annotation Type'}
</h2> </h2>
<form onSubmit={handleSubmit} className="space-y-4"> <form onSubmit={handleSubmit} className="space-y-4">
<div className="grid grid-cols-2 gap-4"> <div className="grid grid-cols-2 gap-4">
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-foreground mb-1">
Internal Name * Internal Name *
</label> </label>
<Input <Input
@ -210,13 +210,13 @@ export default function AnnotationTypesPage() {
required required
disabled={editingId !== null} disabled={editingId !== null}
/> />
<p className="text-xs text-gray-500 mt-1"> <p className="text-xs text-muted-foreground mt-1">
Used internally (cannot be changed after creation) Used internally (cannot be changed after creation)
</p> </p>
</div> </div>
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-foreground mb-1">
Display Name * Display Name *
</label> </label>
<Input <Input
@ -229,7 +229,7 @@ export default function AnnotationTypesPage() {
</div> </div>
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-foreground mb-1">
Color * Color *
</label> </label>
<div className="flex gap-2"> <div className="flex gap-2">
@ -250,13 +250,13 @@ export default function AnnotationTypesPage() {
</div> </div>
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-foreground mb-1">
Category * Category *
</label> </label>
<select <select
value={formData.category} value={formData.category}
onChange={(e) => setFormData({ ...formData, category: e.target.value })} onChange={(e) => setFormData({ ...formData, category: e.target.value })}
className="w-full px-3 py-2 border border-gray-300 rounded-md" className="w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
required required
> >
<option value="marker">Marker</option> <option value="marker">Marker</option>
@ -265,7 +265,7 @@ export default function AnnotationTypesPage() {
</div> </div>
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-foreground mb-1">
Icon Icon
</label> </label>
<Input <Input
@ -289,72 +289,72 @@ export default function AnnotationTypesPage() {
</div> </div>
)} )}
<div className="bg-white rounded-lg shadow overflow-hidden"> <div className="bg-background border border-border rounded-lg shadow overflow-hidden">
<table className="min-w-full divide-y divide-gray-200"> <table className="min-w-full divide-y divide-border">
<thead className="bg-gray-50"> <thead className="bg-muted">
<tr> <tr>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Name Name
</th> </th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Display Name Display Name
</th> </th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Color Color
</th> </th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Category Category
</th> </th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Icon Icon
</th> </th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Status Status
</th> </th>
<th className="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-right text-xs font-medium text-muted-foreground uppercase tracking-wider">
Actions Actions
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody className="bg-white divide-y divide-gray-200"> <tbody className="bg-background divide-y divide-border">
{types.length === 0 ? ( {types.length === 0 ? (
<tr> <tr>
<td colSpan={7} className="px-6 py-8 text-center text-gray-500"> <td colSpan={7} className="px-6 py-8 text-center text-muted-foreground">
No annotation types found. Click "Seed Default Types" to get started. No annotation types found. Click "Seed Default Types" to get started.
</td> </td>
</tr> </tr>
) : ( ) : (
types.map((type) => ( types.map((type) => (
<tr key={type.id} className="hover:bg-gray-50"> <tr key={type.id} className="hover:bg-muted/50">
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> <td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-foreground">
{type.name} {type.name}
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900"> <td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">
{type.display_name} {type.display_name}
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm"> <td className="px-6 py-4 whitespace-nowrap text-sm">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<div <div
className="w-6 h-6 rounded border border-gray-300" className="w-6 h-6 rounded border border-border"
style={{ backgroundColor: type.color }} style={{ backgroundColor: type.color }}
/> />
<span className="text-gray-600">{type.color}</span> <span className="text-muted-foreground">{type.color}</span>
</div> </div>
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900"> <td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">
<span className="px-2 py-1 text-xs font-medium rounded-full bg-blue-100 text-blue-800"> <span className="px-2 py-1 text-xs font-medium rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300">
{type.category} {type.category}
</span> </span>
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-600"> <td className="px-6 py-4 whitespace-nowrap text-sm text-muted-foreground">
{type.icon || '-'} {type.icon || '-'}
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm"> <td className="px-6 py-4 whitespace-nowrap text-sm">
<span <span
className={`px-2 py-1 text-xs font-medium rounded-full ${ className={`px-2 py-1 text-xs font-medium rounded-full ${
type.is_active type.is_active
? 'bg-green-100 text-green-800' ? 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300'
: 'bg-gray-100 text-gray-800' : 'bg-muted text-muted-foreground'
}`} }`}
> >
{type.is_active ? 'Active' : 'Inactive'} {type.is_active ? 'Active' : 'Inactive'}

View file

@ -167,7 +167,7 @@ export default function SpanLabelTypesPage() {
if (loading) { if (loading) {
return ( return (
<div className="min-h-screen bg-gray-50 p-8"> <div className="min-h-screen bg-background p-8">
<div className="max-w-6xl mx-auto"> <div className="max-w-6xl mx-auto">
<p>Loading...</p> <p>Loading...</p>
</div> </div>
@ -176,12 +176,12 @@ export default function SpanLabelTypesPage() {
} }
return ( return (
<div className="min-h-screen bg-gray-50 p-8"> <div className="min-h-screen bg-background p-8">
<div className="max-w-6xl mx-auto"> <div className="max-w-6xl mx-auto">
<div className="flex justify-between items-center mb-6"> <div className="flex justify-between items-center mb-6">
<div> <div>
<h1 className="text-3xl font-bold text-gray-900">Span Label Types</h1> <h1 className="text-3xl font-bold text-foreground">Span Label Types</h1>
<p className="text-gray-600 mt-1">Manage pattern labels for span annotations</p> <p className="text-muted-foreground mt-1">Manage pattern labels for span annotations</p>
</div> </div>
<div className="flex gap-2"> <div className="flex gap-2">
<Button onClick={() => window.location.href = '/'} variant="outline"> <Button onClick={() => window.location.href = '/'} variant="outline">
@ -201,14 +201,14 @@ export default function SpanLabelTypesPage() {
</div> </div>
{showAddForm && ( {showAddForm && (
<div className="bg-white p-6 rounded-lg shadow mb-6"> <div className="bg-background border border-border p-6 rounded-lg shadow mb-6">
<h2 className="text-xl font-semibold mb-4"> <h2 className="text-xl font-semibold mb-4">
{editingId !== null ? 'Edit Span Label Type' : 'Add New Span Label Type'} {editingId !== null ? 'Edit Span Label Type' : 'Add New Span Label Type'}
</h2> </h2>
<form onSubmit={handleSubmit} className="space-y-4"> <form onSubmit={handleSubmit} className="space-y-4">
<div className="grid grid-cols-2 gap-4"> <div className="grid grid-cols-2 gap-4">
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-foreground mb-1">
Internal Name * Internal Name *
</label> </label>
<Input <Input
@ -219,13 +219,13 @@ export default function SpanLabelTypesPage() {
required required
disabled={editingId !== null} disabled={editingId !== null}
/> />
<p className="text-xs text-gray-500 mt-1"> <p className="text-xs text-muted-foreground mt-1">
Used internally (cannot be changed after creation) Used internally (cannot be changed after creation)
</p> </p>
</div> </div>
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-foreground mb-1">
Display Name * Display Name *
</label> </label>
<Input <Input
@ -238,7 +238,7 @@ export default function SpanLabelTypesPage() {
</div> </div>
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-foreground mb-1">
Color * Color *
</label> </label>
<div className="flex gap-2"> <div className="flex gap-2">
@ -259,7 +259,7 @@ export default function SpanLabelTypesPage() {
</div> </div>
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-foreground mb-1">
Hotkey Hotkey
</label> </label>
<Input <Input
@ -269,13 +269,13 @@ export default function SpanLabelTypesPage() {
placeholder="e.g., 1, 2, 3" placeholder="e.g., 1, 2, 3"
maxLength={1} maxLength={1}
/> />
<p className="text-xs text-gray-500 mt-1"> <p className="text-xs text-muted-foreground mt-1">
Single key for quick assignment (optional) Single key for quick assignment (optional)
</p> </p>
</div> </div>
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-foreground mb-1">
Sort Order Sort Order
</label> </label>
<Input <Input
@ -284,7 +284,7 @@ export default function SpanLabelTypesPage() {
onChange={(e) => setFormData({ ...formData, sort_order: parseInt(e.target.value) || 0 })} onChange={(e) => setFormData({ ...formData, sort_order: parseInt(e.target.value) || 0 })}
placeholder="0" placeholder="0"
/> />
<p className="text-xs text-gray-500 mt-1"> <p className="text-xs text-muted-foreground mt-1">
Lower numbers appear first Lower numbers appear first
</p> </p>
</div> </div>
@ -302,70 +302,70 @@ export default function SpanLabelTypesPage() {
</div> </div>
)} )}
<div className="bg-white rounded-lg shadow overflow-hidden"> <div className="bg-background border border-border rounded-lg shadow overflow-hidden">
<table className="min-w-full divide-y divide-gray-200"> <table className="min-w-full divide-y divide-border">
<thead className="bg-gray-50"> <thead className="bg-muted">
<tr> <tr>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Name Name
</th> </th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Display Name Display Name
</th> </th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Color Color
</th> </th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Hotkey Hotkey
</th> </th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Sort Order Sort Order
</th> </th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">
Status Status
</th> </th>
<th className="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider"> <th className="px-6 py-3 text-right text-xs font-medium text-muted-foreground uppercase tracking-wider">
Actions Actions
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody className="bg-white divide-y divide-gray-200"> <tbody className="bg-background divide-y divide-border">
{types.length === 0 ? ( {types.length === 0 ? (
<tr> <tr>
<td colSpan={7} className="px-6 py-8 text-center text-gray-500"> <td colSpan={7} className="px-6 py-8 text-center text-muted-foreground">
No span label types found. Click "Seed Default Types" to get started. No span label types found. Click "Seed Default Types" to get started.
</td> </td>
</tr> </tr>
) : ( ) : (
types.map((type) => ( types.map((type) => (
<tr key={type.id} className="hover:bg-gray-50"> <tr key={type.id} className="hover:bg-muted/50">
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"> <td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-foreground">
{type.name} {type.name}
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900"> <td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">
{type.display_name} {type.display_name}
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm"> <td className="px-6 py-4 whitespace-nowrap text-sm">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<div <div
className="w-6 h-6 rounded border border-gray-300" className="w-6 h-6 rounded border border-border"
style={{ backgroundColor: type.color }} style={{ backgroundColor: type.color }}
/> />
<span className="text-gray-600">{type.color}</span> <span className="text-muted-foreground">{type.color}</span>
</div> </div>
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-600 font-mono"> <td className="px-6 py-4 whitespace-nowrap text-sm text-muted-foreground font-mono">
{type.hotkey || '-'} {type.hotkey || '-'}
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-600"> <td className="px-6 py-4 whitespace-nowrap text-sm text-muted-foreground">
{type.sort_order} {type.sort_order}
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm"> <td className="px-6 py-4 whitespace-nowrap text-sm">
<span <span
className={`px-2 py-1 text-xs font-medium rounded-full ${ className={`px-2 py-1 text-xs font-medium rounded-full ${
type.is_active type.is_active
? 'bg-green-100 text-green-800' ? 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300'
: 'bg-gray-100 text-gray-800' : 'bg-muted text-muted-foreground'
}`} }`}
> >
{type.is_active ? 'Active' : 'Inactive'} {type.is_active ? 'Active' : 'Inactive'}