Skip to content

Restore debug-style inspectability in calculation steps - #27

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/calculation-steps-from-debug-152e
Sep 16, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/calculation-steps-from-debug-152e

Conversation

@MylesMCook

@MylesMCook MylesMCook commented Sep 16, 2026

Copy link
Copy Markdown
Owner

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 Calculation data only (no parser language changes):

  • Phrase chips from normalized, plus “Typed as …” when the original expression differs
  • Labeled From step.before / To step.after on each arithmetic step
  • One quiet written-order line
  • Timeline rail, clamp notes, default-closed disclosure, and nested Calculation inputs / Exact UTC stay as shipped in Clarify calculator hierarchy after the live visual audit #21

How 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}
  • Browser path on http://127.0.0.1:5174/:
    • today plus 2 weeks minus 3 days → Sunday, September 27, 2026; steps closed until opened; chips + From/To visible
    • January 31 2027 plus 1 month → Sunday, February 28, 2027 with Clamped on the step
    • 320px: chips wrap, timestamps readable, no horizontal overflow
    • /developers current-nav still marks this page

Desktop 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 before and after local strings in the open trace.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

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>
@MylesMCook
MylesMCook marked this pull request as ready for review September 16, 2026 17:52
Copilot AI lite review requested due to automatic review settings September 16, 2026 17:52
@cursor
cursor Bot merged commit c79a90f into main Sep 16, 2026
2 checks passed
@cursor
cursor Bot deleted the cursor/calculation-steps-from-debug-152e branch September 16, 2026 17:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants