Skip to content

feat: Add memory hovercards to consolidation view#22

Open
jrflga wants to merge 1 commit into
raroque:mainfrom
jrflga:codex/memory-hovercards
Open

feat: Add memory hovercards to consolidation view#22
jrflga wants to merge 1 commit into
raroque:mainfrom
jrflga:codex/memory-hovercards

Conversation

@jrflga
Copy link
Copy Markdown

@jrflga jrflga commented Apr 28, 2026

Small PR just to add a hovercard to the memory id on the consolidation view for better understanding of the judgement
image

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR adds inline memory hovercards to the consolidation view by extracting memory IDs from the reasoning details JSON via a module-level regex, fetching the matching records with a new getByMemoryIds Convex query, and rendering them through MemoryText / MemoryIdHover components. The implementation is straightforward and consistent with existing codebase patterns — no issues were found.

Confidence Score: 5/5

Safe to merge — purely additive debug UI with no impact on production logic.

No P0 or P1 findings. Hook ordering is correct, shared global regex is safe with .match()/.split(), the 100-ID cap is a sensible safeguard, and the mono CSS class is defined in styles.css.

No files require special attention.

Important Files Changed

Filename Overview
convex/memoryRecords.ts Adds getByMemoryIds query that deduplicates, caps at 100, and fetches records by string memoryId via the by_memory_id index — consistent with existing patterns in the file.
debug/src/components/ConsolidationPanel.tsx Adds MemoryText and MemoryIdHover components plus memoryIdsFrom helper; wires a useQuery call into ReasoningSection before any early returns, so hook ordering is correct.

Sequence Diagram

sequenceDiagram
    participant RS as ReasoningSection
    participant MIF as memoryIdsFrom()
    participant UQ as useQuery (Convex)
    participant DB as memoryRecords DB
    participant MT as MemoryText
    participant MH as MemoryIdHover

    RS->>MIF: JSON.stringify(details)
    MIF-->>RS: string[] of unique memoryIds (≤100)
    RS->>UQ: getByMemoryIds({ memoryIds })
    UQ->>DB: index lookup by_memory_id × N
    DB-->>UQ: MemoryRecord[]
    UQ-->>RS: memoryRecords (or undefined while loading)
    RS->>MT: renderMemoryText(text)
    MT->>MT: text.split(MEMORY_ID_RE) + text.match(MEMORY_ID_RE)
    MT->>MH: memoryId + memoryById.get(id)
    MH-->>MT: hovercard span
    MT-->>RS: React nodes with inline hovercards
Loading

Reviews (1): Last reviewed commit: "Add memory hovercards to consolidation v..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant