GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(resources): converge Files onto the shared drag hook and batch bulk authorization by waleedlatif1 · Pull Request #6748 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Files kept a 280-line copy of the foldered-list drag logic because it also accepts OS file drops, and the copies had drifted. The external drop is now an externalDrop option on the shared hook and the copy is gone — folder rows highlight and spring open for an OS file drag exactly as for a move, while the body and breadcrumb decline so the page-level upload overlay owns those regions
  • Collapsed the three drop-active booleans into one ActiveDropTarget union, so exactly one affordance is armed by construction instead of by hand-clearing the other two
  • Kept drop-target state writes identity-stable, so dragover no longer re-renders the list on every event
  • Restored per-list drag MIMEs, so the cross-surface isolation drag-payload.ts documents is true again
  • A folder can now spring open more than once per drag: descend, walk back out through the breadcrumb, descend again. The guard against re-entering the folder already on screen moved to useSpringNavigation, the only layer that can express it
  • Bulk move/delete now resolve each item against the workspace context the batch already holds, and memoize the effective-permission lookup for the batch — two invariant queries per item removed
  • Drop target fills at --surface-active; --surface-4 is the button-base token and is lighter than hover in light mode, so the strongest row state painted the faintest fill

Type of Change

  • Refactor / improvement

Testing

bun run type-check, bun run check:audits (27/27), and 4013 tests pass.

New coverage for the drag lifecycle: re-entering a folder through the breadcrumb, refusing to re-open the folder already on screen, cancelling a pending open when the drag moves onto the current folder, one-hop return to origin after a multi-level round trip, staying put when the round trip ends in a drop, and the next drag taking a fresh origin. Plus unit tests for the permission memo, including key separation and re-query after a rejection.

Not browser-tested — the convergence changes which code path Files runs, so the drag interactions are worth a manual pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@waleedlatif1
refactor(resources): converge Files onto the shared drag hook and bat…
b02c146
…ch bulk authorization

Files kept a 280-line copy of the foldered-list drag logic because it also
accepts OS file drops. The copies had already drifted, so the external drop
becomes an option on the shared hook and the copy goes away.

- Add `externalDrop` to `useFolderRowDragDrop`: folder rows highlight and spring
  open for an OS file drag exactly as for a move, while the body and breadcrumb
  decline so the page-level upload overlay owns those regions
- Collapse the three drop-active booleans into one `ActiveDropTarget` union, so
  exactly one affordance is armed by construction rather than by hand-clearing
- Keep drop-target writes identity-stable so `dragover` does not re-render the
  list on every event
- Give each list its own drag MIME again, restoring the cross-surface isolation
  `drag-payload.ts` documents
- Let a folder spring open more than once per drag, so a drag can walk back out
  through the breadcrumb and descend again; the guard against re-entering the
  folder already on screen moves to `useSpringNavigation`, the only layer that
  can state it
- Resolve each bulk item against the workspace context the batch already holds,
  and memoize the effective-permission lookup for the batch, replacing two
  invariant queries per item
- Fill the drop target at `--surface-active`: `--surface-4` is the button-base
  token and is lighter than hover in light mode, so the strongest row state read
  the faintest
@vercel

vercel Bot commented Aug 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 15, 2026 11:27pm

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor

cursor Bot commented Aug 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches drag-and-drop navigation across Files/Knowledge/Tables and bulk authorization paths; behavior is well-tested but manual drag/upload passes are worthwhile given Files switched code paths.

Overview
Foldered lists share one drag implementation again. Files drops its large duplicate handler and wires useFolderRowDragDrop with per-list dragMime, an externalDrop path for OS files onto folder rows (body/breadcrumb stay with the page upload overlay), and externalDropHandled() so spring navigation does not bounce away after upload.

Drop affordance state is a single ActiveDropTarget union (row / body / crumb) with armDropTarget identity reuse so continuous dragover does not re-render the whole list. Spring-loaded folders can open the same folder again in one drag after backing out via the breadcrumb; useSpringNavigation refuses arming the folder already on screen and cancels pending opens when hovering the current folder crumb.

Bulk move/delete for tables and knowledge bases resolves each item with resolveActiveTableInWorkspace / resolveActiveKnowledgeBaseInWorkspace using the workspace context already loaded for the batch (shared requireTable / requireKnowledgeBase helpers). Table tests assert workspace context loads once per batch and permissions are still checked per item.

UI: chipDropTargetSurfaceClass uses --surface-active plus inset outline instead of --surface-4 so drop targets read stronger in light mode.

Reviewed by Cursor Bugbot for commit 6ab3c6f. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Aug 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR consolidates Files drag-and-drop behavior into the shared folder-list hook, improves spring navigation and drop-target state, restores per-surface drag payload isolation, and optimizes bulk resource context resolution while retaining per-item authorization checks.

  • Adds external OS-file drop support to the shared folder-row drag hook.
  • Reworks spring navigation to support repeated folder entry during one drag while preserving origin restoration.
  • Replaces multiple drop-state booleans with one mutually exclusive active-target union.
  • Reuses canonical workspace context during table and knowledge bulk operations without caching permission decisions.
  • Updates drag lifecycle, authorization, and context-resolution tests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/components/folders/use-folder-row-drag-drop.ts Extends the shared drag hook for surface-specific MIME payloads, external file drops, and mutually exclusive drop-target state.
apps/sim/app/workspace/[workspaceId]/components/folders/use-spring-loaded-folder.ts Allows repeated spring-opening during one drag while retaining first-navigation history semantics.
apps/sim/app/workspace/[workspaceId]/components/folders/use-spring-navigation.ts Prevents navigation to the folder already displayed and preserves drag-origin restoration behavior.
apps/sim/app/workspace/[workspaceId]/files/files.tsx Replaces the Files-specific drag implementation with the shared hook and integrates OS-file upload handling.
apps/sim/lib/knowledge/application/bulk.ts Reuses canonical workspace context across the batch while retaining a fresh authorization check for each knowledge item.
apps/sim/lib/table/application/bulk.ts Reuses canonical workspace context across the batch while retaining a fresh authorization check for each table item.
apps/sim/lib/knowledge/application/contexts.ts Adds resource resolution against an already-established workspace context without carrying an authorization verdict.
apps/sim/lib/table/application/context.ts Adds table resolution against an already-established workspace context without carrying an authorization verdict.
packages/emcn/src/components/chip/chip-chrome.ts Updates the drop-target surface styling to use the stronger active-surface token.

Sequence Diagram

sequenceDiagram
  participant Request as Bulk request
  participant Bulk as Bulk operation
  participant Context as Canonical workspace context
  participant Auth as Workspace authorization
  participant DB as Database
  Request->>Bulk: Move or delete multiple items
  Bulk->>Context: Resolve workspace context once
  loop Each item
    Bulk->>DB: Resolve active resource in workspace
    Bulk->>Auth: Authorize current item
    Auth->>DB: Read current effective permission
    Auth-->>Bulk: Allow or reject
    Bulk->>DB: Commit authorized item
  end
Loading

Reviews (2): Last reviewed commit: "fix(resources): dismiss the upload overl..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Aug 15, 2026
View reviewed changes
Comment thread apps/sim/lib/core/application/workspace-authorization.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 15, 2026
View reviewed changes
Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot deployed to Preview August 15, 2026 23:23
View deployment
@waleedlatif1
fix(resources): dismiss the upload overlay on a folder drop and re-ch…
6ab3c6f
…eck permission per item

The drag hook stops propagation on a drop it handles, so the page-level handler
that cleared the upload overlay never ran and the chrome stayed up over the
finished upload. Both consuming paths now share one dismissal.

Drop the batch permission memo: each item in a bulk move or delete commits
independently, so reusing one allow verdict let a revocation part-way through a
batch go unseen by the remaining items. The workspace context is still resolved
once per batch, which was the larger saving.
@vercel
vercel Bot temporarily deployed to Preview August 15, 2026 23:27 Inactive
@waleedlatif1

waleedlatif1 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 15, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 6ab3c6f. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@waleedlatif1
waleedlatif1 merged commit 4fc0fb4 into staging Aug 15, 2026
30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 deleted the refactor/foldered-drag-convergence branch August 15, 2026 23:44
@waleedlatif1 waleedlatif1 mentioned this pull request Aug 16, 2026
v0.8.3: sim cli, new tools, credential groups, splunk, finder-like files refactor, security hardening #6765
Merged

This branch was previously deployed

1 inactive deployment
Preview — 6ab3c6f7 Deployed Aug 15, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@waleedlatif1
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.