feat(ui): suggest input on Combobox replaces datalists, RadioGroup for task pickers

Also records the combobox and radio-group components added in 63476393.
This commit is contained in:
sam committed 2026-10-26 19:45:18 +11:00
1 parent 63476393d7
commit ca597c3678
16 files changed
+192 -165

No files matched your search

+16 -28
View File
@@ -1,11 +1,12 @@
<script setup lang="ts">
import { firstLine } from "./first-line";
import { computed, onMounted, ref, useId, watchEffect } from "vue";
import { RadioGroupItem, RadioGroupRoot } from "reka-ui";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Kbd } from "@/components/ui/kbd";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import { SuggestInput } from "@/components/ui/suggest-input";
import { Spinner } from "@/components/ui/spinner";
import { Textarea } from "@/components/ui/textarea";
import { api } from "@/lib/api";
@@ -103,41 +104,28 @@ async function submit() {
<div v-if="repoMode !== 'none'" class="grid gap-1.5">
<label :for="`${uid}-repo`" class="text-label font-medium">Repository<span v-if="!repoRequired" class="font-normal text-fg-subtle"> (optional)</span>
</label>
<Input :id="`${uid}-repo`" v-model="repository" class="font-mono" placeholder="owner/repository" :list="`${uid}-repos`" :required="repoRequired" />
<datalist :id="`${uid}-repos`">
<option v-for="r in recentRepos" :key="r" :value="r" />
</datalist>
<p v-if="recentRepos.length" class="text-xs text-fg-subtle">Configured:
<Button
v-for="r in recentRepos"
:key="r"
type="button"
variant="link"
size="xs"
class="h-auto px-1 font-mono text-fg-subtle"
@click="repository = r"
>{{ r }}</Button
>
</p>
<SuggestInput :id="`${uid}-repo`" v-model="repository" class="font-mono" placeholder="owner/repository" :options="recentRepos" :required="repoRequired" />
</div>
<div v-if="!props.workflow" class="grid gap-1.5">
<span :id="`${uid}-wf`" class="text-label font-medium">Workflow</span>
<RadioGroupRoot v-model="workflow" :aria-labelledby="`${uid}-wf`" class="grid grid-cols-1 gap-2 sm:grid-cols-3" loop>
<RadioGroupItem
<RadioGroup v-model="workflow" :aria-labelledby="`${uid}-wf`" class="grid grid-cols-1 gap-2 sm:grid-cols-3" loop>
<label
v-for="d in definitions"
:key="d.id"
:value="d.id"
class="rounded-md border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-secondary focus-visible:outline-2 focus-visible:outline-ring data-[state=checked]:border-primary data-[state=checked]:bg-secondary"
class="flex cursor-pointer items-start gap-3 rounded-md border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-secondary has-data-checked:border-primary has-data-checked:bg-secondary"
>
<span class="block truncate text-label font-medium">{{ d.name || d.id }}</span>
<span class="block text-xs text-fg-subtle">
{{ statFor(d.id)?.runs || 0 }} runs<template v-if="statFor(d.id)?.runs">
· {{ Math.round((delivered(statFor(d.id)) / (statFor(d.id)?.runs || 1)) * 100) }}% delivered</template
>
<RadioGroupItem :value="d.id" class="mt-0.5" />
<span class="min-w-0">
<span class="block truncate text-label font-medium">{{ d.name || d.id }}</span>
<span class="block text-xs text-fg-subtle">
{{ statFor(d.id)?.runs || 0 }} runs<template v-if="statFor(d.id)?.runs">
· {{ Math.round((delivered(statFor(d.id)) / (statFor(d.id)?.runs || 1)) * 100) }}% delivered</template
>
</span>
</span>
</RadioGroupItem>
</RadioGroupRoot>
</label>
</RadioGroup>
<p v-if="!definitions.length && !loadError" class="text-xs text-fg-subtle">No enabled workflows.</p>
</div>
+3 -3
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref } from "vue";
import { useRouter } from "vue-router";
import { RadioGroupItem, RadioGroupRoot } from "reka-ui";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import {
@@ -372,7 +372,7 @@ function onConfirmationOpen(open: boolean) {
<DialogTitle>Retry this task?</DialogTitle>
<DialogDescription>Retry from</DialogDescription>
</DialogHeader>
<RadioGroupRoot
<RadioGroup
v-model="retryMode"
class="grid grid-cols-1 gap-2"
aria-label="Retry worktree mode"
@@ -398,7 +398,7 @@ function onConfirmationOpen(open: boolean) {
<span class="text-xs text-fg-subtle">{{ option.description }}</span>
</span>
</label>
</RadioGroupRoot>
</RadioGroup>
<DialogFooter>
<Button variant="ghost" :disabled="inFlight" @click="onRetryOpen(false)">Keep it parked</Button>
<Button