Repository navigation
frontend: open a .txt/.md file, read exactly as the CLI reads it - #12
Merged
Merged
Conversation
A button and drop-on-editor open a local text file in the browser; nothing is sent until Read. upload.ts decodes as Python's open(path, encoding='utf-8') does: invalid UTF-8 refused, CRLF/CR folded to LF, BOM kept. PDF and other types are refused with a reason; a refusal never discards the current text. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…eplace and mid-read opens Review findings: a refusal no longer hides a valid verdict or re-enables Read mid-request (separate notice banner); a report for text no longer in the editor is dropped; Open/Sample disabled while reading; last requested file wins; replacing non-empty text asks first (setText is not undoable); a file dropped outside the editor no longer navigates away. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
31 of 34 tasks
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.
Advances #1 ("Left open after Phase 5: Upload (md/txt/pdf)") — the text-file half. PDF stays deliberately unbuilt, now with the reason shown to the user.
What
frontend/src/upload.ts— the one rule: an opened file yields exactly the textductus gauge <file>reads (open(path, encoding='utf-8').read()): invalid UTF-8 refused (never�substituted — that would be invented evidence),\r\n/lone\rfolded to\n(Python universal newlines; also what paste does), BOM kept as U+FEFF..txt/.md/.markdown/.textonly; PDF refused with its reason (extracted line breaks and hyphenation would be scored as the writer's); 2 MB cap as a named constant.frontend/README.mdfile table and "Not built",misc/docs/frontend-stack-decision.md"deliberately not built" entry.Behaviour around it (from review)
status: 'error': the text, the reading and the verdict stay as they were, and Read is not re-enabled mid-request.setTextbuilds a fresh editor state, so it is not undoable).Verification
upload.test.ts);tsc --noEmitclean;vite buildclean.ductus-httpserving the build: PDF and Latin-1 files refused with their messages and the current text kept; a CRLF file arrives as LF; Read produces a verdict and highlights; re-opening the same file resets findings; verdict survives a refusal; Open/Sample disabled while a (delayed) read is in flight; replace confirmation shown; no page errors.\v/\f, NUL) against real Python: identical.Pre-existing bug found in review and filed rather than widened here: #11 (highlight offsets are code points, the editor counts UTF-16 units — shifts after any emoji; paste has it too).
Review
Independent adversarial sub-agent review (browser-driven). Findings 1–4, 6, 7 and the empty-state copy fixed here; 5 filed as #11.
Gate: hosted CI (Python workflow + frontend workflow).
🤖 Generated with Claude Code