Skip to content

fix(studio): retain file handle on Ctrl+S for opened documents#189

Open
ahnbu wants to merge 1 commit intoedwardkim:develfrom
ahnbu:pr/task179
Open

fix(studio): retain file handle on Ctrl+S for opened documents#189
ahnbu wants to merge 1 commit intoedwardkim:develfrom
ahnbu:pr/task179

Conversation

@ahnbu
Copy link
Copy Markdown

@ahnbu ahnbu commented Apr 18, 2026

Summary

  • prefer showOpenFilePicker() when opening a document so rhwp-studio can retain the original file handle
  • reuse the existing file handle on Ctrl+S and only fall back to save picker or download when no handle exists
  • add focused tests for the new file-system access helper

Root Cause

The previous open flow used <input type="file">, which only exposes File.name and not the original writable handle. As a result, Ctrl+S always had to open a save dialog and the browser defaulted to its own last-used folder.

Verification

  • docker compose --env-file .env.docker run --rm wasm
  • npm run build
  • node --experimental-strip-types --test tests/file-system-access.test.ts
  • Browser smoke check on http://127.0.0.1:7700
    • opened a real .hwp file via showOpenFilePicker
    • Ctrl+S saved back to the same file
    • a new document still opened the save picker as fallback

Note

This is a clean replacement for the previously closed #180, scoped strictly to Ctrl+S file handle retention.

Closes #179.

- showOpenFilePicker로 연 파일 handle을 보관하고 Ctrl+S 시 같은 파일에 바로 덮어쓰기
- handle이 없는 input 파일 열기 경로는 save picker와 download fallback 유지
- file-system-access 유틸과 단위 테스트 추가

Co-Authored-By: Codex <noreply@openai.com>

# Conflicts:
#	rhwp-studio/src/command/commands/file.ts
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