Skip to content

Add PDF request history inspection - #1

Open
Bobcat wants to merge 3 commits into
mainfrom
feature/pdf-request-history
Open

Add PDF request history inspection#1
Bobcat wants to merge 3 commits into
mainfrom
feature/pdf-request-history

Conversation

@Bobcat

@Bobcat Bobcat commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a recent-request selector to the PDF translation top row.
  • Reload the source PDF, rendered artifacts, raw lifecycle data, and per-page prompts and responses for a historical request.
  • Restore the request settings exactly and lock translation settings in inspection mode.
  • Keep render controls active so a historical request can produce a new rerender request.
  • Show a clear placeholder because detailed timings are not retained for historical requests.

The selector contains only initial PDF translations returned by translation-services. A rerender appears only as the transient current request and never enters the durable history list. Returning to “New request” restores the controls that were active before inspection.

This consumes the additive history and request_options artifact API from Bobcat/translation-services#20. If that endpoint is unavailable or configured with a limit of zero, the selector stays hidden.

Checks

  • .venv/bin/python -m unittest discover -s tests — 116 passed
  • node --input-type=module --check < static/src/workflows/pdf-translation/index.js
  • node --input-type=module --check < static/src/api-client.js
  • git diff --check

@Bobcat

Bobcat commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

Review follow-up is in 88680dd.

  • W1: a failed history load releases the dropdown.
  • W2: page-scale restoration matches existing options numerically.
  • W3: cancel and reset clear stale rerender state.
  • W4: missing, expired, and unreachable option artifacts have distinct handling.
  • W5: real rerender timings are shown when the response carries metrics.
  • W6: a completed initial request no longer appears twice.
  • W7: a late list refresh preserves the current selection.
  • W8: opening history loads the source PDF once.

Checks: 116 passed; both changed JavaScript modules pass the Node syntax check. Port 8002 was left under the user's control.

@Bobcat

Bobcat commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

Round 2 follow-up is in 9477469.

R1 now exits inspection mode completely after a failed history load. It restores the original New request controls, clears stale lifecycle and timing output, and returns the selector to New request. This also covers failure after a previously loaded historical request.

R2 now clears the source iframe immediately when the selected request's artifacts have expired.

Checks: 116 passed; the PDF view parses as ESM. The user-managed process on port 8002 was not restarted.

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.

1 participant