8000 Add Save and Save As buttons to the tab bar by DominikPalo · Pull Request #22 · DominikPalo/OOXML-Toolkit · GitHub
[go: up one dir, main page]

Skip to content

Add Save and Save As buttons to the tab bar - #22

Merged
DominikPalo merged 5 commits into
mainfrom
feature/save-button
Oct 7, 2026
Merged

DominikPalo merged 5 commits into
mainfrom
feature/save-button

Conversation

@DominikPalo
@DominikPalo DominikPalo commented Oct 7, 2026 •
Copy link
Copy Markdown
Owner

What

Adds a Save split button to the tab bar, next to Compare.

  • Save runs the same command as File → Save / ⌘S / Ctrl+S (dispatchCommand(COMMANDS.save.id)), so Inspector drafts are committed first and the malformed-XML confirmation still applies. It is enabled only while the active document has unsaved changes (including an uncommitted Inspector draft); otherwise it is dimmed with the tooltip "No unsaved changes".
  • The arrow next to it opens a small menu with Save and Save As… (with their shortcuts). Save As… stays enabled on a clean document, so you can still save a copy.
  • Neither is shown on the welcome screen or on Compare tabs.
  • In browser mode (dev:web) Save behaves like ⌘S there: it downloads the file.

Why

Saving was only reachable through the native File menu or the keyboard shortcut. The only on-screen hint of unsaved edits was passive (the dot on the tab, the count in the status bar).

Notes for review

  • Code: TabBar.tsx (new SaveButton), a small optional at anchor on useContextMenu().open in ContextMenu.tsx, and styles in app.css (split button; .ctx opts out of the tab bar's window-drag region because the menu overlaps it by a few pixels).
  • e2e/demo.mjs: the Compare button is now selected by role and name (the old .tabbar-actions .btn-ghost matched the new buttons too — thanks to the Codex review). I also made the script quit explicitly after the window closes: since Preserve Inspector drafts across save and close commands #19 closing always goes through the renderer, which cancels Playwright's app.quit(), and on macOS the app then outlives its last window, so npm run demo hung and timed out. This was independent of this PR but blocked regenerating docs/demo.gif.
  • The last commit only regenerates docs/screenshots/* and docs/demo.gif (every image with a document open includes the tab bar). It can be skipped when reviewing the code.
  • In anatomy.png the tab-bar buttons take a bit more room, so the last visible tab is cut off slightly earlier.

Testing

  • npm run typecheck and npm test (185 tests) pass.
  • Checked in the browser build: Save disabled on a clean document and enabled after an edit; a click on a malformed edit shows the "not well-formed XML" dialog; the menu opens under the arrow, Save is dimmed when clean, and Save As… calls the host's save-as; layout holds at 520px wide.
  • npm run screenshots and npm run demo run end to end on macOS (Electron + Playwright).
  • Not tested: the native save dialog in Electron, and Windows/Linux.

🤖 Generated with Claude Code

DominikPalo and others added 2 commits October 7, 2026 13:27
Saving was only reachable through File → Save or the shortcut, and the only
sign of unsaved edits was passive (tab dot, status bar). The tab bar now has a
Save button next to Compare. It runs the same command as Cmd/Ctrl+S, so
Inspector drafts are committed first and the malformed-XML check still applies,
and it is enabled only while the active document has unsaved changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Oct 7, 2026 •
Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T11:29:40.948631Z deeaeeb PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: deeaeeb671

ℹ️ 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/renderer/src/components/TabBar.tsx Resolved
DominikPalo and others added 3 commits October 7, 2026 13:47
The Save button is now a split button; its arrow opens a menu with Save and
Save As… (with their shortcuts). Save As… stays enabled when the document has
no unsaved changes, so a clean file can still be copied. The menu reuses the
context menu, which gained an optional anchor position so it opens under the
arrow, and opts out of the tab bar's window-drag region.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The demo found the Compare button with '.tabbar-actions .btn-ghost', which now
matches the Save buttons too and fails Playwright's strict locator; select it
by role and name like the other e2e scripts. Also quit explicitly once the
window has closed: closing goes through the renderer, which cancels
app.quit(), and on macOS the app then outlives its last window, so
app.close() never returned and the recording timed out.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@DominikPalo DominikPalo changed the title Add a Save button to the tab bar Add Save and Save As buttons to the tab bar Oct 7, 2026
@DominikPalo
DominikPalo merged commit 4726a0a into main Oct 7, 2026
1 check passed
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

0