Skip to content

feat: Add to Drive action in the editor (wire up the Drive integration)#23

Merged
vibhavkatre merged 2 commits into
mainfrom
feat/add-to-drive-button
Jul 20, 2026
Merged

feat: Add to Drive action in the editor (wire up the Drive integration)#23
vibhavkatre merged 2 commits into
mainfrom
feat/add-to-drive-button

Conversation

@vibhavkatre

Copy link
Copy Markdown
Collaborator

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 whitelisted is_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.
  • testis_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

…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>
@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe 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

Comment thread draw/api/drive_integration.py Outdated
Avoid calling drive_installed() twice; use a local. (per Greptile P2)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vibhavkatre
vibhavkatre merged commit d60c453 into main Jul 20, 2026
3 checks passed
@vibhavkatre
vibhavkatre deleted the feat/add-to-drive-button branch July 20, 2026 10:10
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