Skip to content

feat(file-explorer): rich viewers, search inside documents, find-in-document, markdown editing - #4650

Closed
isaaclam678 wants to merge 1 commit into
kirodotdev:mainfrom
isaaclam678:feat/files-app-viewers
Closed

isaaclam678 wants to merge 1 commit into
kirodotdev:mainfrom
isaaclam678:feat/files-app-viewers

Conversation

@isaaclam678

@isaaclam678 isaaclam678 commented Aug 20, 2026 •

Copy link
Copy Markdown

Problem / Motivation

In the Files app, anything that is not text or markdown is a dead end: FileViewer renders an EmptyState with apps.fileExplorer.fileViewer.binary_file. Opening a .docx, .xlsx, .pptx, .pdf, or an image shows that placeholder, folder search never looks inside those files, markdown is read-only, and the Download button builds its blob from fileData.content without checking fileData.binary — so downloading a binary yields a corrupt, effectively empty file.

This implements issue #4648.

Why it matters

The app's own manifest sells it as the way to read files on the gateway host, but the file types most work actually arrives in are exactly the ones it cannot show. A user has to leave the dashboard, and the binary download is silently broken rather than merely absent.

What changed (motivation → approach → change)

Viewers. Goal: render real documents in place. The dashboard already has viewers in website/src/components/FileRenderers.tsx, but git grep FileRenderers -- website/src/apps/ returns zero hits: they are wired to the dashboard's own file surface, not to this app. This adds website/src/apps/file-explorer/viewers.tsx for the app's surface. That is duplication of capability across two surfaces and a fair consolidation target; unifying them is a larger refactor of both call sites and is deliberately not attempted here.

Office extraction — corrected rationale. An earlier revision of this description claimed the parsing libraries had been rejected as undeclared optional dependencies. That was false: openpyxl>=3.1,<4, python-docx>=1,<2 and pdfplumber>=0.10,<1 are all declared in setup.cfg, and the First Principles review was right to block on it. The actual reason for office_extract.py is output shape, not dependency availability: kiro_crew.doc_parser yields plain text, and api_file_office_preview is likewise plaintext-only with xlsx explicitly unsupported. A viewer needs structure — docx blocks, an xlsx cell grid, pptx shapes with their real colours, positions, and embedded images. Extending doc_parser to return structured blocks was the alternative; it would change a contract other callers depend on, so the structured extractor is separate, with its own caps (MAX_XLSX_*, MAX_PPTX_SLIDES, MAX_ZIP_MEMBERS).

Search inside documents. api_file_search is filename search for the @-mention picker, and the app's own /search dispatches only rg/python text engines, so no existing path looks inside a document. Adds _search_documents with a text cache and time/file caps.

Markdown editing. POST /write, markdown-only, size-capped, atomic (os.replace) under a write lock, SEL-audited, with a base-token conflict guard modelled on md-notebook's.

The conflict token is a string. It carries a nanosecond mtime (~1.7×10¹⁸), past the exact-integer range of the double a JSON number parses into (2^53−1). Emitted as a number it rounded in the browser, returned changed, and the exact-match guard then rejected every save with 409 — markdown editing could never have worked in a real browser. It is now an opaque string end to end. The comparison is also a string compare: the previous int() parse sat inside try/except ValueError: pass, so a malformed token skipped the guard entirely.

Download fix. /raw?download=1 streams real bytes with an RFC 6266 Content-Disposition built by a CRLF-safe helper.

Manifest and locales — declared. The manifest's highlight_* strings described a read-only viewer, so they are rewritten, in en.json and all 12 other catalogs. An earlier revision of this description called the locale manifests untouched; that was the second false claim the First Principles review caught. use_case_1 and configuration_1 are retained from main.

localStorage — declared. One thing persists: MarkdownEditor's recovery stash, which parks typed text when a switch-time flush fails so the next edit can recover it. Per-file scroll memory is deliberately in memory only, adopting the reasoning in website/src/hooks/useScrollMemory.ts — a persisted pixel offset restores into whatever the file contains next time, and a file can be rewritten between visits.

Changed in this revision (rebase onto main)

  • Rebased onto main (the branch was 2,355 commits behind); resolved FileViewer.tsx, api.ts and 10 locale catalogs.
  • Dropped FileExplorerApiError in favour of main's ApiError/toApiError (landed since in website/src/api/apiError.ts), which has the same status-carrying purpose.
  • Adopted main's shared FilePathMenu (revealOrOpen, useRevealLabel, useCanOpenFile) and deleted this PR's own revealFile, removing two alert() calls and four now-dead i18n keys.
  • Renamed useScrollMemory → useFileScrollMemory: main now has a hook of that name for side-panel tabs, and two same-named hooks with different identities is a trap.
  • Blocking review findings fixed: the PDF fallback no longer reopens a user-derived path outside the read gate (it was also unreachable, since pdfminer arrives with the declared pdfplumber); the HTML preview document now carries a default-src 'none' CSP, because sandbox="" blocks scripts but not passive subresource loads; and the symlink-escape test no longer writes outside its own tmp_path.

Tests

  • test/test_file_explorer_viewers.py, test/test_file_explorer_proxy_auth.py, test/test_file_explorer_app.py — 172 passed, 1 skipped. New this revision: a tripwire asserting PDF search never reaches a path-based reader; the conflict token is emitted as a string and round-trips; an unmatched token returns 409 instead of failing open.
  • website/src/test/fileExplorerViewers.test.tsx + the api/page coverage suites — 123 passed, including four asserting the preview CSP lands inside the head, before the head's content, without disturbing the doctype, and opens nothing but inline styles and data: images.
  • npx tsc --noEmit clean; eslint clean on the touched tree; flake8, isort, mypy clean on the touched backend.

Manual verification

Backend endpoints, extraction, the write guard and the viewers are covered by the suites above. Still outstanding: this has not been re-exercised in a running dashboard since the rebase — the merge with main's FilePathMenu changed the viewer's overflow menu, so the Open/Reveal items and the CSP'd HTML preview want a click-through before merge. I would rather say that than imply verification I have not done.

Screenshots / video

Outstanding, and it currently blocks two checks. This is a user-visible UI change, so the template requires media and I have not captured it. Being explicit rather than omitting it silently: the surfaces needing shots are the office/pdf/image/media viewers, the find-in-document bar, markdown edit mode and its status states, the Preview/Source and Table/Source toggles, xlsx sheet tabs, and the pptx slide canvas — each in light and dark. The dark-theme find highlight needs one specifically, since ::highlight hardcodes rgba(255,213,79,.5) with forced #1a1a1a text.

The repo's own scripts/capture-*.mjs harness is the right way to produce these (real built SPA, /api/** stubbed from fixtures). I could not run it here: website/dist will not build in this worktree because tsc -b fails on missing storybook dev-dependencies and vite then fails on an absent @excalidraw/excalidraw/dist/prod/fonts — both local node_modules gaps, unrelated to this diff (tsc --noEmit and the test suites pass). Repairing that install is the next step before this section can be filled.

On the edit ↔ view transition (lens 13)

Raised by the UX review, and answered here rather than left implicit. The Edit toggle deliberately swaps the rendered document for a plain textarea instead of morphing one element, because the two states are not the same object presented differently: one is rendered output, the other is the source that produced it. Every markdown editor in this class (the dashboard's own md-notebook among them) switches panes rather than animating glyphs into their source, and a crossfade between "rendered heading" and "## heading" would suggest a continuity that does not exist.

That is the stated reason the rule asks for; it is not a claim that the recording is unnecessary. The recording lens 13 requires is part of the outstanding media above.

@isaaclam678
isaaclam678 requested review from a team August 20, 2026 07:23
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Aug 20, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

2 similar comments
@iamwhatever

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@bolichen97

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 20, 2026
@isaaclam678
isaaclam678 force-pushed the feat/files-app-viewers branch from 7a504fb to ec9c279 Compare August 20, 2026 10:41
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 20, 2026
@isaaclam678
isaaclam678 force-pushed the feat/files-app-viewers branch from ec9c279 to f2c077b Compare August 20, 2026 11:26
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 20, 2026
@isaaclam678
isaaclam678 force-pushed the feat/files-app-viewers branch from f2c077b to 7f9a653 Compare August 20, 2026 12:02
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 20, 2026
@isaaclam678
isaaclam678 force-pushed the feat/files-app-viewers branch from 7f9a653 to 485726e Compare August 20, 2026 12:50
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Aug 20, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) August 24, 2026 06:58
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Aug 26, 2026
@chenmingwei23 chenmingwei23 added the needs-pr-triage PR scanner: awaiting automated triage label Aug 29, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: bolichen97#bb3ad1ca]: This PR has been inactive for 7+ days with failing CI. I reviewed the blockers but they require your input:

  • First Principles Review is a hard BLOCK at the premise level: it found two load-bearing description claims to be false (the "rejected" parsing libraries are already declared deps, and the "untouched" locale manifests are rewritten in all 12 catalogs). Correcting this needs your restatement of the PR's actual scope and approach — automation must not rewrite your design rationale.
  • GPT 5.6 BLOCKING findings involve security-policy choices (whether to remove the PDF path fallback vs parse only gated bytes; what CSP to impose on the sandboxed HTML preview) rather than purely mechanical fixes.
  • The branch also has a merge conflict with main and, at +4467 lines, exceeds what the pipeline will drive unattended.

When you've addressed these, the pipeline will re-assess on its next cycle.

@bolichen97

Copy link
Copy Markdown
Contributor

Audit note — part of this has already landed; the rest has not

This PR is not a duplicate and is not finished by anything on main. The audit checked it part by part against main, and some of what it does is already there. Flagging it so a reviewer does not have to rediscover the overlap, and so the PR is not mistaken for fully-covered work.

Already landed

All 7 sha-form relation targets are real commits and confirmed ancestors of origin/main (git cat-file -t + git merge-base --is-ancestor): bd42c60 'feat(files): render xlsx spreadsheets inline in the file viewer (#3875)' 2026-08-18; 737ab0c 'feat: KiroClaw dashboard + Electron desktop app (frontend)' 2026-06-02; e434f97 'feat(files): play video and audio inline in the file viewer (#4027)' 2026-08-17; e4be4dc 'fix(apps): give four app API clients a typed error instead of a bare Error' 2026-08-30; 8045234 'fix(md-notebook): retry contended saves without data loss (#4899)' 2026-08-26; 21b180f 'feat(files): file-open context menu with reveal/open + copy-path fallback (#2398)' 2026-09-01; 5e2234e 'fix(dashboard): remember side-panel document scroll across chat-slot switches (#5723)' 2026-08-24. No the initial scan 'merged' claim in the relations list turned out to be an open PR. Corrections to the initial scan's UNRESOLVED refs, now that the issue/PR reference check is populated (it was 0 bytes in the initial scan): #4648 is an ISSUE, state open ('Files app: view PDFs/Office/media in place, search inside documents, and edit markdown') -- it is the feature request this PR implements, carries no code, can never cover anything, and its still-open state corroborates that the capability is unlanded. #4649 is a PR, closed, merged_at '-' => NEVER MERGED (withdrawn), matching the body. #4377 is a PR, merged 2026-08-18T19:02:17Z, landed as 264c7d2 'test(apps): ratchet against decoded proxy-target reconstruction in backends (#4377)', and git merge-base --is-ancestor confirms it is already inside this PR's own merge base fc32364 (2026-08-19), so the body's claim checks out. #7544 is an OPEN PR (the open-PR list, merged column '-'), so it cannot cover anything. Not stacked: git log fc32364..pr/4650 is the single commit d9219c9.

Which parts main already has

Exactly one part of the PR is genuinely superseded on main: the typed API error. website/src/apps/file-explorer/api.ts on main (via e4be4dc) already reads import { toApiError } from '../../api/apiError' with if (!r.ok) { throw await toApiError(r) }, and website/src/api/apiError.ts exports class ApiError extends Error { readonly status: number; readonly body: string; readonly authRequired: boolean } plus friendlyErrText and toApiError. That is the same file and the same stated motivation as the PR's export class FileExplorerApiError extends Error { status: number } ('so callers can tell a 409 write conflict apart'), so the class is dead weight after rebase.

Everything else the initial scan counted as coverage is the SAME CAPABILITY ON A DIFFERENT SURFACE -- the dashboard file viewer -- not on the file-explorer builtin app this PR changes. Verified present on main, and verified NOT reachable from the app: (a) xlsx grid = api_file_sheet (src/kiro_crew/dashboard/handlers/files.py:4293) + SheetViewer in website/src/components/FileRenderers.tsx, backed by the DECLARED openpyxl>=3.1,<4 at setup.cfg:55 (python-docx:62, pdfplumber:63 too) -- so the PR body's rationale for hand-rolling ('optional runtime deps here, not declared ones') is factually false, and the First Principles BLOCK on that premise is correct; (b) viewer components = FileRenderers.tsx exports detectFileType, ImageViewer, SvgViewer, CsvViewer, JsonViewer, JsonlViewer, HtmlViewer, PdfViewer, OfficeViewer, MediaPlayer, SheetViewer -- same names and jobs as the PR's new website/src/apps/file-explorer/viewers.tsx; (c) inline media = api_file_raw:2491, api_file_stream:2646 (Range-capable), api_file_download:2153; (d) guarded markdown write = api_file_write:2898 and md_notebook's baseMtime->409->os.replace guard (8045234); (e) find-in-document over CSS.highlights = an inline private implementation in website/src/components/MarkdownPanel.tsx (findRangesRef + CSS.highlights); (f) a hook literally named useScrollMemory = website/src/hooks/useScrollMemory.ts (5e2234e), in-memory only, MAX_ENTRIES=500, whose docstring argues explicitly AGAINST localStorage. These are real duplication/consolidation findings, but git grep FileRenderers origin/main -- website/src/apps/ returns ZERO hits and main's app FileViewer.tsx:27-28 still renders EmptyState ... 'apps.fileExplorer.fileViewer.binary_file', so a Files-app user gains nothing from any of them today.

What is still genuinely yours

Backend, all absent from origin/main (git ls-tree origin/main -- src/kiro_crew/apps/builtins/file_explorer/ lists only init.py, app.json, server.py): the entire 690-line office_extract.py (extract_structured, media_member, _extract_docx/_extract_xlsx/extract_pptx, OfficeExtractError, theme-colour + EMU-transform resolution, MAX_XLSX* / MAX_PPTX_SLIDES / MAX_ZIP_MEMBERS caps) -- main's doc_parser.py only yields PLAIN TEXT from docx/pptx/pdf, a different output shape, and api_file_office_preview is likewise plaintext-only with xlsx explicitly unsupported; GET /raw (_h_raw, MAX_RAW_BYTES, inline allow-list, download=1), GET /extract (_h_extract, ?member= media streaming), POST /write (_h_write, _locked_write, _WRITE_LOCK, base_mtime/base_token 409 guard) and do_POST itself -- main's handler has only do_GET and _dispatch routes /resolve /tree /read /search /git-status /complete with no POST arm; the _disposition() CRLF-safe RFC 6266 helper; the body-bound proxy signature (main's _authorized_or_health(self, method) still hardcodes body=b""); search inside documents (_search_documents, _doc_text_units, _pdf_text_units, _DOC_TEXT_CACHE, MAX_DOC_SEARCH_FILES, DOC_SEARCH_TIMEOUT_SEC) -- this capability exists NOWHERE on main, since main's api_file_search is fuzzy FILENAME search for the @-mention picker and the app's _search dispatches only rg/python text engines; mtime_ns in the /read body; the 14 BINARY_EXTS additions (.docx/.xlsx/.pptx/.doc/.xls/.ppt/.key/.numbers/.pages/.m4a/.flac/.aac/.ogg/.m4v -- none of those literals are in main's server.py); app.json still at "version": "1.0.0" with "It is read-only by design" and "Read-only: opens and searches files...".

Tests: test/test_file_explorer_viewers.py (1087 lines) and test/test_file_explorer_proxy_auth.py (58) are ABSENT; main's test/test_file_explorer_app.py:854 still pins test_app_is_read_only_get_routes_only asserting no do_POST/do_PUT/do_DELETE/do_PATCH -- the invariant this PR deliberately relaxes; website/src/test/fileExplorerViewers.test.tsx (614) ABSENT.

Frontend, absent from website/src/apps/file-explorer/ on main (git ls-tree shows FileExplorerPage/FileViewer/PathBar/SearchPanel/TabStrip/TreeNode/api/constants/hooks/styles/types/utils only): viewers.tsx, SlideCanvas.tsx, findInDocument.tsx (exported reusable findRanges/useFindInDocument/FindBar), MarkdownEditor.tsx (useMarkdownEditor debounced autosave + localStorage recovery stash), useScrollMemory.ts (per-absolute-path localStorage, SCROLL_STORAGE_KEY, MAX_REMEMBERED_FILES=300 -- main's same-named hook has the OPPOSITE persistence policy, so this is a collision, not coverage). Also absent: api.ts rawUrl/extract/extractMemberUrl/write; constants.ts AUDIO_EXTS/VIDEO_EXTS/OFFICE_EXTS/MARKDOWN_EXTS/SCROLL_STORAGE_KEY; types.ts DocxBlock/XlsxSheet/PptxRun/PptxParagraph/PptxShape/PptxSlide/OfficeExtract/WriteResult.

The empty-blob binary-download bug is STILL LIVE on main: FileExplorerPage.tsx's downloadFile is byte-identical to the PR's pre-image (blob built from fileData.content with an atob branch, no fileData.binary check).

i18n: apps.fileExplorer on main has exactly [fileExplorerPage, fileViewer, manifest, pathBar, searchPanel, tabStrip, treeNode] -- no find, editor, or viewers subtrees; manifest.highlight_1 is still 'Read-only: opens and searches files...'. All 13 catalogs unlanded.

Suggested action: CONTINUE_DEV — the remainder is real work; rebase onto the landed part rather than closing.


From a repository-wide duplicate/overlap audit of every pull request open against main (2026-09-02, 330 PRs, one reviewer per PR). Each PR was read as its full merge-base diff plus its description and every comment and review, then compared against each candidate PR's own diff and against origin/main at 1a765b88ceb7. This PR is not being closed — the note is informational. If the reading is wrong, please correct the reasoning rather than just the conclusion.

@bolichen97

Copy link
Copy Markdown
Contributor

Open PR relationship audit

This is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion.

Relationship findings

  • PR #7544 is OVERLAPPING relative to this PR. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #7544: KEEP. Complementary, not competing: PR #4650 does not pin any encoding and leaves the three defective spawns as-is, so landing it would not fix this defect and would leave the file's baseline row intact. Only cross-reference recorded on PR #7544's timeline. Files: src/kiro_crew/apps/builtins/file_explorer/server.py.
  • This PR is PARTIALLY_COVERED with PR #7074. Coverage is explicitly incomplete; this finding is not a completion or closure claim. Recommended action for PR #4650: CONTINUE_DEVELOPMENT. Drop FileExplorerApiError and consume main's ApiError/toApiError; the rest of the PR is untouched by PR #7074. Files: website/src/apps/file-explorer/api.ts.

No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit.

auto-merge was automatically disabled September 6, 2026 13:14

Head branch was pushed to by a user without write access

@isaaclam678
isaaclam678 force-pushed the feat/files-app-viewers branch from d9219c9 to 239cd09 Compare September 6, 2026 13:14
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 6, 2026
@isaaclam678
isaaclam678 force-pushed the feat/files-app-viewers branch from 239cd09 to d156664 Compare September 6, 2026 13:33
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 6, 2026
…-in-document, reading memory, markdown editing

The Files app previously rendered markdown, small base64 images, and
code fences; every other file type showed a dead 'Binary file'
placeholder, folder search could not see inside documents, and
downloading a binary file silently saved an empty blob.

Backend (server.py + new hardened office_extract module):
- GET /raw streams bytes with the real Content-Type (inline only for
  image/audio/video/PDF; everything else forced to attachment; 64 MB
  cap, nosniff, SEL-audited).
- GET /extract returns structured Office content — docx as ordered
  heading/paragraph/table blocks, xlsx as per-sheet value grids with
  shared strings and cached formula values resolved, pptx as
  positioned shapes with theme-resolved colours, run formatting,
  embedded image references (?member= streaming, media folders only),
  and per-slide plain-text fallback lines. office_extract mirrors
  doc_parser's security posture: defusedxml only, actual-decompressed-
  size caps per ZIP member, bounded member counts.
- /search adds a document pass finding words inside docx/xlsx/pptx/PDF
  with labelled previews ([slide 3], [Sheet1 r12], [p2]); pdfminer
  when available with doc_parser's hardened scan as fallback; results
  cached by (path, mtime, size); time-budgeted; never breaks plain
  text search.
- POST /write saves markdown edits — markdown only, no create, 4 MB
  cap, atomic replace, SEL-audited, base_mtime returning 409 when the
  file changed on disk. do_POST reads the body before auth so the
  proxy HMAC is verified over the exact payload bytes; the signed
  target stays self.path verbatim per the proxy-target ratchet.
- The read-only invariant test (kirodotdev#16) is sharpened rather than removed:
  no PUT/DELETE/PATCH, POST dispatches only /write, and /write stays
  markdown-only, no-create, audited.

Frontend (website/src/apps/file-explorer):
- Viewer type-router: PDFs and images inline via /raw, HTML in a
  sandboxed live preview with source toggle, CSV/TSV as tables,
  audio/video players, working downloads for remaining binaries.
- Office documents render structurally; PowerPoint as true-aspect
  slide canvases (background colour, positioned shapes, cqw-scaled run
  colour/weight/size, embedded images, auto-contrast).
- Find-in-document (⌘F when a file is open): CSS Custom Highlight API
  painting with graceful degradation, match count, keyboard nav.
- Reading-position memory per file via localStorage (capped, debounced,
  retry-based restore for async layout).
- Markdown editing with 1.2s debounced auto-save, dirty-flush on file
  switch, and 409 surfaced as 'file changed on disk'.
- All new strings through i18n, translated into every locale catalog.

Tests: 46 backend (synthetic in-test OOXML/PDF fixtures — no binary
files checked in) and 32 frontend component/api tests; all six
existing file-explorer vitest suites stay green.
@bolichen97

Copy link
Copy Markdown
Contributor

@isaaclam678 Thanks for keeping this alive, and for the self-corrections in the body. We audited it against main at head 80dcdc2.

Only one piece of your original scope has landed: the typed API error. #7074 merged as e4be4dc04, adding website/src/api/apiError.ts, and it is an ancestor of your merge base, so website/src/apps/file-explorer/api.ts already consumes toApiError. Nothing left to reconcile there.

Everything else is still absent from main, so this should not be closed: src/kiro_crew/apps/builtins/file_explorer/office_extract.py does not exist there, server.py has no do_POST and no /raw, /extract or /write route and no _search_documents, and website/src/apps/file-explorer/ has none of viewers.tsx, SlideCanvas.tsx, findInDocument.tsx or MarkdownEditor.tsx. FileViewer.tsx on main still returns the binary_file empty state, and the empty-blob binary download is still live.

Please narrow and rebase before review:

  1. Rebase: roughly 170 commits behind, and the 13 locale catalogs plus website/eslint.i18n.config.js have moved.
  2. MAX_RAW_BYTES at 64 MiB exceeds the 50 MiB cap in safe_read_file_bytes with no FileTooLargeError handler, so 50 to 64 MiB media returns 500.
  3. use_case_1 in all 13 catalogs still promises "without granting the page write access" while you now ship POST /write.
  4. Adopt the sldIdLst slide ordering from fix: extract pptx text in presentation order #9235 in office_extract._extract_pptx; it removes the filename-number sort you reintroduce.
  5. Screenshots and the recording still block two checks.

Consider splitting the viewers from the markdown write path so the write posture change is off the critical path. Open #7544 edits server.py on different lines, so coordinate that rebase.

Posted from the 2026-09-08 open-PR relationship audit (read-only, one auditor per PR); reply here if any of this is wrong.

@iamwhatever

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: iamwhatever#241cc860]: Closing this as part of a maintainer-requested stale-PR cleanup.

The blocker here is scope, not merit. At +4813/-140 across 34 files this is beyond what can be reviewed and driven to green as a single change, and it has carried needs-author-decision since 2026-08-29 with no author activity since 2026-08-21.

Three things need your decisions before it could move: the premise-level First Principles block, the GPT security-policy blockers (the PDF path fallback and the HTML-preview CSP), and the new write posture introduced by POST /write.

The feature itself is still wanted — #4648 stays open. The most direct path is to re-open this as two smaller PRs:

  1. Viewers, in-document search, and the binary-download fix, with no change to write access.
  2. Markdown editing via POST /write, on its own, so the write posture can be reviewed independently.

Split that way, the first should be reviewable quickly, and the second gets the focused security discussion it needs.

Thank you for the contribution, and for the care that went into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) needs-author-decision PR blocked on author input

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants