feat(ui): show merged-into-parent badge on adopted observations
ObservationCard renders a secondary "merged → <parent>" chip when merged_into_project is set, next to the existing project label. Both are meaningful: project is origin provenance, merged_into_project is the current home. Extends PaginationHelper's observations and summaries queries with OR merged_into_project = ? so the single-project viewer fetch pulls in adopted rows — the plan's Phase 3 covered multi-project context injection; this is the single-project UI read path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -124,6 +124,7 @@ export interface Observation {
|
||||
id: number;
|
||||
memory_session_id: string; // Renamed from sdk_session_id
|
||||
project: string;
|
||||
merged_into_project: string | null;
|
||||
platform_source: string;
|
||||
type: string;
|
||||
title: string;
|
||||
|
||||
@@ -80,6 +80,7 @@ export class PaginationHelper {
|
||||
o.id,
|
||||
o.memory_session_id,
|
||||
o.project,
|
||||
o.merged_into_project,
|
||||
COALESCE(s.platform_source, 'claude') as platform_source,
|
||||
o.type,
|
||||
o.title,
|
||||
@@ -100,8 +101,10 @@ export class PaginationHelper {
|
||||
const conditions: string[] = [];
|
||||
|
||||
if (project) {
|
||||
conditions.push('o.project = ?');
|
||||
params.push(project);
|
||||
// Include adopted merged-worktree rows so the parent project's view
|
||||
// surfaces observations that originated under its merged children.
|
||||
conditions.push('(o.project = ? OR o.merged_into_project = ?)');
|
||||
params.push(project, project);
|
||||
}
|
||||
if (platformSource) {
|
||||
conditions.push(`COALESCE(s.platform_source, 'claude') = ?`);
|
||||
@@ -156,8 +159,10 @@ export class PaginationHelper {
|
||||
const conditions: string[] = [];
|
||||
|
||||
if (project) {
|
||||
conditions.push('ss.project = ?');
|
||||
params.push(project);
|
||||
// Include adopted merged-worktree summaries so the parent project's view
|
||||
// surfaces rows that originated under its merged children.
|
||||
conditions.push('(ss.project = ? OR ss.merged_into_project = ?)');
|
||||
params.push(project, project);
|
||||
}
|
||||
|
||||
if (platformSource) {
|
||||
|
||||
Reference in New Issue
Block a user