Skip to content

feat: allow package.json drop on index#67

Open
t128n wants to merge 1 commit into
e18e:mainfrom
t128n:feat/add-package-json-drop-on-index
Open

feat: allow package.json drop on index#67
t128n wants to merge 1 commit into
e18e:mainfrom
t128n:feat/add-package-json-drop-on-index

Conversation

@t128n
Copy link
Copy Markdown
Contributor

@t128n t128n commented May 24, 2026

Current Behavior

Dropping package.json on index page of replacements.fyi opens it as normal browser file preview

Screen Recording 2026-05-24 at 10 40 51

file handle unfortunately is not visible in screen recording

Feature Behavior

Adding handle_dragover and handle_drop event listeners to index to redirect with package.json data to /package-json on file drop

Screen Recording 2026-05-24 at 10 43 35

file handle unfortunately is not visible in screen recording

Copy link
Copy Markdown
Contributor

@43081j 43081j left a comment

Choose a reason for hiding this comment

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

all looks good to me but will also req Paolo to look for sake of checking svelte specifics

@43081j 43081j requested a review from paoloricciuti May 27, 2026 09:08
Comment on lines +43 to +53
$effect(() => {
if (page.state.package_json) {
const result = eval_package_json(page.state.package_json);
if (result.success) {
scan_result = result;
scan_error = '';
} else {
scan_error = result.error;
}
}
});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reassigning state in an effect is generally considered a malpractice...in this case is probably half fine but I would rather use a $derived here. You can basically move everything here return the value in a $derived.by and then use that value in scan_result and scan_error

@paoloricciuti
Copy link
Copy Markdown
Collaborator

Also I just saw #74: if we merge that we can simply goto passing the right query parameter

@t128n
Copy link
Copy Markdown
Contributor Author

t128n commented May 27, 2026

Also I just saw #74: if we merge that we can simply goto passing the right query parameter

That would be a nicer implementation, I guess. I'll wait for #74 to merge and then adjust if that's fine, as I'm a little short on time this week.

@paoloricciuti
Copy link
Copy Markdown
Collaborator

No worries at all...let's see if we end up somewhere with #74 and then we can eventually update this

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.

3 participants