Add sub-question branching + document summary modals
- Source modal now shows LLM-generated document summary (lazy-gen + cached in documents.summary) instead of raw chunk text; toggle reveals matched chunk; "View all chunks" button fetches every chunk of the document via new api/document-chunks.php endpoint - Each sub-question card gets a "Branch ↓" button that pre-fills the query with that sub-question and shows a context panel with the prior brief summary; prior_context + branch_notes are injected into interpretSeed() and synthesise() so the LLM knows where the research is coming from - Upload document summaries generated at synthesis time and attached to upload sources alongside corpus summaries - DB: documents.summary TEXT column added to bnl_corpus on chloe Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,20 @@ require_once __DIR__ . '/includes/layout.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="advBranchPanel" class="branch-panel is-hidden" aria-label="Branch context">
|
||||
<div class="branch-panel__head">
|
||||
<span class="branch-panel__label">Branching from sub-question</span>
|
||||
<button type="button" id="advBranchClear" class="upload-clear">× Clear branch</button>
|
||||
</div>
|
||||
<p id="advBranchOrigin" class="branch-panel__origin"></p>
|
||||
<details class="branch-panel__prior">
|
||||
<summary>Prior brief summary</summary>
|
||||
<div id="advBranchSummary" class="branch-panel__brief"></div>
|
||||
</details>
|
||||
<label class="input-label" for="advBranchNotes">Add your notes / context</label>
|
||||
<textarea id="advBranchNotes" rows="3" placeholder="Optional: add observations, corrections, or additional context for this branch…"></textarea>
|
||||
</div>
|
||||
|
||||
<label class="input-label" for="advInput">Describe the dispute or case situation</label>
|
||||
<textarea id="advInput" name="advInput" rows="8" placeholder="Describe the facts of the case, the dispute, and what matters most to your client. The agent will generate adversarial sub-questions, retrieve from the legal corpus and your uploaded files, and synthesise a partisan brief with citations."></textarea>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user