question/answer text: server-side file_refs
DashboardEvent::QuestionAdded gains question_refs and QuestionResolved gains answer_refs — both populated via scan_validated_paths at emit time, same helper the broker forwarder uses for Sent/Delivered. cold-load snapshot wraps each OpQuestion in QuestionView with the same fields computed once per /api/state. client threads refs through questionsState rows (pending + history) and passes them to appendLinkified at every render site (live pane, history details). path tokens in question and answer bodies now linkify with the same server-vouched guarantee broker messages already enjoyed.
This commit is contained in:
parent
378e8bf9df
commit
4ec401a6c7
4 changed files with 62 additions and 9 deletions
|
|
@ -748,6 +748,7 @@
|
|||
asked_at: ev.asked_at,
|
||||
deadline_at: ev.deadline_at ?? null,
|
||||
target: ev.target || null,
|
||||
question_refs: ev.question_refs || [],
|
||||
});
|
||||
renderQuestions();
|
||||
}
|
||||
|
|
@ -766,6 +767,8 @@
|
|||
answer: ev.answer,
|
||||
answerer: ev.answerer,
|
||||
target: existing?.target ?? ev.target ?? null,
|
||||
question_refs: existing?.question_refs || [],
|
||||
answer_refs: ev.answer_refs || [],
|
||||
});
|
||||
if (questionsState.history.length > QUESTION_HISTORY_LIMIT) {
|
||||
questionsState.history.length = QUESTION_HISTORY_LIMIT;
|
||||
|
|
@ -857,7 +860,7 @@
|
|||
head.append(' ', el('span', { class: 'q-ttl' }, txt));
|
||||
}
|
||||
const qBody = el('div', { class: 'q-body' });
|
||||
const qPreviews = appendLinkified(qBody, q.question);
|
||||
const qPreviews = appendLinkified(qBody, q.question, q.question_refs);
|
||||
li.append(head, qBody);
|
||||
for (const d of qPreviews) li.appendChild(d);
|
||||
const f = el('form', {
|
||||
|
|
@ -953,9 +956,9 @@
|
|||
el('span', { class: 'msg-sep' }, 'asked:'),
|
||||
);
|
||||
const histBody = el('div', { class: 'q-body' });
|
||||
const histBodyPreviews = appendLinkified(histBody, q.question);
|
||||
const histBodyPreviews = appendLinkified(histBody, q.question, q.question_refs);
|
||||
const ansText = el('span', { class: 'q-answer-text' });
|
||||
const histAnsPreviews = appendLinkified(ansText, q.answer || '(none)');
|
||||
const histAnsPreviews = appendLinkified(ansText, q.answer || '(none)', q.answer_refs);
|
||||
const ansLine = el('div', { class: 'q-answer' },
|
||||
el('span', { class: 'msg-sep' }, `${q.answerer || '?'}: `),
|
||||
ansText,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue