feat: appetizer latency metric + new LA click tracking#150
Closed
yodem wants to merge 3 commits into
Closed
Conversation
Adds a "reading now" context chip at the top of the chat that displays the Sefaria text ref currently open in the reader. Clicking it navigates back to that ref via sefaria:bootstrap-url. Also removes version_language from the get_text tool description to clean up thinking step labels. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sc-44755: add a numeric, aggregatable metrics.time_to_appetizer on the trace measuring user-perceived latency from request receipt to the moment the appetizer is served (seconds, one decimal). Only set when an appetizer is actually served; the existing metadata.appetizer debug blob is kept. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sc-44684: report four new assistant_click feature_names. Add a dedicated
data-feature-name attribute (read by the host click tracker before the
generic link/aria-label logic) so anchors and the context chip report
clean labels without degrading accessibility:
- context chip -> initial_location_link
- appetizer topics -> related_topics_link (drop stopPropagation so the
click reaches the host tracker; keep preventDefault)
- thinking toggle -> thinking_steps_toggle
- thinking ref link -> thinking_steps_text_link
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📊 Code Quality Score: 44/100
Was this score accurate? 👍 Yes · 👎 No Scored by GitVelocity · How are scores calculated? |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements two Library Assistant stories, based on the appetizer/progress-trail work in PR #136 (
waiting-source).sc-44755 —
time_to_appetizerBraintrust metricAdds a numeric, aggregatable
metrics.time_to_appetizeron the trace measuring user-perceived latency from request receipt to the moment the appetizer is served (seconds, one decimal). Only emitted when an appetizer is actually served (suppressed/error/no-result/stream-closed all skip it). The existingmetadata.appetizerdebug blob is kept.sc-44684 — new
assistant_clickfeature_namesReports four new click
feature_names. Implemented via a dedicateddata-feature-nameattribute read by the host click tracker before the generic link/aria-label logic — chosen over the ticket's literal "aria-labels" because:<a>elements that otherwise short-circuit to the generic "Response link" label.Reporting is identical either way — GA4 keys on the
feature_namevalue, not the source attribute.initial_location_linkrelated_topics_linkthinking_steps_togglethinking_steps_text_linkAlso drops
stopPropagationon the appetizer link (keptpreventDefault) so the click reaches the host tracker. Onlydocument-level click listener is the menu outside-click-close, which is unaffected.Notes
initial_location_link's target element) is carried in as a dependency — it isn't in PR feat: Progress Trail + Topic Appetizer for latency reduction #136. The other three labels + the metric are native to PR feat: Progress Trail + Topic Appetizer for latency reduction #136's feature set.Test plan
metrics.time_to_appetizeris emitted (runs appetizer inline to avoid thread races). Full suite 45 passed.feature_names fire in cauldron before deploy.🤖 Generated with Claude Code