Restore debug-style inspectability in calculation steps - #27
Merged
Merged
Conversation
Bring the playground inspect panel closer to the old debug showcase: labeled before/after instants, recognized-phrase chips, and written-order copy. Keep the disclosure closed and nested inputs quiet. Co-authored-by: Myles Cook <MylesMCook@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Fix the capitalization comparison and add regression coverage.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Restores debug-style inspection details for calculation steps using existing calculation data.
Changes:
- Adds phrase chips and typed-versus-normalized display.
- Shows labeled From/To timestamps and written-order guidance.
- Adds coverage for endpoints, normalization, clamping, and disclosures.
File summaries
| File | Summary |
|---|---|
src/features/parser/components/calculation-trace.tsx |
Renders enhanced trace details. A moderate issue remains: case-insensitive comparison can suppress Typed as … when capitalization differs. |
src/features/parser/components/calculation-trace.test.tsx |
Tests the restored trace behavior; capitalization regression coverage is needed. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const parts = normalized.split(/\s+/).filter(Boolean); | ||
| if (!parts.length) return null; | ||
| const typed = expression.trim(); | ||
| const showTyped = typed.length > 0 && typed.toLowerCase() !== normalized; |
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.
What changed?
The playground “Show calculation steps” panel had dropped the inspectable parts of Tempus’s old Debug / “See how it works” showcase: labeled From/To instants per change, and a read of the phrase as recognized parts.
This restores those using existing
Calculationdata only (no parser language changes):normalized, plus “Typed as …” when the original expression differsstep.before/ Tostep.afteron each arithmetic stepHow did you check it?
vp test src/features/parser/components/calculation-trace.test.tsx— 8 passed (closed by default, From/To, phrase chips, typed-vs-normalized, clamp notes)node examples/app/verify-calculator.mjs …at 320 and 1280 —{"status":"passed","runs":6}http://127.0.0.1:5174/:today plus 2 weeks minus 3 days→ Sunday, September 27, 2026; steps closed until opened; chips + From/To visibleJanuary 31 2027 plus 1 month→ Sunday, February 28, 2027 with Clamped on the step/developerscurrent-nav still marks this pageDesktop steps after: phrase chips and From/To
320 steps after: wrapped chips and From/To
calc_steps_debug_browser_walkthrough.mp4
Anything that could break?
Opening calculation steps now shows two timestamps per change instead of one. The outer disclosure stays closed until the user opens it. Journey scripts already assert both
beforeandafterlocal strings in the open trace.To show artifacts inline, enable in settings.