feat(7836): a lesson arrives at the situation confirmed for it, once per session
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Failing after 1m41s
CI & Build / integration (push) Successful in 2m8s
CI & Build / Build & push image (push) Skipped
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Failing after 1m41s
CI & Build / integration (push) Successful in 2m8s
CI & Build / Build & push image (push) Skipped
Each lesson can carry its situation: a moment of work (work.deliver, work.finish, ...) or a typed trigger on the act (path, command, tool, keyword, matched as rule triggers are). A pass proposes, a person judges: - lesson_situations (migration 0137): one row per lesson, kind and value, suggested / confirmed / rejected; `none` records that no situation fits; - MCP: lessons_to_situate, propose_lesson_situations, lesson_situation_proposals, judge_lesson_situations; - Settings > Moments lists waiting proposals with Apply / Not this / Apply all; a lesson page lists its situations and lets a writer add one or take one off (kept as rejected, never proposed again). Delivery: the moment doors (the plugin catch-all hook and MCP replies) add the lessons whose confirmed moment the act reached or whose trigger it matches. The plugin door shows each once per session, using the record ledger, and records it as pushed (source lesson_situation); the tool filter now includes the tools a lesson trigger listens on. The edit door no longer finds lessons by meaning: lesson leaves the work.change default kinds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { RecordUsage } from "@/types/usage";
|
||||
|
||||
import { apiGet, apiPost, apiPut, apiPatch, apiDelete } from "@/api/client";
|
||||
import type { RuleKind } from "@/api/rulebooks";
|
||||
import type { RuleKind, RuleTrigger } from "@/api/rulebooks";
|
||||
|
||||
/** Where a lesson stands on "which rule is this an instance of?"
|
||||
* (`services/lesson_rules.py`: LINKED / NO_RULE / UNJUDGED). Three answers,
|
||||
@@ -229,3 +229,77 @@ export function lessonsTaughtBy(
|
||||
`/api/lessons/taught-by/${recordId}`,
|
||||
);
|
||||
}
|
||||
|
||||
// ── when a lesson applies (services/lesson_situations.py) ────────────────
|
||||
|
||||
/** `moment` — a catalog moment; `trigger` — a typed predicate on the act. */
|
||||
export type SituationKind = "moment" | "trigger";
|
||||
|
||||
/** One situation of a lesson: live (`confirmed`) or waiting on a person
|
||||
* (`suggested`). `describes` is how it reads in the line a session sees. */
|
||||
export interface LessonSituation {
|
||||
id: number;
|
||||
lesson_id: number;
|
||||
kind: SituationKind;
|
||||
value: string;
|
||||
state: "suggested" | "confirmed";
|
||||
source: "pass" | "edit";
|
||||
note: string;
|
||||
describes: string;
|
||||
trigger?: RuleTrigger;
|
||||
}
|
||||
|
||||
export interface LessonSituationProposals {
|
||||
lessons: {
|
||||
lesson_id: number;
|
||||
title: string;
|
||||
when_to_apply: string;
|
||||
proposals: LessonSituation[];
|
||||
}[];
|
||||
total: number;
|
||||
/** Readable lessons by where they stand: arriving at a situation, read
|
||||
* and found to have none, waiting on a judgment, or not yet read. */
|
||||
counts: { situated: number; none_fits: number; waiting: number; unsituated: number };
|
||||
}
|
||||
|
||||
export interface LessonSituationsPayload {
|
||||
situations: LessonSituation[];
|
||||
catalog: { name: string; means: string }[];
|
||||
trigger_kinds: RuleTrigger["kind"][];
|
||||
}
|
||||
|
||||
export interface SituationJudgment {
|
||||
id: number;
|
||||
verdict: "confirm" | "reject";
|
||||
note?: string;
|
||||
}
|
||||
|
||||
export function getLessonSituationProposals(): Promise<LessonSituationProposals> {
|
||||
return apiGet("/api/lessons/situations/proposals");
|
||||
}
|
||||
|
||||
/** A confirm makes the lesson arrive at that situation, once per session; a
|
||||
* reject stops the value being proposed again. */
|
||||
export function judgeLessonSituations(
|
||||
judgments: SituationJudgment[],
|
||||
): Promise<{ judged: LessonSituation[] }> {
|
||||
return apiPost("/api/lessons/situations/judge", { judgments });
|
||||
}
|
||||
|
||||
export function getLessonSituations(lessonId: number): Promise<LessonSituationsPayload> {
|
||||
return apiGet(`/api/lessons/${lessonId}/situations`);
|
||||
}
|
||||
|
||||
/** Make one situation live: a moment, or a trigger. */
|
||||
export function addLessonSituation(
|
||||
lessonId: number,
|
||||
body: { moment: string } | { trigger: RuleTrigger },
|
||||
): Promise<LessonSituation> {
|
||||
return apiPost(`/api/lessons/${lessonId}/situations`, body);
|
||||
}
|
||||
|
||||
/** Take a situation off its lesson; kept as rejected so it is not proposed
|
||||
* again. `apiDelete` discards the body. */
|
||||
export function removeLessonSituation(situationId: number): Promise<void> {
|
||||
return apiDelete(`/api/lessons/situations/${situationId}`);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import {
|
||||
getLessonSituationProposals, judgeLessonSituations,
|
||||
type LessonSituation, type LessonSituationProposals,
|
||||
} from "@/api/lessons";
|
||||
import { apiErrorMessage } from "@/api/client";
|
||||
import { useToastStore } from "@/stores/toast";
|
||||
import ConfirmDialog from "@/components/ConfirmDialog.vue";
|
||||
|
||||
/**
|
||||
* When each lesson applies, waiting on a person. A pass read each lesson
|
||||
* beside the rules it is an instance of and proposed the moments of work, or
|
||||
* the triggers on an act (a path, a command, a tool, a word), at which it
|
||||
* should arrive. A lesson with a confirmed situation arrives there, once per
|
||||
* session, instead of whenever an edit's words resemble it. Nothing changes
|
||||
* until "Apply" is pressed; "Not this" keeps the value from being proposed
|
||||
* again. The same judgment `judge_lesson_situations` makes in a session.
|
||||
*/
|
||||
const toast = useToastStore();
|
||||
|
||||
const data = ref<LessonSituationProposals | null>(null);
|
||||
const failed = ref(false);
|
||||
const busy = ref<number | "all" | null>(null);
|
||||
const confirmingAll = ref(false);
|
||||
|
||||
const lessons = computed(() => data.value?.lessons ?? []);
|
||||
const counts = computed(() => data.value?.counts);
|
||||
const allIds = computed(() => lessons.value.flatMap((l) => l.proposals.map((p) => p.id)));
|
||||
|
||||
const allSummary = computed(() => {
|
||||
const n = allIds.value.length;
|
||||
const across = `${lessons.value.length} lesson${lessons.value.length === 1 ? "" : "s"}`;
|
||||
return `${n} situation${n === 1 ? "" : "s"} across ${across} take effect at once: each lesson `
|
||||
+ "will arrive when its situation is reached, once per session.";
|
||||
});
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
data.value = await getLessonSituationProposals();
|
||||
failed.value = false;
|
||||
} catch {
|
||||
failed.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
async function decide(p: LessonSituation, verdict: "confirm" | "reject") {
|
||||
busy.value = p.id;
|
||||
try {
|
||||
await judgeLessonSituations([{
|
||||
id: p.id, verdict,
|
||||
note: verdict === "confirm" ? "Applied in Settings." : "Declined in Settings.",
|
||||
}]);
|
||||
await load();
|
||||
} catch (e) {
|
||||
toast.show(apiErrorMessage(e, "Could not record that"), "error");
|
||||
} finally {
|
||||
busy.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function applyAll() {
|
||||
confirmingAll.value = false;
|
||||
busy.value = "all";
|
||||
try {
|
||||
const out = await judgeLessonSituations(allIds.value.map((id) => ({
|
||||
id, verdict: "confirm" as const, note: "Applied with Apply all in Settings.",
|
||||
})));
|
||||
toast.show(`${out.judged.length} applied.`, "success");
|
||||
await load();
|
||||
} catch (e) {
|
||||
toast.show(apiErrorMessage(e, "Could not apply the suggestions"), "error");
|
||||
} finally {
|
||||
busy.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="proposals" aria-labelledby="lesson-situations-title">
|
||||
<h3 id="lesson-situations-title" class="sub-title">When lessons arrive</h3>
|
||||
<p v-if="failed" class="error-msg">
|
||||
The lesson situations could not be loaded.
|
||||
<button type="button" class="btn-text" @click="load">Try again</button>
|
||||
</p>
|
||||
<template v-else-if="data">
|
||||
<p class="field-hint">
|
||||
A lesson with a situation arrives when the work reaches it — a moment like delivering or
|
||||
finishing, or an act on a path, command or tool — once per session. A lesson without one
|
||||
is found only when a message resembles it.
|
||||
<template v-if="counts">
|
||||
{{ counts.situated }} arrive by situation, {{ counts.none_fits }} were read and fit none,
|
||||
{{ counts.waiting }} wait on you, and {{ counts.unsituated }} have not been read.
|
||||
</template>
|
||||
</p>
|
||||
<p v-if="!lessons.length" class="field-hint empty-note">
|
||||
Nothing is waiting. A session proposes situations with <code>lessons_to_situate</code> and
|
||||
<code>propose_lesson_situations</code>; they appear here to apply or decline.
|
||||
</p>
|
||||
<template v-else>
|
||||
<div class="proposals-bar">
|
||||
<button
|
||||
type="button" class="btn-primary btn-sm"
|
||||
:disabled="busy !== null"
|
||||
@click="confirmingAll = true"
|
||||
>Apply all {{ allIds.length }}</button>
|
||||
</div>
|
||||
<ul class="proposal-list">
|
||||
<li v-for="lesson in lessons" :key="lesson.lesson_id" class="proposal-rule">
|
||||
<div class="rule-head">
|
||||
<router-link :to="`/lessons/${lesson.lesson_id}`" class="rule-title">
|
||||
#{{ lesson.lesson_id }} {{ lesson.title }}
|
||||
</router-link>
|
||||
</div>
|
||||
<p v-if="lesson.when_to_apply" class="rule-statement">
|
||||
When to apply: {{ lesson.when_to_apply }}
|
||||
</p>
|
||||
<ul class="proposal-items">
|
||||
<li v-for="p in lesson.proposals" :key="p.id" class="proposal-item">
|
||||
<code class="moment-name">{{ p.describes }}</code>
|
||||
<span class="proposal-why">{{ p.note }}</span>
|
||||
<span class="proposal-actions">
|
||||
<button
|
||||
type="button" class="btn-primary btn-sm"
|
||||
:disabled="busy !== null"
|
||||
@click="decide(p, 'confirm')"
|
||||
>Apply</button>
|
||||
<button
|
||||
type="button" class="btn-text"
|
||||
:disabled="busy !== null"
|
||||
@click="decide(p, 'reject')"
|
||||
>Not this</button>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</template>
|
||||
<ConfirmDialog
|
||||
v-if="confirmingAll"
|
||||
title="Apply every situation?"
|
||||
:message="allSummary"
|
||||
confirm-label="Apply all"
|
||||
:danger="false"
|
||||
@confirm="applyAll"
|
||||
@cancel="confirmingAll = false"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped src="@/assets/rule-proposals.css" />
|
||||
|
||||
<style src="@/assets/moments-shared.css" />
|
||||
|
||||
<style scoped>
|
||||
.empty-note { margin: 0; }
|
||||
</style>
|
||||
@@ -0,0 +1,230 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import {
|
||||
addLessonSituation, getLessonSituations, judgeLessonSituations, removeLessonSituation,
|
||||
type LessonSituation, type LessonSituationsPayload,
|
||||
} from "@/api/lessons";
|
||||
import type { RuleTrigger } from "@/api/rulebooks";
|
||||
import { apiErrorMessage } from "@/api/client";
|
||||
import { useToastStore } from "@/stores/toast";
|
||||
|
||||
/**
|
||||
* When a lesson arrives. A situation is a moment of work (delivering,
|
||||
* finishing, …) or a trigger on an act (a path, a command, a tool, a word);
|
||||
* the lesson is shown to a session when its work reaches one, once per
|
||||
* session. Proposals from a pass wait here and in Settings › Moments until
|
||||
* applied or declined. A writer can add a situation directly or take one off;
|
||||
* one taken off is not proposed again.
|
||||
*/
|
||||
const props = defineProps<{ lessonId: number; canWrite: boolean }>();
|
||||
const toast = useToastStore();
|
||||
|
||||
const data = ref<LessonSituationsPayload | null>(null);
|
||||
const failed = ref(false);
|
||||
const busy = ref(false);
|
||||
|
||||
// The add form: what kind of situation, then a moment or a pattern.
|
||||
const what = ref<"moment" | RuleTrigger["kind"]>("moment");
|
||||
const moment = ref("");
|
||||
const pattern = ref("");
|
||||
|
||||
// Placeholders are generic shapes, never anyone's own paths or commands.
|
||||
const PLACEHOLDER: Record<string, string> = {
|
||||
path: "e.g. migrations/**/*.py",
|
||||
command: "e.g. git push",
|
||||
tool: "e.g. edit",
|
||||
keyword: "e.g. release",
|
||||
};
|
||||
|
||||
const live = computed(() => (data.value?.situations ?? []).filter((s) => s.state === "confirmed"));
|
||||
const waiting = computed(() => (data.value?.situations ?? []).filter((s) => s.state === "suggested"));
|
||||
const canAdd = computed(() =>
|
||||
what.value === "moment" ? !!moment.value : pattern.value.trim().length > 0,
|
||||
);
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
data.value = await getLessonSituations(props.lessonId);
|
||||
failed.value = false;
|
||||
} catch {
|
||||
failed.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
async function run(action: () => Promise<unknown>, done: string, failure: string) {
|
||||
busy.value = true;
|
||||
try {
|
||||
await action();
|
||||
toast.show(done, "success");
|
||||
await load();
|
||||
} catch (e) {
|
||||
toast.show(apiErrorMessage(e, failure), "error");
|
||||
} finally {
|
||||
busy.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function add() {
|
||||
const body = what.value === "moment"
|
||||
? { moment: moment.value }
|
||||
: { trigger: { kind: what.value, pattern: pattern.value.trim() } };
|
||||
return run(async () => {
|
||||
await addLessonSituation(props.lessonId, body);
|
||||
moment.value = "";
|
||||
pattern.value = "";
|
||||
}, "The lesson now arrives there", "Could not add that situation");
|
||||
}
|
||||
|
||||
function remove(s: LessonSituation) {
|
||||
return run(() => removeLessonSituation(s.id), "Taken off", "Could not take that off");
|
||||
}
|
||||
|
||||
function judge(s: LessonSituation, verdict: "confirm" | "reject") {
|
||||
return run(
|
||||
() => judgeLessonSituations([{
|
||||
id: s.id, verdict, note: verdict === "confirm" ? "Applied on the lesson." : "Declined on the lesson.",
|
||||
}]),
|
||||
verdict === "confirm" ? "Applied" : "Declined",
|
||||
"Could not record that",
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(load);
|
||||
watch(() => props.lessonId, load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="ls-panel" aria-labelledby="ls-title">
|
||||
<h2 id="ls-title" class="ls-label">When it arrives</h2>
|
||||
<p v-if="failed" class="ls-muted">
|
||||
The situations could not be loaded.
|
||||
<button type="button" class="ls-text-btn" @click="load">Try again</button>
|
||||
</p>
|
||||
<template v-else-if="data">
|
||||
<ul v-if="live.length" class="ls-list">
|
||||
<li v-for="s in live" :key="s.id" class="ls-item">
|
||||
<code class="ls-value">{{ s.describes }}</code>
|
||||
<button
|
||||
v-if="canWrite" type="button" class="ls-text-btn"
|
||||
:disabled="busy" :aria-label="`Take off ${s.describes}`"
|
||||
@click="remove(s)"
|
||||
>Take off</button>
|
||||
</li>
|
||||
</ul>
|
||||
<p v-else class="ls-muted">
|
||||
No situation yet — the lesson is found only when a message resembles it.
|
||||
</p>
|
||||
|
||||
<template v-if="waiting.length">
|
||||
<h3 class="ls-sub">Proposed</h3>
|
||||
<ul class="ls-list">
|
||||
<li v-for="s in waiting" :key="s.id" class="ls-item">
|
||||
<code class="ls-value">{{ s.describes }}</code>
|
||||
<span v-if="s.note" class="ls-note">{{ s.note }}</span>
|
||||
<span v-if="canWrite" class="ls-actions">
|
||||
<button type="button" class="ls-btn" :disabled="busy" @click="judge(s, 'confirm')">Apply</button>
|
||||
<button type="button" class="ls-text-btn" :disabled="busy" @click="judge(s, 'reject')">Not this</button>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<form v-if="canWrite" class="ls-add" @submit.prevent="add">
|
||||
<label class="ls-field">
|
||||
<span class="ls-field-label">Arrive at</span>
|
||||
<select v-model="what" class="ls-input" :disabled="busy">
|
||||
<option value="moment">a moment of work</option>
|
||||
<option v-for="k in data.trigger_kinds" :key="k" :value="k">a {{ k }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-if="what === 'moment'" class="ls-field ls-grow">
|
||||
<span class="ls-field-label">Moment</span>
|
||||
<select v-model="moment" class="ls-input" :disabled="busy">
|
||||
<option value="" disabled>Choose a moment</option>
|
||||
<option v-for="m in data.catalog" :key="m.name" :value="m.name">
|
||||
{{ m.name }} — {{ m.means }}
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-else class="ls-field ls-grow">
|
||||
<span class="ls-field-label">Pattern</span>
|
||||
<input
|
||||
v-model="pattern" class="ls-input" type="text" maxlength="200"
|
||||
:placeholder="PLACEHOLDER[what]" :disabled="busy"
|
||||
>
|
||||
</label>
|
||||
<button type="submit" class="ls-btn" :disabled="busy || !canAdd">Add</button>
|
||||
</form>
|
||||
</template>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.ls-panel {
|
||||
margin-top: 1.75rem;
|
||||
padding-top: 1rem;
|
||||
border-top: 1px solid var(--fs-border-color);
|
||||
}
|
||||
.ls-label {
|
||||
margin: 0 0 0.5rem;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 500;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--fs-text-tertiary);
|
||||
}
|
||||
.ls-sub {
|
||||
margin: var(--fs-space-3) 0 var(--fs-space-1);
|
||||
font-size: var(--fs-size-label);
|
||||
font-weight: var(--fs-weight-medium);
|
||||
color: var(--fs-text-tertiary);
|
||||
}
|
||||
.ls-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--fs-space-1); }
|
||||
.ls-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--fs-space-2); font-size: 0.9rem; }
|
||||
.ls-value { font-size: var(--fs-size-label); color: var(--fs-text-primary); }
|
||||
.ls-note { flex: 1 1 14rem; color: var(--fs-text-secondary); font-size: var(--fs-size-label); }
|
||||
.ls-actions { display: inline-flex; gap: var(--fs-space-2); margin-left: auto; }
|
||||
.ls-muted { margin: 0; color: var(--fs-text-secondary); font-size: 0.88rem; }
|
||||
.ls-add {
|
||||
display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--fs-space-2);
|
||||
margin-top: var(--fs-space-3);
|
||||
}
|
||||
.ls-field { display: flex; flex-direction: column; gap: var(--fs-space-1); }
|
||||
.ls-grow { flex: 1 1 14rem; }
|
||||
.ls-field-label { font-size: var(--fs-size-label); color: var(--fs-text-tertiary); }
|
||||
.ls-input {
|
||||
padding: 0.4rem 0.6rem;
|
||||
border: 1px solid var(--fs-border-color);
|
||||
border-radius: var(--fs-radius-sm);
|
||||
background: var(--fs-surface-raised);
|
||||
color: var(--fs-text-primary);
|
||||
font: inherit;
|
||||
font-size: 0.88rem;
|
||||
}
|
||||
.ls-btn {
|
||||
padding: 0.4rem 0.9rem;
|
||||
border: 1px solid var(--fs-border-color);
|
||||
border-radius: var(--fs-radius-sm);
|
||||
background: transparent;
|
||||
color: var(--fs-text-primary);
|
||||
font: inherit;
|
||||
font-size: 0.88rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ls-text-btn {
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--fs-text-secondary);
|
||||
font: inherit;
|
||||
font-size: var(--fs-size-label);
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ls-input:focus-visible,
|
||||
.ls-btn:focus-visible,
|
||||
.ls-text-btn:focus-visible { outline: none; box-shadow: var(--fs-focus-ring); }
|
||||
.ls-btn:disabled,
|
||||
.ls-text-btn:disabled,
|
||||
.ls-input:disabled { opacity: var(--fs-disabled-opacity); cursor: default; }
|
||||
</style>
|
||||
@@ -4,6 +4,7 @@ import { useMomentsStore } from "@/stores/moments";
|
||||
import MomentProposals from "@/components/MomentProposals.vue";
|
||||
import MomentRuleUsage from "@/components/MomentRuleUsage.vue";
|
||||
import WeightProposals from "@/components/WeightProposals.vue";
|
||||
import LessonSituationProposals from "@/components/LessonSituationProposals.vue";
|
||||
import RecordKinds from "@/components/RecordKinds.vue";
|
||||
import RecordReach from "@/components/RecordReach.vue";
|
||||
import RuleAdherence from "@/components/RuleAdherence.vue";
|
||||
@@ -171,6 +172,7 @@ onMounted(async () => {
|
||||
|
||||
<MomentProposals />
|
||||
<WeightProposals />
|
||||
<LessonSituationProposals />
|
||||
<RuleAdherence :data="adherence" :failed="adherenceFailed" @retry="loadAdherence" />
|
||||
<RecordReach :data="reach" :failed="reachFailed" @retry="loadReach" />
|
||||
<RecordKinds :days="days" />
|
||||
|
||||
@@ -41,6 +41,8 @@ import { useToastStore } from "@/stores/toast";
|
||||
import { renderMarkdown } from "@/utils/markdown";
|
||||
import { vRecordRefs } from "@/directives/recordRefs";
|
||||
import { recordHref } from "@/utils/recordHref";
|
||||
import { canWriteRecord } from "@/utils/permission";
|
||||
import LessonSituationsPanel from "@/components/LessonSituationsPanel.vue";
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@@ -60,6 +62,8 @@ const insightHtml = computed(() =>
|
||||
);
|
||||
|
||||
|
||||
const canWrite = computed(() => canWriteRecord(lesson.value?.permission));
|
||||
|
||||
/** The links by state — each state reads differently. Confirmed links are
|
||||
* the answer; rejected ones are kept so the reason stays readable. */
|
||||
const linksIn = (state: LessonRuleLink["state"]) =>
|
||||
@@ -199,6 +203,8 @@ onMounted(load);
|
||||
</template>
|
||||
</section>
|
||||
|
||||
<LessonSituationsPanel :lesson-id="lesson.id" :can-write="canWrite" />
|
||||
|
||||
<section v-if="lesson.tags?.length" class="ld-tags">
|
||||
<TagPill v-for="t in lesson.tags" :key="t" :tag="t" />
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user