Skip to content

Text tab: show extracted text, move Extract text there, scope suggestions per tab - #42

Merged
davior merged 2 commits into
mainfrom
claude/awesome-hopper-vym4wa
Oct 23, 2026
Merged

davior merged 2 commits into
mainfrom
claude/awesome-hopper-vym4wa

Conversation

@davior

@davior davior commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

What was wrong

1. "Extract text" appeared to do nothing. The backend was fine: I ran the real server, uploaded a Chromium-generated PDF, hit POST /extract-text, and the job finished in ~35 ms with the text stored and returned by GET /text. The UI was at fault. The button lived on Info and the result on Text, and Tabs keeps every panel mounted, so DocumentTextPanel fetched once when the asset opened (empty, nothing running) and never again.

2. Suggestions showed on the wrong tabs. SuggestionPanel rendered every suggestion kind, and one is mounted on both Details and Source. So attribution proposals appeared on Details, and title/tag proposals under Source.

Changes

  • DocumentTextPanel reloads whenever the activity store's extract_text job for its asset changes (keyed on job id + status, so a re-run is caught too).
  • The Extract text button moves from Info to the top of the Text tab. It already shows a failed run's reason (e.g. a scanned PDF needing OCR), which now sits next to the empty state.
  • SuggestionPanel takes a required scope: details shows title and tag suggestions, source shows attribution. The filter is applied as suggestions load, so "Accept all" and the empty state follow it and Accept all on Details can no longer accept attribution.

Testing

  • New tests, failing before the change: text appears after a job finishes elsewhere; a failed job's reason is shown; the button is on the Text panel; each scope shows only its own kinds; Accept all stays within its scope.
  • Lint, prettier, 402 frontend tests and npm run build pass. Backend suite (1272) passed on the first commit; this one touches no backend code.

Not changed

A scanned PDF or photographed page will still fail with the OCR message, since OCR isn't implemented.

🤖 Generated with Claude Code

https://claude.ai/code/session_016qCc34GmfeFJr83WN71291

… failed

Tabs keeps every panel mounted, so DocumentTextPanel fetched once when the
asset opened (empty, nothing running) and never again. "Extract text" lives on
the Info tab; the job ran and succeeded, but the Text tab kept saying no text
had been read. The panel now reloads whenever the activity store's
extract_text job for its asset changes.

The job's error (a scanned PDF has no text layer) was likewise visible only
beside the button on the Info tab, while the Text tab invited a re-run that
cannot work. It is shown there too.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qCc34GmfeFJr83WN71291
… own

Extract text moves from Info to the top of the Text panel, beside the only
place its output is shown. The button reports a failed run's reason itself,
so the separate error block the panel gained earlier goes.

SuggestionPanel took no notion of where it was. Details and Source both mount
one (Tabs keeps every panel mounted) and both read every suggestion, so
attribution proposals appeared on Details and title/tag proposals under
Source. It now takes a scope - details: title and tag, source: attribution -
applied as suggestions load, so "Accept all" cannot accept the other tab's.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qCc34GmfeFJr83WN71291
@davior davior changed the title Text tab: show extracted text started from another tab, and why a run failed Text tab: show extracted text, move Extract text there, scope suggestions per tab Oct 23, 2026
@davior
davior marked this pull request as ready for review October 23, 2026 15:02
@davior
davior merged commit 6058466 into main Oct 23, 2026
3 checks passed
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.

2 participants