Skip to content

Rework open paths: action routing, local PDF auto-open, file-access guide (+ PDF save)#5

Merged
enu3379 merged 8 commits into
mainfrom
feature/1-open-ux
Jul 8, 2026
Merged

Rework open paths: action routing, local PDF auto-open, file-access guide (+ PDF save)#5
enu3379 merged 8 commits into
mainfrom
feature/1-open-ux

Conversation

@enu3379

@enu3379 enu3379 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

요약 (Refs #1)

이슈 #1에서 보고된 확장 동작 혼란(뱃지·자동 열기 무반응·Missing PDF)과 기능 요청(새탭 → 뷰어)을 통합 개편하고, 뷰어 PDF 저장 기능을 추가했다.

  • 액션 클릭 라우팅 개편: 빈 새탭 → 빈 뷰어 전환, 비PDF 페이지 → 제자리 + 페이지 내 토스트, 주입 불가 페이지(chrome:// 등) → OS 알림, PDF → 현재 탭 전환, 자기 확장 페이지 → 무동작. 의미 불명 "PDF" 뱃지 제거. content-type 판별은 GET+헤더 수신 즉시 abort 방식.
  • 자동 열기를 로컬까지 확장 (pdf.js 공식 확장과 동일한 3단 구조): DNR 규칙 3 ^file://.*\.pdf$로 파일 액세스 허용 시 커밋 전 무플래시 전환(Windows UNC 포함), 액세스 꺼짐 시 webNavigation 폴백이 뷰어의 권한 안내 화면으로 연결. 자동 열기 토글 OFF면 둘 다 비활성.
  • 뷰어 상태 2종 추가: 파일 접근 권한 안내(설정 페이지 1클릭 + 드래그&드롭 대안) / 파일 없음(MissingPDFException 한정 — 손상 파일은 일반 오류).
  • PDF 저장: 툴바 "저장" 버튼 + Ctrl/⌘S — pdfDocument.getData() 바이트를 blob으로 저장(재다운로드 없음, 신규 권한 없음). 내장 뷰어 대체로 사라졌던 저장 경로 복원.
  • manifest: declarativeNetRequestWithHostAccess 전환, webNavigation·notifications·file:///* 추가.
  • 부수 수리: auto-open 체크박스 상태를 저장값과 동기화, 좁은 창 툴바 글자 꺾임 수정.

설계 문서: docs/issue-1-open-ux.md (원인 분석 → 디자인 결정 → 스펙 → 태스크) / QA 가이드: docs/issue-1-qa.md

QA

  • macOS: 전 항목 통과 (M-1~M-32, 2026-07-09, @enu3379)
  • Windows: 미실시@onetwothr1 리뷰 시 docs/issue-1-qa.md의 W-1~W-33 체크리스트 확인 요청 (UNC 경로·탐색기 더블클릭·콜드 스타트 포함). 이슈 #1의 "Missing PDF" 재현 환경 검증이 특히 중요.

머지 후 이슈 #1 답변·클로즈 예정.

🤖 Generated with Claude Code

enu3379 and others added 8 commits July 9, 2026 00:01
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…le-access guide

- Action click: blank new tab opens the empty viewer, non-PDF http(s) pages
  keep an in-page toast, uninjectable pages fall back to an OS notification;
  the "PDF" badge is removed.
- Auto-open: DNR rule 3 intercepts local file:// PDFs (incl. Windows UNC)
  before commit; a webNavigation fallback routes to the viewer's file-access
  guide while the file-URL toggle is off; both paths respect the auto-open
  setting.
- Viewer: file-access guide and missing-file states; missing-file only on
  MissingPDFException, settings page opens in the current tab.
- Manifest: declarativeNetRequestWithHostAccess, webNavigation, notifications,
  file:///* host permission.
- Docs: design doc (docs/issue-1-open-ux.md), implementation-plan §9 revision,
  Windows loading notes, progress log. Review follow-ups R1-R3 applied.

Refs #1

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Standalone Windows 11 and macOS checklists (setup, expected results,
V1/V2/V4 observation notes) in docs/issue-1-qa.md, linked from the
design doc and progress log.

Refs #1

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replacing Chrome's built-in viewer removed its download path; restore it
in Margin. Saves the exact bytes being viewed via pdfDocument.getData()
-> blob anchor, so it works offline and for drag-and-dropped files with
no new permissions. Original basename kept (.pdf enforced), button
disabled until a document loads, Ctrl/Cmd+S intercepts the browser
save-page dialog. Also stop toolbar text buttons from wrapping
per-character in narrow windows (nowrap + toolbar overflow-x scroll).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Design-only: maps QA feedback onto the planned-but-unbuilt pieces
(mentions/links, manual crop, caption labels) plus new jump rules
(1/8 alignment + flash) and card crop icon. Implementation targets a
separate dev/figure-ux branch after issue #1 merges.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Body reference / hyperref / caption label clicks open the panel card
without moving the text; the card jumps to the figure and mention chips
jump to sentences, with the originating chip pinned as the return path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@enu3379
enu3379 requested a review from onetwothr1 July 8, 2026 16:06
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 37b816e2-fa47-40f9-93a4-e55015dd497b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/1-open-ux

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d9cd411ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sw.ts
try {
const response = await fetch(url, {
method: 'HEAD',
method: 'GET',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid issuing a separate GET before opening PDFs

When the current tab is a PDF served by a signed or one-time download URL such as /download?token=... that is not matched by isPdfLikeUrl, this probe performs a credentialed GET and then opens the viewer, where host.loadUrl fetches the same URL again. Aborting after headers does not prevent the server from marking the first GET as consumed, so the viewer can end up with a 403 or missing-PDF error for links that previously opened. Please avoid a separate consuming request, or reuse the fetched response, for this detection path.

Useful? React with 👍 / 👎.

@enu3379
enu3379 merged commit 965bb46 into main Jul 8, 2026
3 checks passed
@enu3379
enu3379 deleted the feature/1-open-ux branch July 8, 2026 16:50
enu3379 added a commit that referenced this pull request Jul 8, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
enu3379 added a commit that referenced this pull request Jul 13, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
enu3379 added a commit that referenced this pull request Jul 13, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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