feat: Carbonara usability update - #99
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62d07cab48
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } catch (IllegalArgumentException error) { | ||
| System.err.println("Error: " + error.getMessage()); | ||
| System.err.println(); | ||
| printUsage(); | ||
| return; |
There was a problem hiding this comment.
Return a failing status for argument errors
When automation invokes the CLI with an unknown option, multiple input paths, or a terminal --output, this catch prints an error but returns normally, so the JVM exits with status 0 even though no patching occurred. Shell scripts and CI can therefore treat a rejected invocation as successful; return a nonzero exit status for these errors while preserving status 0 for --help.
Useful? React with 👍 / 👎.
| if (!endOfOptions && ("-o".equals(argument) || "--output".equals(argument))) { | ||
| if (index + 1 >= args.length) { | ||
| throw new IllegalArgumentException(argument + " requires a directory path"); | ||
| } | ||
| outputDir = Paths.get(args[++index]); |
There was a problem hiding this comment.
Reject an option token as a missing output value
When --output is followed by another option, such as --output --help, the parser consumes --help as the directory and then enters interactive mode instead of reporting that the value is missing. Detect recognized option tokens in this position, with an explicit escape for output paths that genuinely begin with -, so value-bearing flags fail clearly as required.
AGENTS.md reference: AGENTS.md:L73-L76
Useful? React with 👍 / 👎.
| dropZone.addEventListener("drop", event => { | ||
| event.preventDefault(); | ||
| dropZone.classList.remove("is-dragging"); | ||
| if (isBusy) return; | ||
| setSelectedFiles(Array.from(event.dataTransfer?.files ?? [])); |
There was a problem hiding this comment.
Clear the native picker state after a drop
If a user first picks file A, then drops file B, the visible selection changes to B but the native input still contains A. Clicking Browse and selecting A again commonly emits no change event because the input's value did not change, leaving B displayed and causing B to be patched despite the user's latest choice; reset or synchronize fileInput when accepting dropped files.
Useful? React with 👍 / 👎.
Problem
pasta's core patching capabilities are present, but contributor guidance is implicit and the browser/CLI workflows expose avoidable friction.
Changes
AGENTS.mdwith repository architecture, Java/Folia/ASM invariants, web privacy rules, and verification expectationsCONTRIBUTING.mdand.editorconfig--help,--output,--no-banner,--handling, case-insensitive JAR checks, deterministic directory ordering, and already-patched filtering--release 17Compatibility
java -jar ... <jar|directory>and no-argument interactive CLI workflows remain supportedVerification
Final CI run #39 completed successfully:
The earlier Java 17 lane exposed an existing toolchain mismatch: Paper API 1.21.1 classes are Java 21 bytecode. The workflow and contributor documentation now use JDK 21 for builds while preserving pasta's configured
--release 17output target.Browser changes should also be manually exercised for picker/drop, skip, progress, download, and clear states before merge.