feat(8191): knowledge reaches a session from every project, ranked below its own and labelled
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Plugin hooks (push) Successful in 17s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Python tests (push) Failing after 2m0s
CI & Build / Build & push image (push) Canceled after 0s
CI & Build / integration (push) Canceled after 2m7s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Plugin hooks (push) Successful in 17s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Python tests (push) Failing after 2m0s
CI & Build / Build & push image (push) Canceled after 0s
CI & Build / integration (push) Canceled after 2m7s
A per-kind reach beside the kind-by-moment table (setting record_reach, default snippet/note/process/lesson) widens the passive note arms and their slots to the user's other projects. A record from elsewhere gives up 0.05 before the floor and the ranking, and its line names the project. Work kinds stay in their project, the visibility clause is unchanged, and an explicit project search still means that project. Settings > Moments edits the reach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -297,9 +297,17 @@ export interface RecordKindsDoor {
|
||||
evidence: Record<string, WayCounts>;
|
||||
}
|
||||
|
||||
/** Which kinds a door may offer from the user's other projects. */
|
||||
export interface RecordKindsReach {
|
||||
kinds: string[];
|
||||
default: string[];
|
||||
changed: boolean;
|
||||
}
|
||||
|
||||
export interface RecordKindsTable {
|
||||
days: number;
|
||||
evidence_failed: boolean;
|
||||
reach: RecordKindsReach;
|
||||
kinds: { kind: string; label: string }[];
|
||||
doors: RecordKindsDoor[];
|
||||
}
|
||||
@@ -313,6 +321,11 @@ export function setRecordKinds(door: string, kinds: string[] | null): Promise<Re
|
||||
return apiPut("/api/retrieval/record-kinds", { door, kinds });
|
||||
}
|
||||
|
||||
/** `kinds: null` puts the reach back to its shipped default. */
|
||||
export function setRecordKindsReach(kinds: string[] | null): Promise<RecordKindsTable> {
|
||||
return apiPut("/api/retrieval/record-kinds/reach", { kinds });
|
||||
}
|
||||
|
||||
/** How a record arrived in front of a session. */
|
||||
export type RecordWay = "pushed" | "pointed" | "asked" | "direct";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { apiErrorMessage } from "@/api/client";
|
||||
import { getRecordKinds, setRecordKinds } from "@/api/moments";
|
||||
import { getRecordKinds, setRecordKinds, setRecordKindsReach } from "@/api/moments";
|
||||
import type { RecordKindsDoor, RecordKindsTable } from "@/api/moments";
|
||||
|
||||
/**
|
||||
@@ -10,6 +10,10 @@ import type { RecordKindsDoor, RecordKindsTable } from "@/api/moments";
|
||||
* 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.
|
||||
*
|
||||
* Above the doors: which kinds may also come from the user's other projects.
|
||||
* Knowledge crosses by default and work stays in its project; a record from
|
||||
* elsewhere ranks a little below this project's own and says where it is from.
|
||||
*/
|
||||
const props = defineProps<{ days: number }>();
|
||||
|
||||
@@ -44,6 +48,26 @@ function toggle(row: RecordKindsDoor, kind: string, on: boolean) {
|
||||
void save(row.door, next);
|
||||
}
|
||||
|
||||
const REACH = "reach";
|
||||
|
||||
async function saveReach(kinds: string[] | null) {
|
||||
saving.value = REACH;
|
||||
saveError.value = "";
|
||||
try {
|
||||
table.value = await setRecordKindsReach(kinds);
|
||||
} catch (e) {
|
||||
saveError.value = apiErrorMessage(e, "The change could not be saved.");
|
||||
} finally {
|
||||
saving.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
function toggleReach(kind: string, on: boolean) {
|
||||
if (!table.value) return;
|
||||
const now = table.value.reach.kinds;
|
||||
void saveReach(on ? [...now, kind] : now.filter((k) => k !== kind));
|
||||
}
|
||||
|
||||
function evidenceText(row: RecordKindsDoor, kind: string): string {
|
||||
const c = row.evidence[kind];
|
||||
return c ? `${c.opened} of ${c.delivered} opened` : "none shown";
|
||||
@@ -70,6 +94,34 @@ onMounted(load);
|
||||
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 class="door" :disabled="saving === REACH">
|
||||
<legend class="door-head">
|
||||
<span class="door-label">Also from your other projects</span>
|
||||
<span class="door-fires">at every point below, while a session works in a project</span>
|
||||
<span v-if="!table.reach.changed" class="door-default">shipped default</span>
|
||||
</legend>
|
||||
<p class="field-hint">
|
||||
A ticked kind is offered from any project you can see, not only the one the session is in.
|
||||
Such a record has to be a little closer to be shown, ranks below an equally close one from
|
||||
the session's project, and its line names the project it came from. An unticked kind is
|
||||
offered only from the session's own project. A search the session runs itself, for one
|
||||
project, still means that project.
|
||||
</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="table.reach.kinds.includes(k.kind)"
|
||||
@change="toggleReach(k.kind, ($event.target as HTMLInputElement).checked)"
|
||||
/>
|
||||
{{ k.label }}
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
<button v-if="table.reach.changed" type="button" class="btn-text door-reset" @click="saveReach(null)">
|
||||
Back to the shipped default
|
||||
</button>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
v-for="row in table.doors" :key="row.door" class="door"
|
||||
:disabled="saving === row.door"
|
||||
|
||||
Reference in New Issue
Block a user