Skip to content

feat: redone Framework integration#604

Draft
safwansamsudeen wants to merge 43 commits into
developfrom
ff-file
Draft

feat: redone Framework integration#604
safwansamsudeen wants to merge 43 commits into
developfrom
ff-file

Conversation

@safwansamsudeen
Copy link
Copy Markdown
Collaborator

Merge Drive File into File. Makes Drive the improved file-viewer for Framework.

@safwansamsudeen
Copy link
Copy Markdown
Collaborator Author

@federicocalvo @nilpatel42 please let me know if you're interested in alpha testing 😄 (DM @realsafwan).

@federicocalvo
Copy link
Copy Markdown

This should be a real game-changer in terms of encouraging the use of the drive

safwansamsudeen and others added 7 commits May 26, 2026 14:39
…th (D1)

Notable decisions:
- Took ff-file's framework File doctype model throughout (file_name/is_folder/
  file_url over Drive File's title/is_group)
- Adopted develop's structured frappe.local.response.errors pattern in
  get_entity_with_permissions
- Adopted develop's delayedLoading watcher in DriveToolBar
- Adopted develop's Tooltip wrappers for share_count icons in ListView
- Kept ff-file's reactive storage-bar watch over develop's one-shot fetch
- Dropped DocEditor (deleted in develop) and the editor-style imports in
  utils/files.js and utils/download.js
- Took yarn over pnpm and frappe-ui npm 0.1.269 over the github pinned commit
- Switched newExternal Presentation flow to develop's /slides/presentation/new
  redirect; drive.api.files.create_presentation is now unreachable
- Restored develop's frappe_doc/markdown branch in getLink (was missing in HEAD)

D1: scripts.clear_deleted_files used today + timedelta(30); flipped to today -
    timedelta(30) so the job preserves status=-1 records for 30 days before
    hard-delete instead of nuking them on first run.
Resolving conflicts from develop's 33 commits since the last merge
(aa48b74). Same overall policy: ff-file owns the framework File doctype
model; develop wins on UI cleanups and removed/replaced features.

Notable decisions:
- Adopted develop's "track visit separately" pattern (6b3a972): dropped
  mark_as_viewed from get_entity_with_permissions, kept the standalone
  track_visit endpoint, and File.vue calls it on load.
- Did NOT re-add develop's markdown rendering block in permissions.py —
  ff-file 90f3878 deliberately removed it.
- Dropped develop's create_file / create_document_entity (Drive File
  doctype, unused) and create_presentation (newExternal routes directly
  to /slides/presentation/new, endpoint unreachable).
- Took develop's editor-frontend removal through: dropped printDoc,
  getPdfFromDoc, globalStyle/lowlight imports. Drive no longer supports
  downloading docs from the list view — folder downloads skip them
  silently rather than crash on the removed getPdfFromDoc.
- Switched presentation thumbnails to develop's get_presentation_thumbnail.
- Took develop's Signup.vue route + Dummy redirect for /w/:entityName
  (LoginSignup.vue and Document.vue both deleted in develop). Updated
  ErrorPage redirect and router fallback to external /login via
  window.location.href.
- Renamed Slides → Presentations everywhere (Sidebar label, router name).
- Took develop's view-aware getThumbnailUrl (list shows icon, grid shows
  thumbnail) — GridItem already passes view="grid".
- Kept ff-file's reactive storage-bar watch over develop's one-shot fetch.
- Kept ff-file's Home/Shared toggle on Personal.vue (intentional UX
  consolidation); develop's with/by tabs on /shared not applicable here.

Follow-ups not addressed:
- DriveToolBar Type sort field auto-merged to mime_type (was file_type);
  verify expected behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- s3.fetch now serves through get_file_content (enforces Drive perms per
  request) instead of redirecting to it, and returns a uniform 404 for
  missing/forbidden so keys can't be enumerated
- rename sanitize_url -> storage_key; it always returns a relative key so
  `Path(base) / key` can't reset to an absolute path
- route every S3 Key/CopySource and site_folder join through storage_key,
  fixing move/move_to_trash passing the stored file_url as the S3 key
- normalize both ends of FileManager.move so any caller (rename, restore,
  desk move) resolves to the real backend key
- fix embed path typo entity.file_names -> file_name
- replace print() with frappe.log_error and narrow except in get_file
- add invariant test for storage_key/get_s3_url round-trip

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- File.status Int (1/0/-1) -> Select (Active/Trashed/Removed), backed by
  STATUS_ACTIVE/TRASHED/REMOVED constants; replace all numeric comparisons
  (incl. the `if doc.status:` truthiness trap in the trash toggle)
- rename details_doctype/details_docname -> content_doctype/content_docname
  (the record holding the file's actual content) in the fixture + all sites
- fix integrate_with_framework patch to write the real field names
  (file_modified, content_doctype/_docname) and the Select status value (D2)
- update ff-file-review.md: mark C1, C2, D2, D4, D7 resolved

Co-Authored-By: Claude Opus 4.8 <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