Skip to content

[codex] Add close file menu item - #250

Merged
alecmocatta merged 1 commit into
mainfrom
codex/close-active-document-menu
Jun 29, 2026
Merged

[codex] Add close file menu item#250
alecmocatta merged 1 commit into
mainfrom
codex/close-active-document-menu

Conversation

@samuelstroschein

@samuelstroschein samuelstroschein commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a native File > Close File menu item.
  • Send a workspace close-file event from Electron to the renderer.
  • Close the active central file tab from the shell when that native command fires.

Validation

  • ./node_modules/.bin/vitest run src/shell/layout-shell.test.tsx
  • ./node_modules/.bin/vitest run src/extensions/files/index.test.tsx
  • ./node_modules/.bin/tsc -p . --pretty false
  • node --check electron/main.mjs && node --check electron/preload.mjs
  • git diff --check HEAD~1..HEAD

Note

Low Risk
Desktop menu and renderer tab-close wiring only; reuses existing close-view logic with no auth or persistence changes beyond menu refresh.

Overview
Adds a native File > Close File action on desktop, wired the same way as New File: the main process focuses the target workspace window and sends workspace:closeFile to the renderer.

The menu item is enabled only when that window has an active document (tracked via activeFilePathsByWindowId), and the app menu is refreshed when the active file path changes so the control stays in sync. Preload and desktop types expose onCloseFile for the shell.

V2LayoutShell subscribes to that event and closes the active central tab through the existing handleCloseView path. A layout-shell test covers the native close flow.

Reviewed by Cursor Bugbot for commit 5343935. Bugbot is set up for automated code reviews on this repo. Configure here.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
flashtype-website 5343935 Commit Preview URL

Branch Preview URL
Jun 29 2026, 10:34 PM

@samuelstroschein
samuelstroschein marked this pull request as ready for review June 29, 2026 22:29
@samuelstroschein
samuelstroschein force-pushed the codex/close-active-document-menu branch from d7d481e to 3c33117 Compare June 29, 2026 22:31
@samuelstroschein
samuelstroschein force-pushed the codex/close-active-document-menu branch from 3c33117 to 5343935 Compare June 29, 2026 22:33
@samuelstroschein samuelstroschein changed the title [codex] Add close active document menu item [codex] Add close file menu item Jun 29, 2026
@alecmocatta
alecmocatta merged commit a13679a into main Jun 29, 2026
8 checks passed
@alecmocatta
alecmocatta deleted the codex/close-active-document-menu branch June 29, 2026 22:56
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