Einheitliche Listen (0.61.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 9m26s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 9m11s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 9m4s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 9m31s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 13m3s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 13m1s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m30s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 46s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m10s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 11m28s

Gemeinsame Werkzeugleiste ListToolbar (Filter-Chips, Suche, Sortierung,
Kacheln/Liste) für Neuigkeiten, Stellen, Ideen und Personen; im SDK für Plugins.
Neuigkeiten durchsuchbar.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-10-06 20:12:57 +00:00
parent 8fbe32ed5c
commit 9cb34635bc
167 changed files with 644 additions and 482 deletions

View file

@ -1,10 +1,10 @@
<script setup>
import { ref, watch } from 'vue';
import { Link, router, usePage } from '@inertiajs/vue3';
import { Lightbulb, MessageCircle, Plus, Search } from '@lucide/vue';
import { Lightbulb, MessageCircle, Plus } from '@lucide/vue';
import { toast } from 'vue-sonner';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import ListToolbar from '@/components/ListToolbar.vue';
import EmptyState from '@/components/EmptyState.vue';
import PageHeader from '@/components/PageHeader.vue';
import AppLayout from '@/layouts/AppLayout.vue';
@ -25,18 +25,12 @@ const page = usePage();
watch(() => page.props.flash.status, (status) => status && toast.success(status), { immediate: true });
const creating = ref(false);
const query = ref(props.filters.q);
function apply(changes) {
const params = { ...props.filters, ...changes };
router.get('/ideen', Object.fromEntries(Object.entries(params).filter(([key, value]) => value && !(key === 'sortierung' && value === 'neu'))), { preserveState: true, preserveScroll: true });
}
let timer;
watch(query, (value) => {
clearTimeout(timer);
timer = setTimeout(() => apply({ q: value }), 300);
});
const total = () => Object.values(props.counts).reduce((sum, n) => sum + n, 0);
const sorts = { neu: 'Neueste', beliebt: 'Meiste Unterstützung', diskutiert: 'Meiste Kommentare' };
@ -50,33 +44,18 @@ const sorts = { neu: 'Neueste', beliebt: 'Meiste Unterstützung', diskutiert: 'M
</template>
</PageHeader>
<div class="mb-4 flex flex-wrap items-center gap-2">
<div class="flex flex-wrap gap-1 rounded-md bg-muted p-1" role="tablist" aria-label="Status">
<button type="button" role="tab" :aria-selected="!filters.status" class="rounded px-3 py-1 text-sm font-medium" :class="!filters.status ? 'bg-card shadow-xs' : 'text-muted-foreground hover:text-foreground'" @click="apply({ status: null })">
Alle <span class="text-xs text-muted-foreground tabular-nums">{{ total() }}</span>
</button>
<button
v-for="(label, key) in statuses"
:key="key"
type="button"
role="tab"
:aria-selected="filters.status === key"
class="rounded px-3 py-1 text-sm font-medium"
:class="filters.status === key ? 'bg-card shadow-xs' : 'text-muted-foreground hover:text-foreground'"
@click="apply({ status: key })"
>
{{ label }} <span class="text-xs text-muted-foreground tabular-nums">{{ counts[key] ?? 0 }}</span>
</button>
</div>
<span class="flex-1" />
<select :value="filters.sortierung" class="h-9 rounded-md border bg-card px-2 text-sm" aria-label="Sortierung" @change="apply({ sortierung: $event.target.value })">
<option v-for="(label, key) in sorts" :key="key" :value="key">{{ label }}</option>
</select>
<div class="relative w-full sm:w-56">
<Search class="pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground" />
<Input v-model="query" type="search" placeholder="Ideen durchsuchen" class="h-9 bg-card pl-8" aria-label="Ideen durchsuchen" />
</div>
</div>
<ListToolbar
:filters="[{ value: null, label: 'Alle', count: total() }, ...Object.entries(statuses).map(([key, label]) => ({ value: key, label, count: counts[key] ?? 0 }))]"
:filter="filters.status || null"
filter-label="Status"
:search="filters.q ?? ''"
search-placeholder="Ideen durchsuchen"
:sorts="Object.entries(sorts).map(([value, label]) => ({ value, label }))"
:sort="filters.sortierung || 'neu'"
@update:filter="(value) => apply({ status: value })"
@update:search="(value) => apply({ q: value })"
@update:sort="(value) => apply({ sortierung: value })"
/>
<ul v-if="ideas.length" class="grid gap-3">
<li v-for="idea in ideas" :key="idea.id" class="flex gap-4 rounded-lg border bg-card p-4 shadow-xs">