Files
FabledGrimoire/frontend/src/components/RecordKinds.vue
T
bvandeusenandClaude Opus 5.5 b68aefc109
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 35s
CI & Build / Python tests (push) Failing after 2m1s
CI & Build / integration (push) Successful in 2m20s
CI & Build / Build & push image (push) Skipped
feat(7835): what resembles the work but is not shown is named by id in one pointer line
A pointer before a payload:
- the notes arms fetch a few results past the menu; those that cleared
  the floor but were held back by the gate, the band or the budget are
  named by id per kind, with the call that opens each kind, in one line
  ("Also resembling this, not shown: ...") at the message and the write
  path;
- they are recorded in the record ledger as `pointed`, so an open that
  follows is counted apart from pushed lines;
- setting a task in progress returns records_in_area: the notes and open
  issues tagged to the task's areas, by id (a work.start row in the
  kind x moment table says which kinds; it answers in a tool reply, so it
  is shown as unmeasured).

The static context says what a pointer line means. Plugin version minted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:16:01 -05:00

134 lines
5.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { apiErrorMessage } from "@/api/client";
import { getRecordKinds, setRecordKinds } from "@/api/moments";
import type { RecordKindsDoor, RecordKindsTable } from "@/api/moments";
/**
* The kind×moment table: for each point where a record search fires, which
* kinds of record it may consider. A kind left unticked is never pushed
* there; a session can still search for it. Each box shows the lines that
* door pushed of that kind and how many were opened, so a change is made
* against its own evidence. A change saves as soon as it is made.
*/
const props = defineProps<{ days: number }>();
const table = ref<RecordKindsTable | null>(null);
const failed = ref(false);
const saving = ref<string | null>(null);
const saveError = ref("");
async function load() {
try {
table.value = await getRecordKinds(props.days);
failed.value = false;
} catch {
failed.value = true;
}
}
async function save(door: string, kinds: string[] | null) {
saving.value = door;
saveError.value = "";
try {
table.value = await setRecordKinds(door, kinds);
} catch (e) {
saveError.value = apiErrorMessage(e, "The change could not be saved.");
} finally {
saving.value = null;
}
}
function toggle(row: RecordKindsDoor, kind: string, on: boolean) {
const next = on ? [...row.kinds, kind] : row.kinds.filter((k) => k !== kind);
void save(row.door, next);
}
function evidenceText(row: RecordKindsDoor, kind: string): string {
const c = row.evidence[kind];
return c ? `${c.opened} of ${c.delivered} opened` : "none shown";
}
onMounted(load);
</script>
<template>
<section class="kinds" aria-labelledby="kinds-title">
<h3 id="kinds-title" class="sub-title">Which records each moment considers</h3>
<p v-if="failed" class="error-msg">
The table could not be loaded.
<button type="button" class="btn-text" @click="load">Try again</button>
</p>
<p v-else-if="!table" class="empty-msg">Loading the table…</p>
<template v-else>
<p class="field-hint">
A search for records runs at each point below. An unticked kind is never shown there;
a session can still search for it. Beside each kind: lines shown there over the last
{{ table.days }} days, and how many were opened.
</p>
<p v-if="table.evidence_failed" class="error-msg">
The counts could not be read, so they are missing below, not zero.
</p>
<p v-if="saveError" class="error-msg" role="alert">{{ saveError }}</p>
<fieldset
v-for="row in table.doors" :key="row.door" class="door"
:disabled="saving === row.door"
>
<legend class="door-head">
<span class="door-label">{{ row.label }}</span>
<code class="moment-name">{{ row.door }}</code>
<span class="door-fires">{{ row.fires }}</span>
<span v-if="!row.changed" class="door-default">shipped default</span>
</legend>
<p v-if="!row.measured" class="door-default">
Named by id in the reply that sets a task in progress, so there are no counts for it.
</p>
<ul class="kind-list">
<li v-for="k in table.kinds" :key="k.kind" class="kind-cell">
<label class="kind-label">
<input
type="checkbox" :checked="row.kinds.includes(k.kind)"
@change="toggle(row, k.kind, ($event.target as HTMLInputElement).checked)"
/>
{{ k.label }}
</label>
<span v-if="!table.evidence_failed && row.measured" class="kind-evidence">{{ evidenceText(row, k.kind) }}</span>
</li>
</ul>
<button v-if="row.changed" type="button" class="btn-text door-reset" @click="save(row.door, null)">
Back to the shipped default
</button>
</fieldset>
</template>
</section>
</template>
<style scoped>
.kinds { display: flex; flex-direction: column; gap: var(--fs-space-2); }
.sub-title { margin: 0; font-size: 0.95rem; color: var(--fs-text-primary); }
.door {
border: 1px solid var(--fs-border-color);
border-radius: var(--fs-radius-md);
padding: var(--fs-space-2) var(--fs-space-3);
margin: 0;
display: flex; flex-direction: column; gap: var(--fs-space-2);
}
.door:disabled { opacity: var(--fs-disabled-opacity); }
.door-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--fs-space-2); padding: 0 var(--fs-space-1); }
.door-label { font-size: var(--fs-size-body-sm); color: var(--fs-text-primary); }
.door-fires,
.door-default,
.kind-evidence { font-size: var(--fs-size-tiny); color: var(--fs-text-secondary); font-variant-numeric: tabular-nums; }
.kind-list {
list-style: none; margin: 0; padding: 0;
display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
gap: var(--fs-space-1) var(--fs-space-3);
}
.kind-cell { display: flex; flex-direction: column; }
.kind-label { display: inline-flex; align-items: center; gap: var(--fs-space-1); font-size: var(--fs-size-body-sm); cursor: pointer; }
.kind-label input:focus-visible { outline: none; box-shadow: var(--fs-focus-ring); }
.door-reset { align-self: flex-start; }
</style>
<style src="@/assets/moments-shared.css" />