Skip to content

fix(editor): make Ctrl/Cmd+S save from inside the embedded editor - #126

Merged
erseco merged 1 commit into
fix/viewer-lifecyclefrom
fix/editor-ctrl-s
Sep 26, 2026
Merged

erseco merged 1 commit into
fix/viewer-lifecyclefrom
fix/editor-ctrl-s

Conversation

@erseco

@erseco erseco commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Stack 3/5, based on #125.

What

The bridge injected by EditorHtmlService swallows Ctrl/Cmd+S and posts REQUEST_SAVE to the parent, but nothing in the view page listened, so the shortcut did nothing. EditorEmbed now re-emits it as save-requested, and ElpxViewPage runs the same save() as the button, guarded by canShowSaveButton and an in-flight save.

No component test: Vitest has no Vue plugin configured. The wiring is two lines, and PR 5 covers the EditorFrame.onMessage path it relies on.

Verification

composer install                 exit 0
npm install                      exit 0
npm run typecheck                exit 0
npm test                         Tests 123 passed (123)
npm run lint                     exit 0
npm run build                    ✓ built
make architecture-check          Architecture records OK — 3 records, 0 changes.
make -n download-editor … typecheck   exit 0
vendor/bin/phpunit               OK (116 tests, 328 assertions)
composer cs:check                Found 0 of 32 files that can be fixed
git diff --check                 clean

The injected bridge swallows the shortcut and posts REQUEST_SAVE to the
parent, but nothing in the view page listened, so the keystroke was a
no-op. EditorEmbed now re-emits it as save-requested and ElpxViewPage
runs the same save as the button, guarded by writability and an
in-flight save.
@github-actions

Copy link
Copy Markdown
Contributor

Preview this PR in the Nextcloud Playground

Open this PR in the Nextcloud Playground

A fresh Nextcloud boots in your browser with this branch's exelearning app installed and enabled (log in as admin / admin). Two sample .elpx are seeded under exelearning-samples/ in Files — click one to open the viewer.

eXeLearning editor: v4.0.5 (overlaid at boot from the upstream release).

@erseco
erseco added this pull request to stack #130 September 26, 2026 06:14
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.79%. Comparing base (cb54da0) to head (afc90bf).

Additional details and impacted files
@@                   Coverage Diff                   @@
##             fix/viewer-lifecycle     #126   +/-   ##
=======================================================
  Coverage                   93.79%   93.79%           
  Complexity                    152      152           
=======================================================
  Files                          22       22           
  Lines                         661      661           
  Branches                       54       54           
=======================================================
  Hits                          620      620           
  Misses                         34       34           
  Partials                        7        7           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erseco
erseco merged commit b591b68 into main Sep 26, 2026
16 checks passed
@erseco
erseco deleted the fix/editor-ctrl-s branch September 26, 2026 06:44
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