Skip to content

Load local files and handle injections - #79

Closed
ceoloide wants to merge 3 commits into
mainfrom
cursor/load-local-files-and-handle-injections-6ed7
Closed

ceoloide wants to merge 3 commits into
mainfrom
cursor/load-local-files-and-handle-injections-6ed7

Conversation

@ceoloide

@ceoloide ceoloide commented Nov 2, 2025 •

Copy link
Copy Markdown
Owner

Add local file loading functionality to Welcome.tsx for YAML, JSON, ZIP, and EKB files, including footprint extraction and conflict resolution.

This PR introduces a new "From Local File" option, enabling users to upload configuration files directly. For .zip and .ekb archives, it extracts config.yaml and any .js files from a footprints/ directory, naming them based on their relative path. Existing conflict resolution logic is reused for footprints, similar to GitHub-loaded injections.


Open in Cursor Open in Web


Note

Adds local file upload (YAML/JSON/ZIP/EKB) with footprint extraction and conflict-aware injection processing, plus tests.

  • Welcome UI (src/pages/Welcome.tsx):
    • Add "From Local File" option with hidden file input and handler to load configs (.yaml/.yml/.json/.zip/.ekb).
    • Generalize processFootprints to handle GitHubFootprint[] | LocalFootprint[] and integrate with existing conflict resolution flow.
    • Wire up loading state, error handling, and file input reset.
  • Utils (src/utils/localFiles.ts):
    • Implement loadLocalFile to parse config files directly or extract from archives.
    • Extract .js footprints from footprints/ in archives, preserving relative names, return { config, footprints }.
  • Tests (src/utils/localFiles.test.ts):
    • Add comprehensive tests for YAML/JSON, ZIP/EKB archives, missing config.yaml, nested footprints, and non-.js filtering.

Written by Cursor Bugbot for commit 309aa01. This will update automatically on new commits. Configure here.

Co-authored-by: marco.massarelli <marco.massarelli@gmail.com>
@cursor

cursor Bot commented Nov 2, 2025

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread src/pages/Welcome.tsx
if (fileInputRef.current) {
fileInputRef.current.value = '';
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Conflict dialog leaves loading state active UI bug

When processFootprints encounters a conflict and shows the conflict dialog, it returns early without calling generateNow(). However, the finally block in handleLocalFile only resets isLoading but not isGenerating. This leaves isGenerating=true while waiting for user input on the conflict dialog, causing the UI to incorrectly display a loading/generating state. The finally block should also call setIsGenerating(false), or there should be a check to reset isGenerating when a conflict dialog appears (similar to how handleConflictCancel resets both states).

Fix in Cursor Fix in Web

cursoragent and others added 2 commits November 2, 2025 19:30
Co-authored-by: marco.massarelli <marco.massarelli@gmail.com>
Co-authored-by: marco.massarelli <marco.massarelli@gmail.com>
@ceoloide ceoloide closed this Nov 6, 2025
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