Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7adfbe3
feat(dashboard): add processing, usage, and runtime observability
happy-v587 Oct 31, 2026
bd226dc
feat(dashboard): add cloud-native monitoring guide and restructure Dr…
happy-v587 Nov 9, 2026
8a633f8
chore: retrigger CI
happy-v587 Nov 9, 2026
9476bed
chore: retrigger CI
happy-v587 Nov 9, 2026
be4bec4
chore: sync PR head
happy-v587 Nov 9, 2026
5fd5312
chore: retrigger CI
happy-v587 Nov 10, 2026
e9ff41d
feat(dashboard): show source save time
happy-v587 Nov 10, 2026
38ee86a
fix(ci): restore integration contracts and pin ACP runner SDK
happy-v587 Nov 10, 2026
0965f70
fix(ci): review source save metadata compatibility
happy-v587 Nov 10, 2026
706faed
test(persistence): expect unknown save time for legacy sources
happy-v587 Nov 10, 2026
e27fca3
fix(desktop): qualify current dashboard server contract
happy-v587 Nov 10, 2026
6e7c579
fix(dashboard): preserve source preview metadata and attribution
happy-v587 Nov 10, 2026
9608296
test(handoff): isolate report query budget from background SQL
happy-v587 Nov 10, 2026
e7bd019
test(dsh): install compatible plugin in web doctor fixture
happy-v587 Nov 10, 2026
2e5b3ba
fix(dashboard): preserve exact source navigation
happy-v587 Nov 11, 2026
ea7b073
fix(topic-memory): bound related history candidates
happy-v587 Nov 12, 2026
f94a655
fix(rebase): reconcile migration manifests and upgrade review
happy-v587 Nov 12, 2026
3be6c00
chore(rebase): regenerate API models
happy-v587 Nov 12, 2026
3e32757
fix(ci): add missing license headers to dashboard templates
happy-v587 Nov 12, 2026
90ea28a
test(e2e): rewind registered schema by the whole pending chain
happy-v587 Nov 12, 2026
7408253
chore: retrigger CI
happy-v587 Nov 12, 2026
bd54aff
fix(desktop): requalify the merged Dashboard contract
happy-v587 Nov 12, 2026
c1ca71c
fix(dashboard): prefill the saved feedback reason when editing
happy-v587 Nov 12, 2026
c749213
fix(dashboard): keep failure navigation consistent with its summary
happy-v587 Nov 13, 2026
c328f92
fix(desktop): requalify the Dashboard contract on SQLite
happy-v587 Nov 13, 2026
685f4ad
fix(release): review the status-filtered processing read
happy-v587 Nov 13, 2026
4e12b39
fix(integrations): rebuild bundles for the all-history summary
happy-v587 Nov 13, 2026
5cf73ec
test(native): wait out launchd's respawn throttle in the retry test
happy-v587 Nov 13, 2026
b2be0b6
refactor(dashboard): remove ledgers and show source artifacts
happy-v587 Nov 13, 2026
8596ad4
fix(dashboard): complete source lineage views and remove stale ledger…
happy-v587 Nov 13, 2026
a377df7
refactor: separate topic memory history fix
happy-v587 Nov 13, 2026
f56630c
merge: synchronize dashboard with master
happy-v587 Nov 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(dashboard): prefill the saved feedback reason when editing
The feedback editor rendered an empty textarea even when the record
already carried a reason, so changing only adoption submitted an empty
reason and the latest feedback lost its explanation while the historical
row stayed intact.

Prefill the editor from the saved reason. An explicit clear still submits
an empty value, and a regression covers editing adoption without
clearing the reason.

Co-Authored-By: Claude Code <noreply@anthropic.com>
  • Loading branch information
happy-v587 and claude committed Nov 12, 2026
commit c1ca71c24f7a07d534ef9eefe063d7f07bfc831d
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h2 class="section-title" id="usage-feedback-heading">{{ t.usage_feedback }}</h2
{% if record.feedback %}
<div class="usage-feedback-result"><div>{{ t.usage_adoption }}:{{ t['usage_' ~ record.feedback.adoption] }} · {{ t.usage_helpful }}:{{ t['usage_' ~ record.feedback.helpful] }}</div>{% if record.feedback.reason %}<p class="source-text mt-2">{{ record.feedback.reason }}</p>{% endif %}<div class="document-meta mt-2">{{ t.usage_reported }} · {{ record.feedback.created_at|display_time }}</div></div>
{% else %}<p class="text-secondary">{{ t.usage_feedback_not_reported }}</p>{% endif %}
{% if usage_can_feedback %}<details class="usage-feedback-editor" {% if request.query_params.get('feedback_saved') == '1' %}open{% endif %}><summary>{{ t.usage_feedback_edit if record.feedback else t.usage_feedback_add }}</summary><p class="text-secondary small mt-3">{{ t.usage_feedback_notice }}</p>{% if usage_can_feedback %}<form action="{{ link('usage/feedback') }}" method="post" hx-boost="false"><input type="hidden" name="scope" value="{{ scope }}"><input type="hidden" name="feedback_id" value="{{ usage_feedback_id }}"><input type="hidden" name="record_id" value="{{ record.record_id }}"><input type="hidden" name="record_kind" value="{{ record.record_kind }}"><div class="row g-3 mb-3">{% for key in ['adoption','helpful'] %}<div class="col-sm-6"><label class="form-label" for="feedback-{{ key }}">{{ t['usage_' ~ key] }}</label><select class="form-select" id="feedback-{{ key }}" name="{{ key }}">{% for value in ['unknown','yes','no'] %}<option value="{{ value }}" {% if record.feedback and record.feedback[key] == value %}selected{% endif %}>{{ t['usage_' ~ value] }}</option>{% endfor %}</select></div>{% endfor %}</div><label class="form-label" for="feedback-reason">{{ t.usage_feedback_reason }}</label><textarea id="feedback-reason" name="reason" rows="2" maxlength="2000" class="form-control mb-3"></textarea><button class="btn btn-primary" type="submit">{{ t.usage_record_feedback }}</button></form>{% endif %}</details>{% endif %}
{% if usage_can_feedback %}<details class="usage-feedback-editor" {% if request.query_params.get('feedback_saved') == '1' %}open{% endif %}><summary>{{ t.usage_feedback_edit if record.feedback else t.usage_feedback_add }}</summary><p class="text-secondary small mt-3">{{ t.usage_feedback_notice }}</p>{% if usage_can_feedback %}<form action="{{ link('usage/feedback') }}" method="post" hx-boost="false"><input type="hidden" name="scope" value="{{ scope }}"><input type="hidden" name="feedback_id" value="{{ usage_feedback_id }}"><input type="hidden" name="record_id" value="{{ record.record_id }}"><input type="hidden" name="record_kind" value="{{ record.record_kind }}"><div class="row g-3 mb-3">{% for key in ['adoption','helpful'] %}<div class="col-sm-6"><label class="form-label" for="feedback-{{ key }}">{{ t['usage_' ~ key] }}</label><select class="form-select" id="feedback-{{ key }}" name="{{ key }}">{% for value in ['unknown','yes','no'] %}<option value="{{ value }}" {% if record.feedback and record.feedback[key] == value %}selected{% endif %}>{{ t['usage_' ~ value] }}</option>{% endfor %}</select></div>{% endfor %}</div><label class="form-label" for="feedback-reason">{{ t.usage_feedback_reason }}</label><textarea id="feedback-reason" name="reason" rows="2" maxlength="2000" class="form-control mb-3">{% if record.feedback %}{{ record.feedback.reason }}{% endif %}</textarea><button class="btn btn-primary" type="submit">{{ t.usage_record_feedback }}</button></form>{% endif %}</details>{% endif %}
</section>
<details class="usage-detail-technical"><summary>{{ t.record_details }}</summary><dl class="usage-detail-facts mt-3"><dt>{{ t.usage_record_identity }}</dt><dd>{{ record.record_id }}</dd><dt>{{ t.usage_record_integration }}</dt><dd>{{ record.integration }}</dd><dt>{{ t.usage_record_size }}</dt><dd>{{ record.content_bytes }} bytes</dd></dl></details>
</article>
Expand Down
40 changes: 40 additions & 0 deletions tests/test_dashboard_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,46 @@ def test_feedback_is_reported_idempotent_and_scope_bound(dashboard, tmp_path):
assert form["reason"] not in forged.text


def test_editing_feedback_keeps_the_saved_reason_unless_cleared(dashboard, tmp_path):
scope = create_scope(dashboard, "Edited feedback")["scope_id"]
_, url = prepare(dashboard, scope)
endpoint = "/dashboard/usage/feedback?lang=en"
reported = form_for(dashboard.get(url), scope, url)
saved = dashboard.post(endpoint, data=reported, headers={"Origin": "http://testserver"}, follow_redirects=False)
assert saved.status_code == 303, saved.text

editor = dashboard.get(url)
assert editor.status_code == 200, editor.text
prefilled = re.search(r'<textarea[^>]*name="reason"[^>]*>(.*?)</textarea>', editor.text, re.S)
assert prefilled is not None, editor.text
assert prefilled[1].strip() == reported["reason"]

# Editing only the adoption keeps the reported explanation instead of silently clearing it.
revised = {**form_for(editor, scope, url), "adoption": "no", "reason": prefilled[1].strip()}
changed = dashboard.post(endpoint, data=revised, headers={"Origin": "http://testserver"}, follow_redirects=False)
assert changed.status_code == 303, changed.text
reopened = dashboard.get(url)
assert reopened.status_code == 200, reopened.text
assert reported["reason"] in reopened.text
with sqlite3.connect(tmp_path / "data.db") as connection:
rows = connection.execute(
"SELECT json_extract(payload, '$.reason') FROM pc_context_usage_feedback"
" WHERE scope_id=? ORDER BY created_at DESC, feedback_id DESC",
(scope,),
).fetchall()
assert [row[0] for row in rows] == [reported["reason"], reported["reason"]]

# An explicit clear still works.
cleared = dashboard.post(
endpoint,
data={**form_for(reopened, scope, url), "adoption": "no", "reason": ""},
headers={"Origin": "http://testserver"},
follow_redirects=False,
)
assert cleared.status_code == 303, cleared.text
assert reported["reason"] not in dashboard.get(url).text


def test_viewer_cannot_submit_feedback_or_read_another_scope(dashboard, monkeypatch):
scope = create_scope(dashboard, "Private preparation")["scope_id"]
_, url = prepare(dashboard, scope)
Expand Down
Loading