Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow project settings to be configurable #31

Merged
merged 16 commits into from
Sep 28, 2024

Conversation

SamCarlberg
Copy link
Member

@SamCarlberg SamCarlberg commented Sep 28, 2024

Add settings for team number and epilogue support (on/off)

Dynamically regenerate code when project settings change

Add a settings dialog for configuration; project name editing has been moved to this dialog. Team number and project name are now displayed read-only in the top left where the project name input used to be. The dialog is displayed by default when the app is loaded

Settings are validated and cannot be applied if invalid - team numbers must be positive integers, and project names must have at least one non-whitespace character. The "Apply" button is disabled if validation checks fail

Invalid inputs:
Screenshot 2024-09-28 at 1 45 58 PM

Valid inputs:
Screenshot 2024-09-28 at 1 46 14 PM

Comment on lines 67 to 76
// Reload the current file when the project changes
useEffect(() => {
const currentFile = selectedFile
setSelectedFile(project.generatedFiles.find(f => f.name === "README.md"))

if (project.generatedFiles.find(f => f.name === currentFile.name)) {
// Show the original file if it still exists
setSelectedFile({ ...currentFile })
}
}, [project])
Copy link
Member Author

Choose a reason for hiding this comment

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

For some reason, this only seems to fire once, and requires a view reload (such as switching tabs) afterward

The react indentation rule doesn't appear to re-indent contents of tags that get moved by --fix
Add definitions for grouping settings together

Allow custom settings to be defined (eg by plugins)
@SamCarlberg SamCarlberg merged commit e5f1199 into wpilibsuite:main Sep 28, 2024
1 check passed
@SamCarlberg SamCarlberg deleted the project-settings branch September 28, 2024 18:56
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.

1 participant