CodeForPhilly / CodeForPhilly/balancer-main

[Insight extractor] Feature: Rich Hover Preview for Source References

Open
#376 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
21
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Image

### ✨ Feature: Rich Hover Preview for Source References

**User Story**
As a user, when I see a numbered reference in the chat (e.g., “²”), I want to hover over it to see more context about the source (page number, snippet, relevance) before I click, so I can quickly judge whether it’s worth opening.

---

### 📝 Current Behavior
- References appear as small numbered badges (e.g., ¹, ²).
- Clicking opens the linked PDF page + chunk.
- Hover only shows “Page X, Chunk Y” (not very helpful).

---

### 🎯 Expected Behavior
- Hovering over a reference badge shows a **tooltip/card preview** with:
- Document title (truncated if long).
- Page number + chunk.
- Text snippet from the source (first 2–3 lines).
- (Optional) Relevance note if available.
- Clicking still navigates to the correct PDF page + highlighted span.

---

### ✅ Acceptance Criteria
- [ ] Hovering over numbered reference shows expanded preview.
- [ ] Preview displays document title, snippet, and page/chunk info.
- [ ] Preview is styled consistently (not blocking main text).
- [ ] Clicking reference still navigates to PDF view at correct location.
- [ ] Works across all references in chat responses.

---

### 🔨 Task Breakdown
- [ ] **Backend**
- Ensure each reference includes snippet + metadata (document title, page, chunk).

- [ ] **Frontend**
- Implement hover tooltip/card component.
- Populate with snippet + metadata.
- Ensure tooltip is responsive and doesn’t overflow small screens.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.