feat: Add to Drive action in the editor (wire up the Drive integration)#23
Merged
Conversation
…ion)
The Drive integration (register a diagram as a Drive link file) existed as backend
plumbing but had no caller — nothing in the UI triggered it, so it couldn't be used
or tested from the app. This wires it up:
- api/drive_integration.py: new whitelisted is_available() -> {installed, ready}
so the editor can show the action only when Drive is installed AND set up (a team
exists).
- toolbar/DriveMenu.vue: an "Add to Drive" button that appears only when ready;
clicking registers the diagram (idempotent) and toasts success with an "Open
Drive" action. Hidden entirely when Drive is absent.
- toolbar/TopToolbar.vue: place it between Export and Share.
- test: is_available() returns the status booleans without raising, Drive or not.
Verified in the running app (Drive installed): button appears, click registers a
Drive Link file at /draw/d/<name> ("Drawing 15" -> /draw/d/drawing-15). Server
tests: 10 pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Confidence Score: 5/5Safe to merge — new backend endpoint is well-guarded and the frontend component degrades gracefully when Drive is absent. The change is narrowly scoped: a new read-only availability check, a small Vue component that fails closed, and a test covering the no-Drive path. No data mutation happens without user action and all error paths return cleanly. No files require special attention. Reviews (2): Last reviewed commit: "Address review: cache drive_installed() ..." | Re-trigger Greptile |
Avoid calling drive_installed() twice; use a local. (per Greptile P2) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The optional Frappe Drive integration (register a diagram as a Drive link file) existed as backend plumbing but had no caller — nothing in the UI triggered it, so it couldn't be used or tested from the app. This wires it up.
What
api/drive_integration.py— new whitelistedis_available() -> {installed, ready}so the editor shows the action only when Drive is installed and set up (a team exists).toolbar/DriveMenu.vue— an "Add to Drive" button that appears only when ready; clicking registers the diagram (idempotent) and toasts success with an "Open Drive" action. Hidden entirely when Drive is absent, so standalone installs are unaffected.toolbar/TopToolbar.vue— placed between Export and Share.is_available()returns the status booleans without raising, Drive present or not.Verified in the running app (Drive installed)
The button appears, and clicking it creates a Drive Link file at
/draw/d/<name>("Drawing 15" → /draw/d/drawing-15) that opens the diagram back in Draw. Server tests: 10 pass.🤖 Generated with Claude Code