mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-22 04:06:43 +02:00
chore: various UI improvements and fixes
Calendar: - Fix EventDetailModal and QuickEventOverlay component updates - Update TodoDetailModal and TodoItem components - Remove unused settings section code - Fix network page styling Todo Backend: - Improve task service validation Shared UI: - Update Card, DataCard, Input components with improvements - Enhance TagBadge with better color handling - Fix TagEditModal and TagList components - Update PillNavigation and PillDropdown styling - Add NetworkGraph improvements - Update CommandBar, FormModal, AppsPage components - Fix chart types and GlobalSettingsSection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b92dc296a1
commit
0b28eba3f2
26 changed files with 167 additions and 198 deletions
|
|
@ -145,8 +145,8 @@
|
|||
|
||||
<svelte:window onkeydown={handleKeydown} />
|
||||
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions -->
|
||||
<div class="modal-backdrop" onclick={handleBackdropClick}>
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions a11y_no_noninteractive_element_to_interactive_role -->
|
||||
<div class="modal-backdrop" onclick={handleBackdropClick} role="button" tabindex="-1">
|
||||
<div class="modal-container" role="dialog" aria-modal="true" aria-labelledby="modal-title">
|
||||
{#if loading}
|
||||
<EventDetailSkeleton />
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@
|
|||
<!-- Tags -->
|
||||
{#if availableTags.length > 0 || eventTagsStore.loading}
|
||||
<div class="flex flex-col gap-2">
|
||||
<label class="text-sm font-medium text-foreground">Tags</label>
|
||||
<span class="text-sm font-medium text-foreground">Tags</span>
|
||||
<TagSelector
|
||||
tags={availableTags}
|
||||
{selectedTags}
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@
|
|||
></div>
|
||||
</div>
|
||||
<div class="row-content">
|
||||
<label class="field-label">Kalender</label>
|
||||
<span class="field-label">Kalender</span>
|
||||
{#if calendarsStore.calendars.length > 0}
|
||||
<select class="field-select" value={calendarId} onchange={handleCalendarChange}>
|
||||
{#each calendarsStore.calendars as cal}
|
||||
|
|
@ -565,7 +565,8 @@
|
|||
</div>
|
||||
|
||||
<!-- All day toggle -->
|
||||
<div class="form-row clickable" onclick={handleAllDayToggle}>
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions a11y_no_noninteractive_element_to_interactive_role -->
|
||||
<div class="form-row clickable" onclick={handleAllDayToggle} role="button" tabindex="0">
|
||||
<div class="row-icon">
|
||||
<svg class="icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path
|
||||
|
|
@ -593,7 +594,7 @@
|
|||
<div class="form-row sub-row">
|
||||
<div class="row-icon"></div>
|
||||
<div class="row-content">
|
||||
<label class="field-label">Anzeigeart</label>
|
||||
<span class="field-label">Anzeigeart</span>
|
||||
<select class="field-select" bind:value={allDayDisplayMode}>
|
||||
<option value="default">Standard (aus Einstellungen)</option>
|
||||
<option value="header">In Kopfzeile</option>
|
||||
|
|
@ -617,7 +618,7 @@
|
|||
</div>
|
||||
<div class="row-content datetime-row">
|
||||
<div class="datetime-field">
|
||||
<label class="field-label">Beginn</label>
|
||||
<span class="field-label">Beginn</span>
|
||||
<input
|
||||
type="date"
|
||||
class="field-input"
|
||||
|
|
@ -627,7 +628,7 @@
|
|||
</div>
|
||||
{#if !isAllDay}
|
||||
<div class="datetime-field time-field">
|
||||
<label class="field-label">Uhrzeit</label>
|
||||
<span class="field-label">Uhrzeit</span>
|
||||
<input
|
||||
type="time"
|
||||
class="field-input"
|
||||
|
|
@ -653,7 +654,7 @@
|
|||
</div>
|
||||
<div class="row-content datetime-row">
|
||||
<div class="datetime-field">
|
||||
<label class="field-label">Ende</label>
|
||||
<span class="field-label">Ende</span>
|
||||
<input
|
||||
type="date"
|
||||
class="field-input"
|
||||
|
|
@ -663,7 +664,7 @@
|
|||
</div>
|
||||
{#if !isAllDay}
|
||||
<div class="datetime-field time-field">
|
||||
<label class="field-label">Uhrzeit</label>
|
||||
<span class="field-label">Uhrzeit</span>
|
||||
<input
|
||||
type="time"
|
||||
class="field-input"
|
||||
|
|
@ -731,7 +732,7 @@
|
|||
<div class="row-icon"></div>
|
||||
<div class="row-content address-details-form">
|
||||
<div class="address-field">
|
||||
<label class="field-label">Straße</label>
|
||||
<span class="field-label">Straße</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field-input"
|
||||
|
|
@ -741,7 +742,7 @@
|
|||
</div>
|
||||
<div class="address-row">
|
||||
<div class="address-field postal">
|
||||
<label class="field-label">PLZ</label>
|
||||
<span class="field-label">PLZ</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field-input"
|
||||
|
|
@ -750,7 +751,7 @@
|
|||
/>
|
||||
</div>
|
||||
<div class="address-field city">
|
||||
<label class="field-label">Stadt</label>
|
||||
<span class="field-label">Stadt</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field-input"
|
||||
|
|
@ -760,7 +761,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="address-field">
|
||||
<label class="field-label">Land</label>
|
||||
<span class="field-label">Land</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field-input"
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@
|
|||
</button>
|
||||
{:else}
|
||||
<form class="quick-add-form" onsubmit={handleSubmit}>
|
||||
<!-- svelte-ignore a11y_autofocus -->
|
||||
<input
|
||||
bind:this={inputRef}
|
||||
bind:value={title}
|
||||
|
|
|
|||
|
|
@ -23,12 +23,21 @@
|
|||
let isDeleting = $state(false);
|
||||
let isToggling = $state(false);
|
||||
|
||||
// Form state
|
||||
let title = $state(task.title);
|
||||
let description = $state(task.description || '');
|
||||
let dueDate = $state(task.dueDate ? formatDateForInput(task.dueDate) : '');
|
||||
let dueTime = $state(task.dueTime || '');
|
||||
let priority = $state<TaskPriority>(task.priority);
|
||||
// Form state - initialized with derived values
|
||||
let title = $state(initialTask.title);
|
||||
let description = $state(initialTask.description || '');
|
||||
let dueDate = $state(initialTask.dueDate ? formatDateForInput(initialTask.dueDate) : '');
|
||||
let dueTime = $state(initialTask.dueTime || '');
|
||||
let priority = $state<TaskPriority>(initialTask.priority);
|
||||
|
||||
// Sync form state when task changes
|
||||
$effect(() => {
|
||||
title = task.title;
|
||||
description = task.description || '';
|
||||
dueDate = task.dueDate ? formatDateForInput(task.dueDate) : '';
|
||||
dueTime = task.dueTime || '';
|
||||
priority = task.priority;
|
||||
});
|
||||
|
||||
function formatDateForInput(date: string | Date | null | undefined): string {
|
||||
if (!date) return '';
|
||||
|
|
@ -132,8 +141,8 @@
|
|||
|
||||
<svelte:window onkeydown={handleKeydown} />
|
||||
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions -->
|
||||
<div class="modal-backdrop" onclick={handleBackdropClick}>
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions a11y_no_noninteractive_element_to_interactive_role -->
|
||||
<div class="modal-backdrop" onclick={handleBackdropClick} role="button" tabindex="-1">
|
||||
<div class="modal" role="dialog" aria-labelledby="modal-title" aria-modal="true">
|
||||
<!-- Header -->
|
||||
<div class="modal-header">
|
||||
|
|
@ -168,14 +177,7 @@
|
|||
>
|
||||
<div class="form-group">
|
||||
<label for="title">Titel</label>
|
||||
<input
|
||||
id="title"
|
||||
type="text"
|
||||
bind:value={title}
|
||||
placeholder="Aufgabentitel"
|
||||
required
|
||||
autofocus
|
||||
/>
|
||||
<input id="title" type="text" bind:value={title} placeholder="Aufgabentitel" required />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -201,7 +203,7 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Priorität</label>
|
||||
<span class="label-text">Priorität</span>
|
||||
<div class="priority-options">
|
||||
{#each Object.entries(PRIORITY_LABELS) as [key, label]}
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<div
|
||||
class="todo-item"
|
||||
class:completed={task.isCompleted}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
import { NetworkGraph, NetworkControls } from '@manacore/shared-ui';
|
||||
import '$lib/i18n';
|
||||
|
||||
let graphComponent: NetworkGraph;
|
||||
let graphComponent = $state<NetworkGraph | null>(null);
|
||||
let controlsComponent: NetworkControls;
|
||||
let graphContainer: HTMLDivElement;
|
||||
|
||||
|
|
@ -172,7 +172,11 @@
|
|||
<div class="info-panel">
|
||||
<div class="info-header">
|
||||
<h3>{networkStore.selectedNode.name}</h3>
|
||||
<button class="close-btn" onclick={() => networkStore.selectNode(null)}>
|
||||
<button
|
||||
class="close-btn"
|
||||
onclick={() => networkStore.selectNode(null)}
|
||||
aria-label="Schließen"
|
||||
>
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
|
|
|
|||
|
|
@ -516,105 +516,6 @@
|
|||
color: hsl(var(--color-muted-foreground));
|
||||
}
|
||||
|
||||
/* Language options */
|
||||
.locale-options {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.locale-option {
|
||||
padding: 0.5rem 1rem;
|
||||
border: 2px solid hsl(var(--color-border));
|
||||
border-radius: var(--radius-md);
|
||||
background: transparent;
|
||||
color: hsl(var(--color-foreground));
|
||||
font-size: 0.875rem;
|
||||
cursor: pointer;
|
||||
transition: all 150ms ease;
|
||||
}
|
||||
|
||||
.locale-option:hover {
|
||||
border-color: hsl(var(--color-primary) / 0.5);
|
||||
}
|
||||
|
||||
.locale-option.active {
|
||||
border-color: hsl(var(--color-primary));
|
||||
background: hsl(var(--color-primary) / 0.1);
|
||||
}
|
||||
|
||||
/* Theme options */
|
||||
.theme-options {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.theme-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 1rem;
|
||||
border: 2px solid hsl(var(--color-border));
|
||||
border-radius: var(--radius-md);
|
||||
background: transparent;
|
||||
color: hsl(var(--color-foreground));
|
||||
font-size: 0.875rem;
|
||||
cursor: pointer;
|
||||
transition: all 150ms ease;
|
||||
}
|
||||
|
||||
.theme-option:hover {
|
||||
border-color: hsl(var(--color-primary) / 0.5);
|
||||
}
|
||||
|
||||
.theme-option.active {
|
||||
border-color: hsl(var(--color-primary));
|
||||
background: hsl(var(--color-primary) / 0.1);
|
||||
}
|
||||
|
||||
.theme-option .icon {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
}
|
||||
|
||||
/* Variant grid */
|
||||
.variant-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.variant-option {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
padding: 0.75rem;
|
||||
border: 2px solid hsl(var(--color-border));
|
||||
border-radius: var(--radius-md);
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
transition: all 150ms ease;
|
||||
}
|
||||
|
||||
.variant-option:hover {
|
||||
border-color: hsl(var(--color-primary) / 0.5);
|
||||
}
|
||||
|
||||
.variant-option.active {
|
||||
border-color: hsl(var(--color-primary));
|
||||
background: hsl(var(--color-primary) / 0.1);
|
||||
}
|
||||
|
||||
.variant-icon {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.variant-label {
|
||||
font-size: 0.75rem;
|
||||
color: hsl(var(--color-muted-foreground));
|
||||
}
|
||||
|
||||
/* Select input */
|
||||
.select-input {
|
||||
width: 100%;
|
||||
|
|
|
|||
|
|
@ -439,12 +439,16 @@ export class TaskService {
|
|||
const endDate = new Date(today);
|
||||
endDate.setDate(endDate.getDate() + days);
|
||||
|
||||
// Use SQL date strings for more reliable comparison
|
||||
const todayStr = today.toISOString();
|
||||
const endDateStr = endDate.toISOString();
|
||||
|
||||
const result = await this.db.query.tasks.findMany({
|
||||
where: and(
|
||||
eq(tasks.userId, userId),
|
||||
eq(tasks.isCompleted, false),
|
||||
gte(tasks.dueDate, today),
|
||||
lte(tasks.dueDate, endDate)
|
||||
gte(tasks.dueDate, todayStr),
|
||||
lte(tasks.dueDate, endDateStr)
|
||||
),
|
||||
orderBy: [asc(tasks.dueDate), asc(tasks.order)],
|
||||
});
|
||||
|
|
@ -526,9 +530,16 @@ export class TaskService {
|
|||
const taskIds = taskList.map((t) => t.id);
|
||||
|
||||
// Single query to get all task-label relationships
|
||||
const allTaskLabels = await this.db.query.taskLabels.findMany({
|
||||
where: or(...taskIds.map((id) => eq(taskLabels.taskId, id))),
|
||||
});
|
||||
// Use inArray for better performance with multiple IDs
|
||||
const allTaskLabels = await this.db
|
||||
.select()
|
||||
.from(taskLabels)
|
||||
.where(
|
||||
sql`${taskLabels.taskId} IN (${sql.join(
|
||||
taskIds.map((id) => sql`${id}`),
|
||||
sql`, `
|
||||
)})`
|
||||
);
|
||||
|
||||
if (allTaskLabels.length === 0) {
|
||||
// No labels for any task - return tasks with empty labels array
|
||||
|
|
@ -538,10 +549,16 @@ export class TaskService {
|
|||
// Get unique label IDs
|
||||
const uniqueLabelIds = [...new Set(allTaskLabels.map((tl) => tl.labelId))];
|
||||
|
||||
// Single query to get all labels
|
||||
const allLabels = await this.db.query.labels.findMany({
|
||||
where: or(...uniqueLabelIds.map((id) => eq(labels.id, id))),
|
||||
});
|
||||
// Single query to get all labels using IN clause
|
||||
const allLabels = await this.db
|
||||
.select()
|
||||
.from(labels)
|
||||
.where(
|
||||
sql`${labels.id} IN (${sql.join(
|
||||
uniqueLabelIds.map((id) => sql`${id}`),
|
||||
sql`, `
|
||||
)})`
|
||||
);
|
||||
|
||||
// Create a map of labelId -> label for fast lookup
|
||||
const labelMap = new Map(allLabels.map((l) => [l.id, l]));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue