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>
vibhavkatre
added a commit
that referenced
this pull request
Jul 28, 2026
…rts) (#24) Audit pass over frontend/src for code nothing can reach. Behaviour-preserving: every removal is verified unreferenced from both source and tests. Orphaned files (282 lines): - useHoverArrows.js — select-mode hover arrows were removed; HoverArrows.vue does its own connector-anchor logic and never imported this composable. - NewDiagramDialog.vue — the diagram-type picker, dropped when "New diagram" started creating a unified doc directly. - TextSection.vue — superseded by the text controls in BlockSelectionEditor. Unreachable exports: - deleteNode (mindmapOperations) — the plural deleteNodes is what callers use. - reassignBranchColors (mindmapOperations) — never wired to a control. - isLocked (shapeFlags) — isInteractable covers every caller's need. - THEME_PRESET_NAMES (theme) — presets are read via findThemePreset. - STROKE_KINDS (whiteboardModel) — stroke kind is set at the call site. - toggleOutline + outlineVisible, notesNodeId (mindmapUi) — vestigial state for an outline/notes side panel that was never built; nothing read either field. Dependency: - Drop @tiptap/extension-underline. Tiptap 3 ships Underline inside starter-kit, so the direct dep was redundant — yarn.lock is unchanged, which confirms it. Also commits the stale components.d.ts regeneration (DriveMenu was added in #23 but the generated file was never committed). Four unwired features were found and deliberately KEPT, each now carrying a comment saying so, because deleting them would cement the gap: unlinkNodes (cross-links can be created but never deleted), toggleFocus (focus mode renders but has no activator), startPaletteDrag (canvas drop handler is live but no palette tile produces the payload), and the duplicate_diagram endpoint. Tests: 102 vitest pass, frontend build clean. Co-authored-by: Vibhav Katre <vibhav@frappe.io> Co-authored-by: Claude Opus 5 (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