CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 53s
CI & Build / integration (push) Successful in 1m9s
CI & Build / Python tests (push) Successful in 1m55s
CI & Build / Build & push image (push) Successful in 34s
The acceptance greps found what the per-area passes missed: - src/scribe: "Phase 7/8" removal notes in projects, settings and user_profile; a paragraph promising an auto-summary side effect that no longer exists; user_profile's claim that "upcoming MCP profile tools" read the profile, which nothing does; an instance count and instance rule titles in plugin_context; "MILESTONE 323 DECIDED" in rulebooks. - scripts/: check_plugin's header and inline comments were a history of the incidents behind each guard, with issue numbers in two failure messages; check_dangling_styles named this app's classes as its examples; check_design_tokens, measure_duplication and mint_plugin_version cited issues and checklists. - frontend/src: forty-odd comments with four-digit issue numbers that the earlier frontend scan filtered out as hex colours, plus "used to" and "Phase N" notes. Kept: illustrative ids (`#4181` as a bare-id example, `PR #198`), migration Create Date headers and one migration's dated data floor, and the plugin skills' worked examples of how to cite a record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
93 lines
2.9 KiB
Vue
93 lines
2.9 KiB
Vue
<script setup lang="ts">
|
|
/**
|
|
* "What was learned from this record" — the reverse of a lesson's
|
|
* `learned_from`.
|
|
*
|
|
* THE DIRECTION THAT GETS FORGOTTEN, and arguably the more useful one. The
|
|
* forward link is easy to remember because the lesson's author types it; this
|
|
* one has no author and so tends never to get built. A reader opening an old
|
|
* issue wants to know what came out of it, and without this the relation is
|
|
* navigable only from the lesson's side.
|
|
*
|
|
* A COMPONENT rather than markup inside the task editor, because the same
|
|
* question is worth answering on any record a lesson can cite — an issue, a
|
|
* spike, a dev-log. One panel, mounted wherever that is true, instead of the
|
|
* shape being written a second time the first time someone wants it on notes.
|
|
*
|
|
* SILENT WHEN EMPTY. Most records taught no lesson, and a panel that renders
|
|
* "None yet" on every page is a panel people learn to skip — which costs the
|
|
* pages where it does have something to say.
|
|
*/
|
|
import { onMounted, ref, watch } from "vue";
|
|
|
|
import { lessonsTaughtBy, type Lesson } from "@/api/lessons";
|
|
|
|
const props = defineProps<{ recordId: number }>();
|
|
|
|
const lessons = ref<Lesson[]>([]);
|
|
// No error surface on purpose: this is a secondary panel beside the record the
|
|
// reader actually came for, and a red box about a failed side-query would be
|
|
// louder than the thing it failed to fetch. It stays silent and stays absent.
|
|
const loaded = ref(false);
|
|
|
|
async function load() {
|
|
loaded.value = false;
|
|
lessons.value = [];
|
|
if (!props.recordId) return;
|
|
try {
|
|
const res = await lessonsTaughtBy(props.recordId);
|
|
lessons.value = res.lessons;
|
|
} catch {
|
|
lessons.value = [];
|
|
} finally {
|
|
loaded.value = true;
|
|
}
|
|
}
|
|
|
|
watch(() => props.recordId, load);
|
|
onMounted(load);
|
|
</script>
|
|
|
|
<template>
|
|
<section v-if="loaded && lessons.length" class="ltp">
|
|
<h3 class="ltp-label">What was learned from this</h3>
|
|
<ul class="ltp-list">
|
|
<li v-for="l in lessons" :key="l.id" class="ltp-item">
|
|
<router-link :to="`/lessons/${l.id}`" class="ltp-link">
|
|
{{ l.what || l.title }}
|
|
</router-link>
|
|
<!-- The trigger travels with the row. A lesson listed without it is a
|
|
claim with the half that says when it matters left off. -->
|
|
<p v-if="l.when_to_apply" class="ltp-trigger">
|
|
{{ l.when_to_apply }}
|
|
</p>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.ltp {
|
|
margin-top: 1.5rem;
|
|
padding-top: 1rem;
|
|
border-top: 1px solid var(--fs-border-color);
|
|
}
|
|
.ltp-label {
|
|
margin: 0 0 0.6rem;
|
|
font-size: 0.72rem;
|
|
font-weight: 500;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.04em;
|
|
color: var(--fs-text-tertiary);
|
|
}
|
|
.ltp-list { list-style: none; margin: 0; padding: 0; }
|
|
.ltp-item { margin-bottom: 0.7rem; }
|
|
.ltp-link { color: var(--fs-accent); font-size: 0.9rem; }
|
|
.ltp-trigger {
|
|
margin: 0.15rem 0 0;
|
|
color: var(--fs-text-secondary);
|
|
font-size: 0.82rem;
|
|
line-height: 1.45;
|
|
}
|
|
</style>
|