Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Adds CLI parameter support for overriding chart title and level strings in Tauri environment, enabling automated batch rendering workflows.

Changes

  • CLI arg parsing: Read --title and --level from Tauri CLI args in init()
  • Override application: Apply overrides consistently when bundles are created, selected, or auto-selected after deletion
  • UI state: Disable title/level input fields when overridden to prevent editing
  • Refactoring: Extract applyMetadataOverrides(bundle) helper to reduce duplication

Usage

./PhiZone.Player --title "Custom Title" --level "SP Lv.15" chart.pez

When overrides are set, the original values from chart files are replaced and the corresponding UI fields remain disabled.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.jsdelivr.net
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/player/player/node_modules/.bin/vite build --config vite/config.prod.mjs (dns block)
  • eu.posthog.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/player/player/node_modules/.bin/vite build --config vite/config.prod.mjs (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[FEAT] Add support for overriding title and level through CLI params</issue_title>
<issue_description>Need support for overriding title and level strings through CLI params when in Tauri environment. This is beneficial for automated gameplays, especially for batch rendering. When either title or level is overridden, the original value from chart files will be replaced by the new one, and corresponding fields in the UI will remain disabled and filled with the overridden value.</issue_description>

<agent_instructions>This is a Svelte app built with Tailwind CSS and daisyUI. Please first dive deep in the existing code structure before coming up with an elegant and effective solution to this feature request issue. We use PNPM for package management. Please make sure your commit messages conform to Conventional Commits.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link

vercel bot commented Dec 29, 2025

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

Project Deployment Review Updated (UTC)
player Ready Ready Preview, Comment Dec 29, 2025 9:12pm

Co-authored-by: Naptie <57532127+Naptie@users.noreply.github.com>
Co-authored-by: Naptie <57532127+Naptie@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for overriding title and level via CLI params feat: add support for overriding title and level through CLI params Dec 29, 2025
Copilot AI requested a review from Naptie December 29, 2025 20:33
@Naptie Naptie marked this pull request as ready for review December 29, 2025 20:53
Copilot AI review requested due to automatic review settings December 29, 2025 20:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds CLI parameter support for overriding chart title and level strings in the Tauri environment, enabling automated batch rendering workflows. The implementation allows users to pass --title and --level arguments when launching the application, which will override values from chart files and disable the corresponding UI input fields.

  • Adds CLI argument parsing to read --title and --level from Tauri CLI args
  • Implements consistent override application when bundles are created, selected, or auto-selected
  • Introduces helper function to reduce code duplication in override logic

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/routes/(app)/+page.svelte Implements CLI parameter parsing, override logic via helper function, and UI field disabling when overrides are active
.gitignore Adds package-lock.json to ignore list, appropriate for a pnpm-based project

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

...metadata!,
title: overrideTitle ?? metadata!.title,
level: overrideLevel ?? metadata!.level,
levelType: overrideLevel ? inferLevelType(overrideLevel) : metadata!.levelType,
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The condition overrideLevel ? inferLevelType(overrideLevel) : metadata!.levelType uses a truthy check which could be problematic if overrideLevel is an empty string. Empty strings are falsy in JavaScript, so an empty string override would incorrectly fall back to the original levelType. Consider using overrideLevel !== undefined instead to match the pattern used in line 227 of the helper function.

Suggested change
levelType: overrideLevel ? inferLevelType(overrideLevel) : metadata!.levelType,
levelType: overrideLevel !== undefined ? inferLevelType(overrideLevel) : metadata!.levelType,

Copilot uses AI. Check for mistakes.
@Naptie Naptie merged commit 87389b5 into main Dec 29, 2025
11 checks passed
@Naptie Naptie deleted the copilot/add-cli-params-support branch December 29, 2025 21:14
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.

[FEAT] Add support for overriding title and level through CLI params

2 participants