Files
FabledScribe/frontend/src/components/ProjectSelector.vue
T
bvandeusen 4ba544e2af
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 7s
CI & Build / integration (push) Successful in 17s
CI & Build / TypeScript typecheck (push) Successful in 34s
CI & Build / Python tests (push) Successful in 48s
CI & Build / Build & push image (push) Successful in 37s
refactor(theme): retire the --color-* shim — the sweep it promised, run
#2533. theme.css claimed "removing this block is a rename sweep across the
components, tracked separately" — written in 67a529a, never filed, which made
the comment itself an instance of the survey's presence-without-reference
pattern. This is that sweep.

73 alias declarations deleted; 69 files rewritten; every --color-*-style name
now references its --fs-* token directly. Mechanical by construction: the map
IS the alias block, applied longest-name-first with a boundary guard so
--color-text never matched inside --color-text-muted. Zero survivors outside
theme.css, verified by grep rather than assumed.

One deliberate survivor: --color-shadow stays DECLARED, because it was never
an alias — it is a literal value the design system has no token for. Marked
in place as a recorded gap: promote it to an --fs-* token when a second app
needs it, don't copy the line.

Nothing is lost mode-wise: the aliases' resolve-at-use-time trick (which
absorbed 48 dark-mode overrides) lives one layer down in the --fs-* tokens'
own derivations, which is why the sweep is a pure rename. Both CSS checkers
green.

Why now rather than never: check_snippets_against_design_system reports every
--color-* reference as "unknown — renders as NOTHING", and nine recipe
snippets recorded from components.css carried the deprecated names, making
them prior art pointing the wrong way. With the sweep in, the checker's
report over re-recorded snippets should be EMPTY — the acceptance test that
proves the checker was right all along (#2517's correction).

Refs #2533
2026-08-08 22:42:37 -04:00

68 lines
1.6 KiB
Vue

<script setup lang="ts">
import { ref, onMounted } from "vue";
import { apiGet } from "@/api/client";
interface Project {
id: number;
title: string;
status: string;
}
defineProps<{
modelValue: number | null;
}>();
const emit = defineEmits<{
(e: "update:modelValue", value: number | null): void;
}>();
const projects = ref<Project[]>([]);
let cacheExpiry = 0;
async function loadProjects() {
const now = Date.now();
if (projects.value.length > 0 && now < cacheExpiry) return;
try {
const data = await apiGet<{ projects: Project[] }>("/api/projects?status=active");
projects.value = data.projects;
cacheExpiry = now + 60_000; // 60 second cache
} catch {
// Silently fail — selector will just be empty
}
}
onMounted(loadProjects);
function onChange(e: Event) {
const value = (e.target as HTMLSelectElement).value;
emit("update:modelValue", value ? Number(value) : null);
}
</script>
<template>
<select class="project-selector" :value="modelValue ?? ''" @change="onChange">
<option value="">No project</option>
<option v-for="project in projects" :key="project.id" :value="project.id">
{{ project.title }}
</option>
</select>
</template>
<style scoped>
.project-selector {
padding: 0.4rem 0.5rem;
border: 1px solid var(--fs-border-color);
border-radius: var(--fs-radius-sm);
background: var(--fs-surface-raised);
color: var(--fs-text-primary);
font-size: 0.9rem;
font-family: inherit;
width: 100%;
box-sizing: border-box;
}
.project-selector:focus {
outline: none;
border-color: var(--fs-accent);
}
</style>