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
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>
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