-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Init TUI #4046
base: v3-alpha
Are you sure you want to change the base?
Add Init TUI #4046
Conversation
* fix: compute dropped file path before css handling * udpate changelog * Update website/src/pages/changelog.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Lea Anthony <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: leaanthony <[email protected]>
Co-authored-by: leaanthony <[email protected]>
Co-authored-by: leaanthony <[email protected]>
Co-authored-by: leaanthony <[email protected]>
* Use OutputFilename instead of Name * wailsapp#3200: add changelog entry --------- Co-authored-by: Lea Anthony <[email protected]>
Co-authored-by: leaanthony <[email protected]>
Co-authored-by: leaanthony <[email protected]>
…at is not suitable for JSON (wailsapp#3638) * fix(pkg): Fixed an issue where wails new would throw an error if the author name contained non-JSON legal characters. * refactor(pkg): Incorporating coderabbit's suggestions * docs: write changelog.mdx * Escape using json package. Add tests. * Update test. --------- Co-authored-by: Lea O'Anthony <[email protected]>
Co-authored-by: leaanthony <[email protected]>
* Fix doctor command not finding pkg-config on Solus * Update changelog
…ilsapp#3678) * if no JSON tag, check if field is exported * add no-tags binding test case * update changelog for wailsapp#3678
Co-authored-by: leaanthony <[email protected]>
* Nil pointer check for DnD * Update changelog
* Copy request to Go memory * Update changelog.mdx * Update v2/pkg/assetserver/webview/responsewriter_darwin.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Fix import --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Fix typos * Update howdoesitwork.mdx * Added entry to changelog --------- Co-authored-by: Lea Anthony <[email protected]>
* fix: failsafe JavaScript event emitter `notifyListeners` * chore: update change log
* fix: darg and drop missing cursor icon * chore: update change log
chore: update sponsors.svg Co-authored-by: leaanthony <[email protected]>
…n.json` file (wailsapp#3620) * fix: docs macOS signing password syntax * fix: docs macOS signing password syntax --------- Co-authored-by: Lea Anthony <[email protected]>
Added "wails-template-nextjs-app-router-src" Co-authored-by: Lea Anthony <[email protected]>
* Initial test * Fix calls * Update changelog.mdx * Free allocated strings * Misc fixes
chore: update sponsors.svg Co-authored-by: leaanthony <[email protected]>
* More syscall fixes * Update changelog.mdx
chore: update sponsors.svg Co-authored-by: leaanthony <[email protected]>
chore: update sponsors.svg Co-authored-by: leaanthony <[email protected]>
Removed unnecessary files. Issue was fixed via wailsapp#1813 and the extra readmes is not needed anymore
chore: update sponsors.svg Co-authored-by: leaanthony <[email protected]>
chore: update sponsors.svg Co-authored-by: leaanthony <[email protected]>
fix reloaddirs config option changelog.mdx
changelog.md retain env support actually fix the issue
* Fix invalid path for windows dialogs * Update Go version in pipelines for v2
Warning Rate limit exceeded@PylotLight has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 26 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThis pull request updates the Changes
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
chore: update sponsors.svg Co-authored-by: leaanthony <[email protected]>
Looks good to me! Was there anything else you thought about adding? |
Considerations:
Tldr: tbh yes I would say just merge seeing it's feature add, then we can get wider feedback for more changes. Then edit from there where needed. Actually let me tackle some of the suggested improvements to maintainability etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (6)
v3/internal/commands/init.go (6)
20-34
: Reduce reliance on global variables to improve maintainability.
Introducing many global variables can lead to tight coupling and confusion. It would be cleaner to group these into an existing or new configuration struct, then pass that struct around.Below is a sample refactor that centralizes them in a struct:
-var ( - DisableFooter bool - projectName string - projectDir string - templateName string - gitRepo string - confirmCreation bool - productCompany string - productName string - productDesc string - productVersion string = "1.0.0" - productID string - productCopyright string - productComments string -) +type projectConfig struct { + DisableFooter bool + ProjectName string + ProjectDir string + TemplateName string + GitRepo string + ConfirmCreation bool + ProductCompany string + ProductName string + ProductDesc string + ProductVersion string + ProductID string + ProductCopyright string + ProductComments string +} + +var globalConfig projectConfig = projectConfig{ + ProductVersion: "1.0.0", +}
138-149
: Eliminate dual storage of configuration data.
You’re assigning identical fields from global variables to the local options struct. Consider setting them directly in the struct where they are needed. This reduces duplication and avoids confusion over which source of truth is current.- options.ProjectName = projectName - options.ProjectDir = projectDir - options.TemplateName = templateName - ... + // If you move global vars into a single config struct or pass them directly, + // you can assign them in one place or pass them to Init without bridging like this.
221-224
: Scope templateOptions and templateSelect locally if possible.
Declaring these variables early is functional, but you could reduce clutter by scoping them wherever they are first used.
225-275
: Validate user inputs for reliability.
The form captures critical details like project directories and product info, but it lacks explicit validation (e.g., checking if the directory is writable or if version strings are valid). Consider adding constraints or inline validation to help users correct mistakes sooner.
277-280
: Be explicit about default confirmCreation behavior.
This confirmation defaults to false, so the user must actively set it. Consider clarifying or prompting with a default "yes" to further reduce friction during initialization.
328-369
: Consider rolling back partially created artifacts if Init fails.
If the user confirms and an error arises in Init, the project directory may remain in an inconsistent state. A rollback or cleanup strategy (e.g., removing partial directories, files, or repos) would improve user experience.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
v3/go.sum
is excluded by!**/*.sum
📒 Files selected for processing (2)
v3/go.mod
(2 hunks)v3/internal/commands/init.go
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Run Go Tests (macos-latest, 1.23)
- GitHub Check: Run Go Tests (windows-latest, 1.23)
🔇 Additional comments (5)
v3/internal/commands/init.go (3)
283-312
: Template sorting logic looks correct.
Reinforcing “vanilla” as the first option and ensuring it’s included if missing is a polished user experience. Code is straightforward and easy to follow.
10-11
: Consider verifying new dependency versions for security.
These imports look fine for implementing the interactive TUI, but it's good practice to validate that no known security vulnerabilities exist in the introduced libraries (e.g., "huh", "lipgloss").Below is a script you can run to query GitHub’s advisory database for potential issues:
Also applies to: 13-13, 17-17
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Description: Check for potential security vulnerabilities for newly introduced libraries. for pkg in "github.com/charmbracelet/huh" "github.com/charmbracelet/lipgloss" "github.com/go-git/go-git/v5/config" "github.com/wailsapp/wails/v3/internal/term"; do echo "Checking vulnerabilities for $pkg ..." gh api graphql -f query="query { securityVulnerabilities(ecosystem: GO, first: 10, package: \"$pkg\") { nodes { advisory { summary severity publishedAt } vulnerableVersionRange firstPatchedVersion { identifier } } } }" echo "------------------------------" doneLength of output: 3106
Security Verification Complete – No Vulnerabilities Found
The GitHub API queries confirmed that none of the imported packages show any known security vulnerabilities:
- "github.com/charmbracelet/huh"
- "github.com/charmbracelet/lipgloss"
- "github.com/go-git/go-git/v5/config"
- "github.com/wailsapp/wails/v3/internal/term"
You may proceed with these libraries as they currently pose no security issues.
151-152
: undefinedv3/go.mod (2)
46-56
: Verify newly introduced indirect dependencies for stability and license compliance.
Ensure that each of these new libraries is up-to-date and compatible.✅ Verification successful
🏁 Script executed:
#!/bin/bash # Checking for latest versions and any known advisories for newly introduced indirect dependencies. for pkg in \ "github.com/atotto/clipboard" \ "github.com/catppuccin/go" \ "github.com/charmbracelet/bubbles" \ "github.com/charmbracelet/bubbletea" \ "github.com/charmbracelet/x/exp/strings" \ "github.com/charmbracelet/x/term" \ "github.com/erikgeiser/coninput" \ "github.com/mattn/go-localereader" \ "github.com/muesli/ansi" do echo "Checking vulnerabilities for $pkg..." gh api graphql -f query="query { securityVulnerabilities(ecosystem: GO, package: \"$pkg\") { nodes { advisory { summary severity } vulnerableVersionRange firstPatchedVersion { identifier } } } }" echo "-----------------------" doneLength of output: 10079
Below is an updated shell script using a pagination parameter (“first:10”) in the GraphQL query. This should properly fetch any vulnerability information for each dependency and help verify their stability and license compliance:
Please run the above script and review its output to confirm that the dependencies have no critical vulnerabilities and meet our stability and license compliance requirements.
🏁 Script executed:
#!/bin/bash # Checking vulnerabilities for newly introduced indirect dependencies with pagination fixed. for pkg in \ "github.com/atotto/clipboard" \ "github.com/catppuccin/go" \ "github.com/charmbracelet/bubbles" \ "github.com/charmbracelet/bubbletea" \ "github.com/charmbracelet/x/exp/strings" \ "github.com/charmbracelet/x/term" \ "github.com/erikgeiser/coninput" \ "github.com/mattn/go-localereader" \ "github.com/muesli/ansi" do echo "Checking vulnerabilities for $pkg..." gh api graphql -f query="query { securityVulnerabilities(first:10, ecosystem: GO, package: \"$pkg\") { nodes { advisory { summary severity } vulnerableVersionRange firstPatchedVersion { identifier } } } }" echo "-----------------------" doneLength of output: 7856
Stability and Vulnerability Checks Confirm No Issues
The vulnerability queries for each of the new indirect dependencies returned no advisories, indicating that no security vulnerabilities are reported for the versions specified in the go.mod file. Based on these results, the libraries appear stable and compatible.
However, note that while the vulnerability check is a good proxy for stability, it does not cover license compliance. A separate manual review of the licenses for each dependency is recommended if full compliance verification is required.
77-79
: Check for potential conflicts or security patches in updated dependencies.
Both lipgloss and x/ansi have new versions; confirm that these do not introduce any backward incompatibility.✅ Verification successful
🏁 Script executed:
#!/bin/bash # Description: Validate updated dependencies and search for backward incompatibilities. go mod tidy 2>&1 | tee /tmp/go_mod_tidy_output.log grep -i "conflict" /tmp/go_mod_tidy_output.log && echo "Potential version conflict found!"Length of output: 249
Please run the above script to re-verify that no backward incompatibility or conflicts are reported for the updated dependencies.
🏁 Script executed:
#!/bin/bash # Re-run 'go mod tidy' while redirecting output to a file # This script avoids using tee to ensure compatibility in the sandbox environment. go mod tidy > /tmp/go_mod_tidy_output.log 2>&1 echo "Output of go mod tidy:" cat /tmp/go_mod_tidy_output.log if grep -qi "conflict" /tmp/go_mod_tidy_output.log; then echo "Potential version conflict found!" else echo "No version conflicts found; dependencies appear to be compatible." fiLength of output: 385
Please run the above script to verify that there are no conflicts or backward incompatibilities for the updated dependencies in v3/go.mod.
🏁 Script executed:
#!/bin/bash # Navigate to the module directory containing the go.mod file. cd v3 || { echo "Error: v3 directory not found."; exit 1; } echo "Running go mod tidy in the v3 directory..." go mod tidy > /tmp/v3_go_mod_tidy_output.log 2>&1 echo "Output of go mod tidy in v3:" cat /tmp/v3_go_mod_tidy_output.log if grep -qi "conflict" /tmp/v3_go_mod_tidy_output.log; then echo "Potential version conflict found!" else echo "No version conflicts found; dependencies appear to be compatible." fiLength of output: 10867
Dependency Compatibility Verified
After executing
go mod tidy
within the v3 directory and inspecting the output, no version conflicts or backward incompatibilities were reported for the updated dependencies (including the newer versions of lipgloss and x/ansi). All dependency downloads were normal and no conflict warnings were detected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
🔭 Outside diff range comments (1)
v2/internal/frontend/desktop/windows/winc/controlbase.go (1)
68-75
: Breaking change: Method visibility changedThe method has been made public by renaming from
initControl
toInitControl
. This is a breaking change that could affect existing code using this package.Please ensure this change is intentional and documented in the changelog. Consider the impact on existing code that might be using this package.
🧹 Nitpick comments (40)
website/docs/community/showcase/kafka-king.mdx (2)
3-8
: Image Rendering Code Block
The MDX code block successfully centers the image using inline HTML. For improved accessibility, consider adding analt
attribute to the<img>
tag so that screen readers can convey the image description. For example:- <img src={require("@site/static/img/showcase/kafka-King-img_3.webp").default} /> + <img src={require("@site/static/img/showcase/kafka-King-img_3.webp").default} alt="Kafka-King Showcase Image" />
10-11
: Description Text Enhancement
The description is succinct; however, the phrase "This is made of Wails+vue3" could be refined for clarity. Consider rephrasing it to "Built with Wails and Vue3" or "Powered by Wails and Vue3" to ensure consistency with naming conventions and readability.website/i18n/ar/docusaurus-plugin-content-docs/current/reference/options.mdx (2)
537-542
: Documentation Addition – Reinstated ZoomFactor Field
The new section for ZoomFactor clearly explains its purpose and its type (float64
). For enhanced clarity, consider adding a brief note about the typical range or default value, if one exists.
543-547
: Documentation Addition – Reinstated IsZoomControlEnabled Field
The description for IsZoomControlEnabled is concise and adequately explains that it controls whether the user can change the zoom factor at runtime. Optionally, you might include extra details (such as default behavior or typical use cases) to help users understand when to enable or disable this setting.website/docs/guides/application-development.mdx (1)
261-261
: Clarify and Expand on AssetsHandler OptionThe new line on 261 explains that you can exclusively use the
AssetsHandler
by setting theAssets
option tonil
. For clarity, consider rewording this sentence to explicitly state that doing so bypasses the default filesystem asset serving. This extra detail could help users understand the behavior more clearly.For example, you could revise it as follows:
-It's also possible to only use the `AssetsHandler` by specifying `nil` as the `Assets` option. +It's also possible to exclusively use an `AssetsHandler` by setting the `Assets` option to `nil`. This bypasses the default filesystem-based asset serving and relies solely on your custom handler for processing non-GET requests.website/i18n/fr/docusaurus-plugin-content-pages/credits.mdx (1)
268-268
: Updated Contributor Link for "Wang, Chi" – Attribution RevisedThe contributor link has been correctly updated to point to
https://github.com/branchseer
, ensuring proper attribution for Wang, Chi.Additionally, the hyphen used after the contributor’s link (i.e. “-”) is flagged by static analysis for typographical improvement. In French typography, it is preferable to use an em dash (—) for better visual clarity. Consider changing:
- [Wang, Chi](https://github.com/branchseer) - Le projet DeskGap a été une grande influence sur la direction de Wails v2. + [Wang, Chi](https://github.com/branchseer) — Le projet DeskGap a été une grande influence sur la direction de Wails v2.🧰 Tools
🪛 LanguageTool
[typographical] ~268-~268: Ce signe est un trait d’union, il ne sert qu’à former des mots composés. Employez un tiret ou un autre signe de ponctuation plus approprié.
Context: ...nt permis de publier la v2. - Wang, Chi - Le projet DeskGap a été une grande influen...(TIRET)
v2/internal/frontend/runtime/runtime_prod_desktop.js (1)
1-2
: Consider source mapping for better debugging.The file is minified JavaScript. While this is good for production, consider generating source maps to aid debugging and maintenance.
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 1-1: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 1-1: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 1-1: Avoid redundant double-negation.
It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation(lint/complexity/noExtraBooleanCast)
[error] 1-1: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 1-1: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 1-1: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 1-1: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
v2/pkg/assetserver/webview/responsewriter_darwin.go (1)
107-125
: Great improvement in memory safety!The new implementation properly manages memory when transferring data between Go and C, preventing potential issues with Go's garbage collector. The explicit handling of zero-length content is also a good addition.
Consider adding a buffer size limit.
For very large buffers, consider adding a maximum size limit to prevent potential memory allocation failures or fragmentation.
func (rw *responseWriter) Write(buf []byte) (int, error) { + const maxBufferSize = 100 * 1024 * 1024 // 100MB limit if rw.finished { return 0, errResponseFinished } rw.WriteHeader(http.StatusOK) var contentLen int if buf != nil { contentLen = len(buf) } + if contentLen > maxBufferSize { + return 0, fmt.Errorf("buffer size %d exceeds maximum allowed size of %d bytes", contentLen, maxBufferSize) + } if contentLen > 0 {v2/internal/frontend/dispatcher/dispatcher.go (2)
33-33
: Consider removing the blank identifier in named returns.The blank identifier
_
in the named return suggests this value is never used in deferred functions. If that's the case, you could simplify to just(string, err error)
since onlyerr
is used in the defer block.-func (d *Dispatcher) ProcessMessage(message string, sender frontend.Frontend) (_ string, err error) { +func (d *Dispatcher) ProcessMessage(message string, sender frontend.Frontend) (string, err error) {
43-43
: Consider improving error logging format.The current error logging might not handle all error types optimally and could potentially log sensitive data.
- d.log.Error("process message error: %s -> %s", message, err) + d.log.Error("process message error: %v -> %v", sanitizeMessage(message), err)Consider adding a helper function to sanitize potentially sensitive message data before logging:
func sanitizeMessage(message string) string { if len(message) > 100 { return message[:97] + "..." } return message }website/docs/guides/sveltekit.mdx (1)
4-4
: Consistent Terminology for Installation Steps
The updated description on line 4 now reads:
1. Minimal Installation Steps - The steps needed to get a minimum Wails setup working for SvelteKit.
While the section title uses “Minimal,” the description uses “minimum.” For consistency, consider using one term throughout (e.g., “minimal”).Proposed Diff:
-1. Minimal Installation Steps - The steps needed to get a minimum Wails setup working for SvelteKit. +1. Minimal Installation Steps - The steps needed to get a minimal Wails setup working for SvelteKit.v2/internal/go-common-file-dialog/cfd/iShellItemArray.go (1)
53-56
: Enhance error message with more context.While the error message is clearer now, it could be more helpful by including additional context such as the index being accessed.
- return "", fmt.Errorf("shellItem is nil") + return "", fmt.Errorf("shellItem is nil for index %d", index)Also applies to: 61-61
v2/pkg/git/git_test.go (2)
7-7
: Rename test function to follow Go conventions.The test function name
TestEscapeName1
suggests there might be more test files. In Go, it's conventional to name test functions without numerical suffixes unless they're specifically testing different aspects of the same function.-func TestEscapeName1(t *testing.T) { +func TestEscapeName(t *testing.T) {
11-31
: Add more test cases for comprehensive coverage.The current test cases only cover escaping apostrophes and backslashes. Consider adding test cases for:
- Empty string
- Special characters (e.g.,
"
,\n
,\t
)- Unicode characters
- Error scenarios
Here's an example of additional test cases:
tests := []struct { name string args args want string wantErr bool }{ { name: "Escape Apostrophe", args: args{ str: `John O'Keefe`, }, want: `John O'Keefe`, }, { name: "Escape backslash", args: args{ str: `MYDOMAIN\USER`, }, want: `MYDOMAIN\\USER`, }, + { + name: "Empty string", + args: args{ + str: "", + }, + want: "", + }, + { + name: "Special characters", + args: args{ + str: "Line 1\nLine \"2\"\tTab", + }, + want: `Line 1\nLine \"2\"\tTab`, + }, + { + name: "Unicode characters", + args: args{ + str: "Hello 世界", + }, + want: `Hello 世界`, + }, }v2/pkg/git/git.go (1)
34-41
: Make error messages consistent across functions.The error message in
Name
function uses a different format than the one inEscapeName
. Consider using consistent error messages.- errMsg := "failed to retrieve git user name: %w" + const errMsg = "failed to retrieve git user name: %w".replit (1)
7-8
: Consider adding environment variables for deployment.The deployment configuration might benefit from environment-specific settings.
Consider adding environment variables section:
[deployment] run = ["sh", "-c", "go run v2/cmd/wails/main.go"] + +[env] +GO_ENV = "production"v2/pkg/logger/logger.go (1)
44-60
: Consider improving the default case handling.The default case returns "debug" which might be unexpected for unknown log levels. Consider:
- Returning an "unknown" string to clearly indicate an invalid level.
- Using
fmt.Sprintf("unknown(%d)", l)
to include the actual value.Apply this diff to improve error handling:
- default: - return "debug" + default: + return fmt.Sprintf("unknown(%d)", l)v2/cmd/wails/internal/dev/watcher.go (1)
32-32
: Fix typo in variable name.The variable name "seperatedDirs" contains a typo. It should be "separatedDirs".
Apply this diff to fix the typo:
- seperatedDirs := strings.Split(reloadDirs, ",") + separatedDirs := strings.Split(reloadDirs, ",")v2/pkg/commands/build/packager.go (1)
86-90
: Improve error message clarity.While the filename handling is correct, the error message could be more descriptive.
Consider this improvement:
- return errors.Wrap(err, "Cannot move file: "+options.CompiledBinary) + return errors.Wrap(err, fmt.Sprintf("Failed to move compiled binary from '%s' to '%s'", options.CompiledBinary, packedBinaryPath))v2/cmd/wails/internal/dev/dev.go (1)
155-156
: LGTM! Consider documenting the reload directories configuration.The addition of
projectConfig.ReloadDirectories
improves configurability by allowing project-specific reload directory settings.Consider adding documentation or examples in the project's configuration guide to show how to use the
ReloadDirectories
setting effectively.website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/kafka-king.mdx (1)
22-23
: Fix incomplete feature list entry.The last feature list item appears to be truncated: "コンシューマー グループの表示のサポート、Consumer- ……"
Please complete the description of the last feature list item.
.github/workflows/pr.yml (1)
29-51
: Removal of the Go Linting Job.
The previously activelint_go
job is now entirely commented out. Ensure that any linting responsibilities are either handled elsewhere or that the team is comfortable removing this job from the workflow.website/docs/gettingstarted/installation.mdx (1)
10-11
: Consistent Apple OS Naming.
Static analysis recommends using “macOS” (with a lowercase “m”) rather than “MacOS”. Please update these entries to ensure consistency with standard terminology.🧰 Tools
🪛 LanguageTool
[grammar] ~10-~10: The operating system from Apple is written “macOS”.
Context: ...latforms - Windows 10/11 AMD64/ARM64 - MacOS 10.15+ AMD64 for development, MacOS 10....(MAC_OS)
[grammar] ~10-~10: The operating system from Apple is written “macOS”.
Context: ...4 - MacOS 10.15+ AMD64 for development, MacOS 10.13+ for release - MacOS 11.0+ ARM64 ...(MAC_OS)
[grammar] ~11-~11: The operating system from Apple is written “macOS”.
Context: ...development, MacOS 10.13+ for release - MacOS 11.0+ ARM64 - Linux AMD64/ARM64 ## Dep...(MAC_OS)
website/docs/reference/menus.mdx (1)
22-24
: Inline Callback for Open Menu Item
Replacing the direct function reference with an inline callback (even if it presently does nothing) is a good placeholder for further implementation. Consider adding a TODO comment if further action handling is expected.website/docs/reference/cli.mdx (2)
72-72
: Clarify Platform Flag Description
The-platform
flag description now specifies that the flag accepts a comma-delimited list (e.g.,windows/arm64
). Consider revising “eg.windows/arm64
” to “e.g.windows/arm64
” for proper abbreviation punctuation.-| eg. `windows/arm64` +| e.g. `windows/arm64`🧰 Tools
🪛 LanguageTool
[misspelling] ~72-~72: This word is normally spelled with a hyphen.
Context: ...tform | Build for the given (comma delimited) [platforms](../reference/cli.mdx#platf...(EN_COMPOUNDS_COMMA_DELIMITED)
[uncategorized] ~72-~72: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...tforms](../reference/cli.mdx#platforms) eg.windows/arm64
. Note, if you do not gi...(E_G)
106-112
: Minimal macOS Version Information Added
The new info block clearly explains how users can override the default minimal macOS version viaCGO_CFLAGS
andCGO_LDFLAGS
. One suggestion: change “MacOS” to “macOS” to match the official Apple branding.-:::info Set minimal version for MacOS +:::info Set minimal version for macOS🧰 Tools
🪛 LanguageTool
[grammar] ~106-~106: The operating system from Apple is written “macOS”.
Context: .... ::: :::info Set minimal version for MacOS You can override default [minimal vers...(MAC_OS)
website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx (1)
537-547
: New Zoom Options in Windows Configuration
The addition of theZoomFactor
andIsZoomControlEnabled
properties for Windows is well documented. The description clearly states thatZoomFactor
defines the WebView2 zoom level and that enablingIsZoomControlEnabled
allows users to adjust this value.Suggestion: The Japanese text currently uses a somewhat verbose expression ("~することができます"). Consider rephrasing for conciseness, for example:
- Instead of:
“このオプションを有効にすると、拡大率をユーザによって変更することができます。 拡大率の変更がユーザに許可されていない間は、オプションで拡大率を設定することができますのでご注意ください…”- You might simplify it to:
“このオプションを有効にすると、ユーザが拡大率を変更できるようになります。許可されていない場合は、オプションで拡大率を固定してください (例: キオスクアプリケーションなど)。”🧰 Tools
🪛 LanguageTool
[uncategorized] ~547-~547: 「ことができる」という表現は冗長な可能性があります。
Context: ...:bool
このオプションを有効にすると、拡大率をユーザによって変更することができます。 拡大率の変更がユーザに許可されていない間は、オプションで拡大率を設定する...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~547-~547: 「ことができる」という表現は冗長な可能性があります。
Context: ...きます。 拡大率の変更がユーザに許可されていない間は、オプションで拡大率を設定することができますのでご注意ください (例: キオスクアプリケーションなど)。 ####...(DOUSI_KOTOGADEKIRU)
website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx (1)
547-547
: Varier le vocabulaire
On note la répétition du terme dans la description relative à « une application vitrine ou similaire ». Pour améliorer la variété stylistique, envisagez d’employer un synonyme dans l’une des phrases.🧰 Tools
🪛 LanguageTool
[style] ~547-~547: Ce mot apparaît déjà dans l’une des phrases précédant immédiatement celle-ci. Utilisez un synonyme pour apporter plus de variété à votre texte, excepté si la répétition est intentionnelle.
Context: ...n (f.e. pour une application vitrine ou similaire). #### DisablePinchZoom Setting this ...(FR_REPEATEDWORDS_SIMILAIRE)
website/docs/guides/nixos-font.mdx (1)
3-3
: Punctuation Improvement in Documentation
On remarque une petite lacune de ponctuation dans la phrase sur la ligne 3. Pour améliorer la lisibilité, il serait préférable d’insérer une virgule après “To fix this”, par exemple:“To fix this, add the following to your devShell.”
🧰 Tools
🪛 LanguageTool
[uncategorized] ~3-~3: A comma might be missing here.
Context: ...oesn't affect the rendered page. To fix this add the following to your devShell. ``...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
website/docs/guides/mac-appstore.mdx (1)
65-66
: Clarification on Embedded Provisioning Profile Instructions
L’instruction concernant l’ajout du Provisioning Profile à la racine de l’application est claire. Pour éviter une répétition trop proche d’instructions similaires dans d’autres parties du document, envisagez de reformuler légèrement cette phrase pour introduire davantage de variété stylistique.🧰 Tools
🪛 LanguageTool
[style] ~65-~65: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...dded to the root of the application. It needs to be named embedded.provisionprofile. ##...(REP_NEED_TO_VB)
v2/internal/go-common-file-dialog/cfdutil/CFDUtil.go (4)
7-8
: Add missing documentation for public functionThis exported function requires proper documentation following Go conventions.
Add a documentation comment explaining the purpose, parameters, and return values. For example:
-// TODO doc +// ShowOpenFileDialog displays a file open dialog using the provided configuration. +// It returns the selected file path and any error encountered during the process.
17-18
: Add missing documentation for public functionThis exported function requires proper documentation following Go conventions.
Add a documentation comment explaining the purpose, parameters, and return values. For example:
-// TODO doc +// ShowOpenMultipleFilesDialog displays a file open dialog that allows multiple file selection. +// It returns the selected file paths and any error encountered during the process.
27-28
: Add missing documentation for public functionThis exported function requires proper documentation following Go conventions.
Add a documentation comment explaining the purpose, parameters, and return values. For example:
-// TODO doc +// ShowPickFolderDialog displays a folder selection dialog using the provided configuration. +// It returns the selected folder path and any error encountered during the process.
37-38
: Add missing documentation for public functionThis exported function requires proper documentation following Go conventions.
Add a documentation comment explaining the purpose, parameters, and return values. For example:
-// TODO doc +// ShowSaveFileDialog displays a file save dialog using the provided configuration. +// It returns the selected file path and any error encountered during the process.v2/internal/typescriptify/typescriptify.go (1)
43-45
: Add a short doc comment for clarity.While the usage of
jsVariableUnsafeChars
is correct, consider adding a brief doc comment explaining its purpose (i.e., restricting variable names to[A-Za-z0-9_]
) and how it sanitizes type names.v2/internal/binding/binding_test/binding_notags_test.go (1)
29-38
: Consider adding error handling for invalid JSON.The constructor's JSON parsing could benefit from additional error handling for malformed input.
constructor(source: any = {}) { - if ('string' === typeof source) source = JSON.parse(source); + if ('string' === typeof source) { + try { + source = JSON.parse(source); + } catch (e) { + console.error('Failed to parse source:', e); + return; + } + }v2/internal/binding/binding_test/binding_deepelements_test.go (1)
105-121
: Consider adding error handling in the convertValues method.The TypeScript conversion method could benefit from additional error handling for malformed input.
convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; } + try { if (a.slice && a.map) { return (a as any[]).map(elem => this.convertValues(elem, classs)); } else if ("object" === typeof a) { if (asMap) { for (const key of Object.keys(a)) { a[key] = new classs(a[key]); } return a; } return new classs(a); } return a; + } catch (error) { + console.error('Error converting values:', error); + return a; + } }v2/internal/binding/binding_test/binding_generics_test.go (1)
80-96
: Consider deduplicating the convertValues method.The
convertValues
method is duplicated in both generic type test classes. Consider extracting it to a shared utility.// Add to a shared utility file export function convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; } if (a.slice && a.map) { return (a as any[]).map(elem => convertValues(elem, classs)); } else if ("object" === typeof a) { if (asMap) { for (const key of Object.keys(a)) { a[key] = new classs(a[key]); } return a; } return new classs(a); } return a; }Also applies to: 116-132
v2/internal/binding/generate.go (1)
179-184
: Consider adding validation for generic type syntax.While the handling of generic types is implemented correctly, it would be beneficial to validate the generic type syntax before processing.
func arrayifyValue(valueArray string, valueType string) string { valueType = strings.ReplaceAll(valueType, "*", "") gidx := strings.IndexRune(valueType, '[') if gidx > 0 { // its a generic type + if !strings.HasSuffix(valueType, "]") { + return valueType // invalid generic syntax, return as is + } rem := strings.SplitN(valueType, "[", 2) valueType = rem[0] + "_" + jsVariableUnsafeChars.ReplaceAllLiteralString(rem[1], "_") }v2/internal/binding/binding.go (1)
288-306
: Consider extracting the nested struct handling logic.The duplicate logic for handling nested struct types could be extracted into a helper function for better maintainability.
+func (b *Bindings) processNestedStruct(fType reflect.Type) { + fqname := fType.String() + sNameSplit := strings.SplitN(fqname, ".", 2) + if len(sNameSplit) < 2 { + return + } + sName := sNameSplit[1] + pName := getPackageName(fqname) + a := reflect.New(fType) + if b.hasExportedJSONFields(fType) { + s := reflect.Indirect(a).Interface() + b.AddStructToGenerateTS(pName, sName, s) + } +} func (b *Bindings) AddStructToGenerateTS(packageName string, structName string, s interface{}) { // ... existing code ... } else { fType := field.Type for hasElements(fType) { fType = fType.Elem() } if fType.Kind() == reflect.Struct { - fqname := fType.String() - sNameSplit := strings.SplitN(fqname, ".", 2) - if len(sNameSplit) < 2 { - continue - } - sName := sNameSplit[1] - pName := getPackageName(fqname) - a := reflect.New(fType) - if b.hasExportedJSONFields(fType) { - s := reflect.Indirect(a).Interface() - b.AddStructToGenerateTS(pName, sName, s) - } + b.processNestedStruct(fType) } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
v2/examples/customlayout/go.sum
is excluded by!**/*.sum
v2/go.sum
is excluded by!**/*.sum
v2/internal/staticanalysis/test/standard/go.sum
is excluded by!**/*.sum
website/static/img/sponsors.svg
is excluded by!**/*.svg
📒 Files selected for processing (107)
.github/workflows/build-and-test.yml
(6 hunks).github/workflows/generate-sponsor-image.yml
(1 hunks).github/workflows/pr.yml
(1 hunks).replit
(1 hunks)v2/cmd/wails/internal/dev/dev.go
(2 hunks)v2/cmd/wails/internal/dev/watcher.go
(3 hunks)v2/cmd/wails/internal/version.txt
(1 hunks)v2/examples/customlayout/go.mod
(1 hunks)v2/go.mod
(3 hunks)v2/internal/app/app_dev.go
(2 hunks)v2/internal/binding/binding.go
(3 hunks)v2/internal/binding/binding_test/binding_deepelements_test.go
(1 hunks)v2/internal/binding/binding_test/binding_generics_test.go
(1 hunks)v2/internal/binding/binding_test/binding_ignored_test.go
(1 hunks)v2/internal/binding/binding_test/binding_importedmap_test.go
(1 hunks)v2/internal/binding/binding_test/binding_nonstringmapkey_test.go
(1 hunks)v2/internal/binding/binding_test/binding_notags_test.go
(1 hunks)v2/internal/binding/binding_test/binding_test.go
(1 hunks)v2/internal/binding/binding_test/binding_type_alias_test.go
(1 hunks)v2/internal/binding/generate.go
(2 hunks)v2/internal/binding/generate_test.go
(1 hunks)v2/internal/binding/reflect.go
(1 hunks)v2/internal/frontend/desktop/darwin/WailsContext.m
(1 hunks)v2/internal/frontend/desktop/darwin/single_instance.go
(1 hunks)v2/internal/frontend/desktop/windows/frontend.go
(2 hunks)v2/internal/frontend/desktop/windows/winc/controlbase.go
(1 hunks)v2/internal/frontend/desktop/windows/winc/w32/user32.go
(5 hunks)v2/internal/frontend/desktop/windows/winc/w32/utils.go
(2 hunks)v2/internal/frontend/desktop/windows/winc/w32/uxtheme.go
(3 hunks)v2/internal/frontend/desktop/windows/window.go
(7 hunks)v2/internal/frontend/dispatcher/dispatcher.go
(2 hunks)v2/internal/frontend/runtime/desktop/draganddrop.js
(2 hunks)v2/internal/frontend/runtime/desktop/events.js
(1 hunks)v2/internal/frontend/runtime/runtime_prod_desktop.js
(1 hunks)v2/internal/frontend/runtime/wrapper/runtime.d.ts
(1 hunks)v2/internal/github/github.go
(2 hunks)v2/internal/go-common-file-dialog/cfd/CommonFileDialog_nonWindows.go
(1 hunks)v2/internal/go-common-file-dialog/cfd/DialogConfig.go
(3 hunks)v2/internal/go-common-file-dialog/cfd/errors.go
(1 hunks)v2/internal/go-common-file-dialog/cfd/iFileOpenDialog.go
(4 hunks)v2/internal/go-common-file-dialog/cfd/iFileSaveDialog.go
(1 hunks)v2/internal/go-common-file-dialog/cfd/iShellItem.go
(2 hunks)v2/internal/go-common-file-dialog/cfd/iShellItemArray.go
(3 hunks)v2/internal/go-common-file-dialog/cfd/vtblCommonFunc.go
(6 hunks)v2/internal/go-common-file-dialog/cfdutil/CFDUtil.go
(4 hunks)v2/internal/menumanager/processedMenu.go
(1 hunks)v2/internal/staticanalysis/test/standard/go.mod
(1 hunks)v2/internal/system/packagemanager/eopkg.go
(1 hunks)v2/internal/typescriptify/typescriptify.go
(13 hunks)v2/pkg/assetserver/webview/responsewriter_darwin.go
(2 hunks)v2/pkg/buildassets/build/darwin/Info.dev.plist
(1 hunks)v2/pkg/buildassets/build/darwin/Info.plist
(1 hunks)v2/pkg/buildassets/buildassets.go
(2 hunks)v2/pkg/commands/bindings/bindings.go
(2 hunks)v2/pkg/commands/build/base.go
(3 hunks)v2/pkg/commands/build/build.go
(1 hunks)v2/pkg/commands/build/packager.go
(1 hunks)v2/pkg/commands/buildtags/buildtags.go
(1 hunks)v2/pkg/git/git.go
(2 hunks)v2/pkg/git/git_test.go
(1 hunks)v2/pkg/logger/logger.go
(1 hunks)v2/pkg/menu/menuitem.go
(1 hunks)v2/pkg/options/windows/windows.go
(1 hunks)v2/pkg/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/generate/assets/vue-ts/frontend/READ-THIS.md
(0 hunks)v2/pkg/templates/templates/lit-ts/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/lit/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/preact-ts/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/preact/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/react-ts/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/react/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/svelte-ts/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/svelte/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/vanilla-ts/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/vanilla/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/vue-ts/frontend/READ-THIS.md
(0 hunks)v2/pkg/templates/templates/vue-ts/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)v2/pkg/templates/templates/vue/frontend/wailsjs/runtime/runtime.d.ts
(1 hunks)website/docs/community/showcase/grpcmd-gui.mdx
(1 hunks)website/docs/community/showcase/kafka-king.mdx
(1 hunks)website/docs/community/showcase/minesweeper-xp.mdx
(1 hunks)website/docs/community/showcase/resizem.mdx
(1 hunks)website/docs/community/showcase/wailsterm.mdx
(1 hunks)website/docs/community/templates.mdx
(2 hunks)website/docs/gettingstarted/firstproject.mdx
(0 hunks)website/docs/gettingstarted/installation.mdx
(2 hunks)website/docs/guides/application-development.mdx
(1 hunks)website/docs/guides/crossplatform-build.mdx
(1 hunks)website/docs/guides/frontend.mdx
(1 hunks)website/docs/guides/mac-appstore.mdx
(2 hunks)website/docs/guides/nixos-font.mdx
(1 hunks)website/docs/guides/signing.mdx
(2 hunks)website/docs/guides/sveltekit.mdx
(3 hunks)website/docs/reference/cli.mdx
(2 hunks)website/docs/reference/menus.mdx
(1 hunks)website/docs/reference/options.mdx
(4 hunks)website/docs/reference/runtime/events.mdx
(1 hunks)website/docs/reference/runtime/window.mdx
(1 hunks)website/i18n/ar/docusaurus-plugin-content-docs/current/community/templates.mdx
(1 hunks)website/i18n/ar/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx
(0 hunks)website/i18n/ar/docusaurus-plugin-content-docs/current/reference/options.mdx
(1 hunks)website/i18n/ar/docusaurus-plugin-content-pages/credits.mdx
(1 hunks)website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx
(1 hunks)website/i18n/fr/docusaurus-plugin-content-pages/credits.mdx
(1 hunks)website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/kafka-king.mdx
(1 hunks)website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx
(1 hunks)website/i18n/ja/docusaurus-plugin-content-pages/credits.mdx
(1 hunks)
⛔ Files not processed due to max files limit (23)
- website/i18n/ko/docusaurus-plugin-content-docs/current/introduction.mdx
- website/i18n/ko/docusaurus-plugin-content-docs/current/reference/options.mdx
- website/i18n/ko/docusaurus-plugin-content-pages/credits.mdx
- website/i18n/pt/docusaurus-plugin-content-docs/current/reference/options.mdx
- website/i18n/pt/docusaurus-plugin-content-pages/credits.mdx
- website/i18n/ru/docusaurus-plugin-content-docs/current/reference/options.mdx
- website/i18n/ru/docusaurus-plugin-content-pages/credits.mdx
- website/i18n/tr/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx
- website/i18n/tr/docusaurus-plugin-content-docs/current/reference/options.mdx
- website/i18n/tr/docusaurus-plugin-content-pages/credits.mdx
- website/i18n/vi/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx
- website/i18n/vi/docusaurus-plugin-content-docs/current/reference/options.mdx
- website/i18n/vi/docusaurus-plugin-content-pages/credits.mdx
- website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/kafka-king.mdx
- website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/templates.mdx
- website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/options.mdx
- website/i18n/zh-Hans/docusaurus-plugin-content-pages/credits.mdx
- website/src/pages/changelog.mdx
- website/src/pages/credits.mdx
- website/versioned_docs/version-v2.8.1/gettingstarted/firstproject.mdx
- website/versioned_docs/version-v2.9.0/community/templates.mdx
- website/versioned_docs/version-v2.9.0/gettingstarted/firstproject.mdx
- website/versioned_docs/version-v2.9.0/gettingstarted/installation.mdx
💤 Files with no reviewable changes (4)
- v2/pkg/templates/templates/vue-ts/frontend/READ-THIS.md
- v2/pkg/templates/generate/assets/vue-ts/frontend/READ-THIS.md
- website/docs/gettingstarted/firstproject.mdx
- website/i18n/ar/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx
✅ Files skipped from review due to trivial changes (13)
- v2/internal/go-common-file-dialog/cfd/errors.go
- website/docs/community/showcase/resizem.mdx
- v2/cmd/wails/internal/version.txt
- website/docs/reference/runtime/window.mdx
- website/docs/guides/crossplatform-build.mdx
- v2/internal/frontend/desktop/darwin/single_instance.go
- website/docs/community/showcase/grpcmd-gui.mdx
- v2/pkg/menu/menuitem.go
- website/docs/guides/frontend.mdx
- website/docs/community/showcase/minesweeper-xp.mdx
- website/docs/community/showcase/wailsterm.mdx
- website/i18n/ar/docusaurus-plugin-content-pages/credits.mdx
- v2/internal/go-common-file-dialog/cfd/CommonFileDialog_nonWindows.go
🧰 Additional context used
🪛 LanguageTool
website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx
[uncategorized] ~538-~538: Les deux-points sont précédés d’une espace insécable.
Context: ... | #### ZoomFactor Nom: ZoomFactor
Type: float64
Ceci d...
(FRENCH_WHITESPACE)
[uncategorized] ~539-~539: Les deux-points sont précédés d’une espace insécable.
Context: ... #### ZoomFactor Nom: ZoomFactor
Type: float64
Ceci définit le facteur de z...
(FRENCH_WHITESPACE)
[style] ~547-~547: Ce mot apparaît déjà dans l’une des phrases précédant immédiatement celle-ci. Utilisez un synonyme pour apporter plus de variété à votre texte, excepté si la répétition est intentionnelle.
Context: ...n (f.e. pour une application vitrine ou similaire). #### DisablePinchZoom Setting this ...
(FR_REPEATEDWORDS_SIMILAIRE)
website/docs/gettingstarted/installation.mdx
[grammar] ~10-~10: The operating system from Apple is written “macOS”.
Context: ...latforms - Windows 10/11 AMD64/ARM64 - MacOS 10.15+ AMD64 for development, MacOS 10....
(MAC_OS)
[grammar] ~10-~10: The operating system from Apple is written “macOS”.
Context: ...4 - MacOS 10.15+ AMD64 for development, MacOS 10.13+ for release - MacOS 11.0+ ARM64 ...
(MAC_OS)
[grammar] ~11-~11: The operating system from Apple is written “macOS”.
Context: ...development, MacOS 10.13+ for release - MacOS 11.0+ ARM64 - Linux AMD64/ARM64 ## Dep...
(MAC_OS)
website/docs/reference/cli.mdx
[misspelling] ~72-~72: This word is normally spelled with a hyphen.
Context: ...tform | Build for the given (comma delimited) [platforms](../reference/cli.mdx#platf...
(EN_COMPOUNDS_COMMA_DELIMITED)
[uncategorized] ~72-~72: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...tforms](../reference/cli.mdx#platforms) eg. windows/arm64
. Note, if you do not gi...
(E_G)
[grammar] ~106-~106: The operating system from Apple is written “macOS”.
Context: .... ::: :::info Set minimal version for MacOS You can override default [minimal vers...
(MAC_OS)
website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx
[uncategorized] ~547-~547: 「ことができる」という表現は冗長な可能性があります。
Context: ...: bool
このオプションを有効にすると、拡大率をユーザによって変更することができます。 拡大率の変更がユーザに許可されていない間は、オプションで拡大率を設定する...
(DOUSI_KOTOGADEKIRU)
[uncategorized] ~547-~547: 「ことができる」という表現は冗長な可能性があります。
Context: ...きます。 拡大率の変更がユーザに許可されていない間は、オプションで拡大率を設定することができますのでご注意ください (例: キオスクアプリケーションなど)。 ####...
(DOUSI_KOTOGADEKIRU)
website/docs/guides/mac-appstore.mdx
[style] ~65-~65: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...dded to the root of the application. It needs to be named embedded.provisionprofile. ##...
(REP_NEED_TO_VB)
website/docs/guides/nixos-font.mdx
[uncategorized] ~3-~3: A comma might be missing here.
Context: ...oesn't affect the rendered page. To fix this add the following to your devShell. ``...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
website/i18n/fr/docusaurus-plugin-content-pages/credits.mdx
[typographical] ~268-~268: Ce signe est un trait d’union, il ne sert qu’à former des mots composés. Employez un tiret ou un autre signe de ponctuation plus approprié.
Context: ...nt permis de publier la v2. - Wang, Chi - Le projet DeskGap a été une grande influen...
(TIRET)
🪛 Biome (1.9.4)
v2/internal/frontend/runtime/runtime_prod_desktop.js
[error] 1-1: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 1-1: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 1-1: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 1-1: Avoid redundant double-negation.
It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation
(lint/complexity/noExtraBooleanCast)
[error] 1-1: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 1-1: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 1-1: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 1-1: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Run Go Tests (windows-latest, 1.23)
🔇 Additional comments (137)
.github/workflows/generate-sponsor-image.yml (1)
27-36
: Upgrade Action Version for Create Pull Request StepThe workflow now uses
peter-evans/create-pull-request@v6
instead of the previous version. This upgrade can bring improvements and bug fixes. Please verify that all input parameters (e.g.,commit-message
,add-paths
,title
,body
,branch
,delete-branch
) are still valid for the new version and that no additional configuration is required based on the v6 documentation.v2/internal/frontend/desktop/darwin/WailsContext.m (1)
598-598
: LGTM! Consistent implementation of hidden files visibility.The implementation correctly sets the
showsHiddenFiles
property of the file dialog, ensuring consistent behavior with the save dialog implementation at line 695.v2/pkg/commands/buildtags/buildtags.go (2)
11-11
: LGTM! Documentation spelling fix.The spelling correction from "delimeted" to "delimited" improves documentation clarity.
13-43
: Excellent implementation of the Parse function!The implementation is robust with:
- Clear error handling for mixed separators
- Proper handling of empty input and single tag cases
- Consistent whitespace trimming
website/docs/community/showcase/kafka-king.mdx (1)
1-2
: Header Definition Review
The header "Kafka-King" is appropriately defined to introduce the subject. Ensure it aligns with the naming and branding guidelines across the documentation.v2/internal/staticanalysis/test/standard/go.mod (2)
28-28
: Dependency Upgrade: golang.org/x/crypto Version Change
The upgrade to version v0.21.0 appears intentional. Please verify that there are no breaking API changes with this newer version and that all dependent code has been tested against it.
30-31
: Dependency Upgrades: golang.org/x/net and golang.org/x/sys Versions
Both dependencies have been upgraded to v0.23.0 and v0.18.0 respectively. Ensure that these versions align with the requirements of the rest of the codebase and that any changes in behavior between versions have been thoroughly verified.v2/examples/customlayout/go.mod (2)
32-32
: Dependency Upgrade: golang.org/x/crypto Version Change
The update to version v0.21.0 for golang.org/x/crypto is consistent with changes in other modules. Double-check that all usages of this package in the project are compatible with the new version.
34-35
: Dependency Upgrades: golang.org/x/net and golang.org/x/sys Versions
Both golang.org/x/net and golang.org/x/sys have been updated to v0.23.0 and v0.18.0 respectively. Confirm that these changes do not introduce any unexpected behavior in the custom layout example and that integration with the overall project remains seamless.website/i18n/ja/docusaurus-plugin-content-pages/credits.mdx (2)
3-8
: Contributor Removal in Credits Section:
The contributors in these lines (Lea Anthony, Stffabi, Travis McLane, Atterpac, Simon Thomas, and Lyimmi) have been removed from the credits. This update appears to reflect the project’s current contributor list. Please ensure that these removals have been coordinated with the team and that the updated credits align with the project’s contribution records.
268-268
: Update for "Wang, Chi" Link:
The GitHub link for Wang, Chi has been updated tohttps://github.com/branchseer
, which is in line with the intended correction. Please verify that this new link accurately represents the contributor’s profile and is consistent with other documentation.v2/internal/go-common-file-dialog/cfd/iShellItem.go (2)
33-35
: LGTM! Good memory management practice.The deferred cleanup of the allocated string memory is a good practice to prevent memory leaks, especially in case of early returns or panics.
49-49
: LGTM! Good style improvement.The added trailing comma after the SIGDN_FILESYSPATH constant value improves readability and makes future additions cleaner in git diffs.
v2/internal/frontend/runtime/desktop/events.js (2)
93-94
: LGTM! Improved safety with optional chaining.The use of optional chaining (
?.
) and creating a copy of the listener list withslice()
enhances code robustness by preventing potential null reference errors.
96-97
: LGTM! Enhanced iteration safety.The changes improve the code by:
- Checking list length before processing
- Using a copied list for iteration to prevent modification issues during iteration
Also applies to: 100-104
v2/internal/frontend/runtime/desktop/draganddrop.js (2)
54-54
: LGTM! Enhanced drag-and-drop visual feedback.Setting
dropEffect
to 'copy' provides better visual feedback to users during drag operations.
149-157
: LGTM! Improved code organization.The reordering of drop target deactivation logic after file processing provides better code flow and maintains the same functionality.
v2/pkg/assetserver/webview/responsewriter_darwin.go (1)
72-72
: LGTM!The addition of the "fmt" package is necessary for error formatting in the new error handling code.
v2/internal/frontend/dispatcher/dispatcher.go (2)
5-5
: LGTM!The addition of the "fmt" package import is appropriate for the new error handling functionality.
34-45
: LGTM! Robust error handling implementation.The defer block implements comprehensive panic recovery and error handling, with proper type assertions and logging.
website/docs/guides/sveltekit.mdx (2)
17-18
: Clarified Frontend Initialization Command
The updated instructions now state:
##### While in the Wails project root. Use the Svelte CLI to create a SvelteKit project as the new frontend. Follow the prompts, nothing Wails specific is needed here.
and then the command:
- npx sv create frontend
This change simplifies the process and removes any Wails-specific prompts, which improves clarity.
I recommend verifying that the aliassv
is the intended and supported CLI command for initializing a SvelteKit project, as many setups still use commands likecreate-svelte
.
111-111
: Correction of Typographical Error in Heading
The heading on line 111 has been updated from “Inital data” to “Initial data,” which fixes the typo and improves readability.v2/internal/github/github.go (2)
6-6
: LGTM!The import of
github.com/charmbracelet/glamour/styles
is correctly placed and aligns with the TUI enhancement goals.
43-43
: Verify glamour package version compatibility.The change from
glamour.NoTTYStyleConfig
tostyles.NoTTYStyleConfig
suggests a breaking change in the glamour library. Let's verify the compatibility and latest version.✅ Verification successful
🌐 Web query:
What is the latest version of github.com/charmbracelet/glamour and when was NoTTYStyleConfig moved to the styles package?
💡 Result:
The latest version of `github.com/charmbracelet/glamour` is **v0.8.0**, released on August 5, 2024[10]. This version introduced the **Tokyo Night** theme as a built-in style[10]. The `NoTTYStyleConfig` was moved to the `styles` package in this release, as evidenced by its inclusion in the package's constants alongside other default styles like `DarkStyle` and `LightStyle`[8]. The documentation explicitly lists `NoTTYStyle` as one of the predefined style constants available in the `styles` package[8]. This change allows developers to reference non-TTY terminal styling configurations directly via the styles package rather than custom implementations[1][8]. Citations: - 1: https://github.com/charmbracelet/glamour - 2: https://help.figma.com/hc/en-us/articles/360039820134-Manage-and-share-styles - 3: https://github.com/charmbracelet - 4: https://github.com/charmbracelet/gum/releases - 5: https://pkg.go.dev/github.com/jahvon/glamour/styles - 6: https://github.com/charmbracelet/glow/releases - 7: https://pkg.go.dev/git.collapse.pub/sevvie/glamour - 8: https://pkg.go.dev/github.com/charmbracelet/glamour/styles - 9: https://www.npmjs.com/package/glamor/v/2.7.0 - 10: https://github.com/charmbracelet/glamour/releases
Glamour Library Version Compatibility Confirmed.
- The change to
styles.NoTTYStyleConfig
aligns with version v0.8.0 ofgit.f4.workers.dev/charmbracelet/glamour
(released August 5, 2024), where the configuration was moved to thestyles
package.- No further modifications are necessary regarding this breaking change.
v2/internal/menumanager/processedMenu.go (2)
26-28
: LGTM! Consistent naming convention applied.The field name change from
Submenu
toSubMenu
follows Go's standard naming conventions and is consistently applied in the comments and field declaration.
26-28
: Verify the impact of the JSON field name change.The field name change from
Submenu
toSubMenu
could affect JSON serialization/deserialization in dependent code.Let's verify the usage of this field in JSON operations:
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Search for JSON operations involving the Submenu/SubMenu field rg -i --type go '(json.*submenu|unmarshal.*processedmenuitem|marshal.*processedmenuitem)' # Search for test files that might need updates fd -e go -E 'vendor' testLength of output: 3608
JSON Serialization Unaffected by Tag Change
The JSON key remains
"SubMenu"
because when no explicit key is provided in the tag (i.e.json:",omitempty"
), Go’s JSON encoder uses the field’s name—in this case"SubMenu"
—by default. Therefore, dependent JSON operations (both marshalling and unmarshalling) continue to target the same key as before.
- Impact Assessment:
- The field formerly had an explicit tag (
"SubMenu,omitempty"
) while now it uses the default derived from the field name.- Since the field name remains unchanged (
SubMenu
), JSON serialization/deserialization is not affected by the removal of the explicit JSON key.Additional test files in our codebase do not reveal any conflicting JSON operations regarding this field name.
v2/internal/system/packagemanager/eopkg.go (1)
43-43
: LGTM! Verify package name in Solus repository.The change from
pkg-config
topkgconf
is correct as Solus Linux usespkgconf
as their implementation of pkg-config.Let's verify the package name in the Solus repository:
❌ Verification inconclusive
🏁 Script executed:
#!/bin/bash # Description: Verify that 'pkgconf' is the correct package name in Solus repository # and that it provides pkg-config functionality # Use curl to fetch the Solus package database curl -s "https://packages.getsol.us/shannon/api/v1/package/pkgconf" | jq -r '.[] | select(.name=="pkgconf") | .description' # This should show that pkgconf is indeed the pkg-config implementation in SolusLength of output: 123
I'll generate a new shell script to retrieve the raw JSON data for
pkgconf
from the Solus package repository. If this still returns no output, it would be best to manually verify the package details.Please run this script and review its output to ensure that
pkgconf
is the correct package name on Solus. Based on those results, you can then confirm that the change in the code is valid.
🏁 Script executed:
#!/bin/bash # Fetch raw JSON data for the pkgconf package from Solus repository curl -s "https://packages.getsol.us/shannon/api/v1/package/pkgconf"Length of output: 67
Manual Verification Required: Confirm Package Name Against Official Solus Documentation
The automated API call to verify that
pkgconf
is recognized on Solus did not return any output. Please manually verify that Solus Linux usespkgconf
for pkg-config functionality (e.g., via the official Solus package documentation or other reliable sources).v2/internal/go-common-file-dialog/cfd/iShellItemArray.go (1)
42-44
: LGTM! Syscall modernization.The update from
syscall.Syscall
tosyscall.SyscallN
is a good improvement as it provides better handling of syscall arguments.v2/internal/go-common-file-dialog/cfd/iFileSaveDialog.go (1)
79-79
: Verify StringToUUID function availability.The code now uses a local
StringToUUID
function instead of importing it from theutil
package.✅ Verification successful
🏁 Script executed:
#!/bin/bash # Search for StringToUUID function definition in the cfd package ast-grep --pattern 'func StringToUUID($_) $_'Length of output: 1149
Local
StringToUUID
function exists and is available in the package.
- The search confirms that the function is defined in
v2/internal/go-common-file-dialog/cfd/iFileOpenDialog.go
and is accessible within the same package asiFileSaveDialog.go
.- This verifies that the call to
StringToUUID(role)
iniFileSaveDialog.go
is valid without needing an import from theutil
package.v2/internal/frontend/desktop/windows/winc/w32/uxtheme.go (2)
86-89
: LGTM! Syscall modernization.The update to
syscall.SyscallN
is appropriate and consistent with modern Windows API usage patterns.
137-140
: LGTM! Consistent syscall updates.The changes in
OpenThemeData
andSetWindowTheme
maintain consistency with the syscall modernization pattern.Also applies to: 146-149
v2/internal/go-common-file-dialog/cfd/DialogConfig.go (2)
18-19
: LGTM! Prevent type obfuscation.Good practice to ensure the FileFilter type is never obfuscated during compilation.
122-125
: LGTM! Index validation.Good addition of range check for
SelectedFileFilterIndex
to prevent out-of-bounds access.v2/internal/go-common-file-dialog/cfd/iFileOpenDialog.go (3)
7-8
: LGTM: Import changes look good.The switch from a local
util
package to the well-maintainedgit.f4.workers.dev/google/uuid
package for UUID generation is a good choice.
167-170
: LGTM: Syscall change looks good.The change from
syscall.Syscall
tosyscall.SyscallN
is appropriate and maintains the same functionality while providing better flexibility for argument handling.
198-200
: LGTM: UUID generation implementation looks secure.The implementation uses SHA1-based UUID generation which is appropriate for this use case since it's being used for role identification rather than for security purposes.
v2/internal/frontend/desktop/windows/winc/w32/utils.go (3)
78-82
: LGTM: COM AddRef syscall update looks good.The change to
syscall.SyscallN
maintains the same functionality while aligning with the standardized approach to syscall handling.
86-90
: LGTM: COM Release syscall update looks good.The change to
syscall.SyscallN
is appropriate and maintains the same functionality.
95-98
: LGTM: COM QueryInterface syscall update looks good.The change to
syscall.SyscallN
is appropriate and maintains the same functionality.v2/internal/go-common-file-dialog/cfd/vtblCommonFunc.go (4)
47-54
: Great improvement: Added memory cleanup.The addition of deferred cleanup ensures that allocated memory for filter specifications is properly freed, preventing memory leaks.
171-172
: Improved error handling.The error message is now more descriptive, helping with debugging when
shellItem
is nil.
178-189
: Enhanced input validation.Good addition of nil check for the GUID parameter with a descriptive error message.
193-208
: Improved error handling and memory management.The changes include:
- Input validation for the extension string
- Proper memory cleanup with deferred free
- Clear code organization with comments
v2/internal/frontend/desktop/windows/winc/w32/user32.go (1)
795-798
: LGTM: Windows API syscall updates look good.The changes from
syscall.Syscall
tosyscall.SyscallN
across multiple Windows API functions are consistent and maintain the same functionality while providing better flexibility for argument handling.Also applies to: 835-836, 1228-1230, 1243-1246, 1250-1256, 1271-1274
.replit (1)
2-2
: Review path inconsistency in run commands.Both run commands use the
v2
path (v2/cmd/wails/main.go
), but the AI summary indicates changes inv3/internal/commands/init.go
. This path inconsistency needs clarification.Run the following script to verify the correct path:
Also applies to: 8-8
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Description: Check for the existence of main.go in both v2 and v3 paths echo "Checking v2 path..." fd -t f "main.go" "v2/cmd/wails" echo "Checking v3 path..." fd -t f "main.go" "v3/cmd/wails"Length of output: 329
Based on the repository structure, the run command in
.replit
is using the correct path—there is av2/cmd/wails/main.go
file—while no correspondingv3/cmd/wails
directory exists. It appears that the AI summary’s reference to changes inv3/internal/commands/init.go
may pertain to a different aspect of the project (perhaps new functionality or initialization logic) that isn’t used by the.replit
run command. In other words, the run command isn’t expected to reference the v3 path.Final Verdict: The run command in
.replit
is correct. Any reference to changes in the v3 path should be clarified separately.v2/pkg/buildassets/build/darwin/Info.plist (1)
9-9
: LGTM!The change to use
{{.OutputFilename}}
instead of{{.Name}}
forCFBundleExecutable
is consistent with the corresponding change inInfo.dev.plist
. This provides a more specific template variable for the executable name.v2/pkg/buildassets/build/darwin/Info.dev.plist (1)
9-9
: LGTM!The change to use
{{.OutputFilename}}
instead of{{.Name}}
forCFBundleExecutable
is consistent with the corresponding change inInfo.plist
. This provides a more specific template variable for the executable name.v2/pkg/commands/bindings/bindings.go (2)
23-24
: LGTM! Cross-compilation support added.The addition of Platform and Arch fields enables proper cross-compilation configuration.
58-62
: LGTM! Environment variables properly configured for cross-compilation.The implementation correctly sets GOOS and GOARCH environment variables for cross-compilation.
v2/pkg/buildassets/buildassets.go (2)
104-108
: LGTM! Template data structure enhanced.The addition of OutputFilename field enables proper template customization for output files.
116-120
: LGTM! Template data properly initialized.The OutputFilename is correctly populated from projectData.
v2/pkg/options/windows/windows.go (1)
122-123
: LGTM! Window class name customization added.The WindowClassName field allows proper customization of the window class name with a sensible default.
v2/internal/app/app_dev.go (1)
78-102
: Improved logging configuration logic!The changes enhance the logging configuration by:
- Using the application's default log level as the flag's default value
- Only overriding the logger's level when explicitly set via flag
- Adding proper validation for the log level string
v2/internal/frontend/desktop/windows/window.go (3)
42-47
: Well-documented field addition!The new
isMinimizing
field is well-documented with bilingual comments explaining its purpose in preventing unnecessary redraws during minimize/restore transitions for frameless windows.
81-87
: Improved window class name handling!The changes enhance flexibility by allowing custom window class names through the WindowClassName option.
351-363
: Well-implemented padding filter!The new SetPadding method effectively prevents flickering during minimize/restore operations by skipping unnecessary redraws. The implementation is well-documented and addresses a specific issue.
v2/pkg/commands/build/build.go (1)
234-235
: Enhanced binding generation with platform info!The addition of Platform and Arch fields to bindings.Options improves the binding generation process by providing platform-specific context.
v2/pkg/commands/build/base.go (2)
196-196
: LGTM! Build optimization with VCS info disabled.Adding
-buildvcs=false
can improve build speed and reduce binary size by excluding version control information.
312-314
: LGTM! Improved CGO flags handling for macOS.The check for existing
-mmacosx-version-min
prevents duplicate flags that could cause build issues.Also applies to: 351-353
v2/internal/frontend/desktop/windows/frontend.go (3)
173-179
: LGTM! Fixed window flickering during minimize/restore.Added
isMinimizing
flag to prevent unnecessary redraws during minimize/restore operations for frameless windows. This fixes the flickering issue reported in #3951.
183-186
: LGTM! Proper flag cleanup for size events.Clearing the minimizing flag for non-minimize size events ensures proper window behavior after restore.
754-758
: LGTM! Added null check for file objects.Added safety check to prevent crashes when handling invalid file drops.
.github/workflows/pr.yml (1)
59-60
: Go Version Update in Test Job.
Thetest_go
job now usesgo-version: ['1.23']
, which aligns with the dependency updates in thego.mod
file. Confirm that all tests pass under this version.website/docs/gettingstarted/installation.mdx (1)
18-18
: Updated Go Dependency Note.
The dependency note now clarifies that macOS 15+ requires Go 1.23.3+. This change correctly reflects the updated requirements; please verify that related documentation (if any) is also updated..github/workflows/build-and-test.yml (4)
41-45
: Simplified macOS Test Conditions.
The condition for running tests on macOS now usesmacos-latest
, and the environment variables (e.g.CGO_LDFLAGS
) have been adjusted accordingly. This simplification appears sound; just verify that the minimum macOS version requirements continue to be met.
123-128
: Enhanced Dependency Caching on Ubuntu 22.04.
Replacing direct apt-get installation commands withawalsh128/cache-apt-pkgs-action
is a positive improvement toward caching and quicker builds.
129-132
: Deprecation of Direct Apt Commands.
The previously used directapt-get
installation commands for Ubuntu 22.04 have been commented out in favor of the caching action. This is a welcome refactor, provided that the caching action reliably installs the specified packages.
133-138
: Consistent Caching Strategy for Ubuntu 24.04.
The caching action for Ubuntu 24.04 is now set up alongside the 22.04 configuration, with appropriate package updates (includinglibegl1
). This consistency helps streamline dependency management across versions.v2/go.mod (4)
3-5
: Updated Go Version and Toolchain Configuration.
The module now specifiesgo 1.23
along with a toolchain ofgo1.23.4
, which establishes a solid and updated foundation for the project.
7-12
: Dependency Upgrades Overview.
Key dependencies such asgit.f4.workers.dev/bitfield/script
andgit.f4.workers.dev/charmbracelet/glamour
have been updated to newer versions. Please ensure that these updates have been fully tested in the current codebase to avoid any subtle incompatibilities.
7-48
: Broad Dependency Upgrades Alert.
A comprehensive set of dependencies have been upgraded in this release. It is highly recommended to run a complete integration and regression test suite to verify that none of these upgrades introduce unforeseen issues.
50-117
: Indirect Dependencies Update.
The indirect dependency block has been refreshed with several new versions, from security-critical packages likegolang.org/x/term
to libraries such asgit.f4.workers.dev/yuin/goldmark
. Confirm that your build and test pipelines accommodate these updates without disruption.website/docs/community/templates.mdx (3)
30-31
: New Vue Template Entry: "wails-template-tdesign-js" Added
The new Vue template entry for TDesign UI is clearly described and follows the same formatting as the other entries. Please double-check that the URL and description accurately represent the template’s features.
45-45
: New React Template Entry: "wails-nextjs-tailwind-template" Added
The added React template expands the available options for Next.js projects. Ensure that the description accurately conveys that it uses Next.js with TailwindCSS and TypeScript.
51-51
: New Svelte Template Entry: "wails-vite-svelte-ts-tailwind-template" Added
The new Svelte template entry is formatted consistently with other templates. Confirm that the version of TailwindCSS specified (v3) meets the template’s requirements.website/docs/reference/menus.mdx (3)
18-20
: macOS Menu Initialization Enhancement
The conditional check forruntime.GOOS == "darwin"
followed by appending the app menu is correctly implemented. This ensures that the macOS-specific application menu is added immediately after creating the new menu.
26-29
: Using thert
Alias for Quit Action
Refactoring the Quit menu item to referencert.Quit(app.ctx)
instead of usingruntime.Quit
directly helps prevent namespace collisions. This change is sound and improves code clarity.
31-32
: Appending the Edit Menu on macOS
Appending theEditMenu
under a macOS-specific conditional is a correct approach. This enables the standard shortcuts (Cmd+C, Cmd+V, Cmd+Z, etc.) for macOS users.website/docs/guides/signing.mdx (2)
252-263
: Update to Gon Sign Configuration
In thegon-sign.json
snippet, the password field has been updated from an environment variable syntax to a literal description ("your-app-specific-password"
). This change clarifies the expected value now that the deprecated@env:
syntax is no longer supported.
276-277
: Deprecated@env:
Syntax Notice
The note explaining that the deprecated Apple's altool syntax (@env:
) is no longer available is clear and informative. This helps users understand why the configuration has been updated.website/docs/reference/options.mdx (4)
102-104
: Clarify WindowClassName Default Value
The new Windows options block now includes aWindowClassName
field with a default value of"MyWindow"
, yet the accompanying comment states that if empty, it will default to'wailsWindow'
. Please confirm whether the default is intended to be"MyWindow"
or if it should follow the documented fallback value.
537-540
: Reinstate ZoomFactor Field
TheZoomFactor
field has been reinstated with a clear type (float64
) and description. Please double-check that its behavior in the Go implementation matches the documentation.
542-544
: Reinstate IsZoomControlEnabled Field
The documentation now includes theIsZoomControlEnabled
field with its type (bool
) and a description explaining that it allows users to change the zoom factor. Verify that the phrasing accurately reflects the functionality provided by the underlying implementation.
809-815
: Consistency in Documenting WindowClassName
A separate section forWindowClassName
has been added later in the document. Please check that its description and default behavior remain consistent with the earlier mention in the Windows options block.website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx (3)
537-540
: Réintégration du champ ZoomFactor
Le champZoomFactor
est réintroduit avec sa description en français. Veuillez vous assurer que la fonctionnalité décrite correspond bien à l’implémentation et que les espaces insécables sont utilisés avant les deux-points conformément aux règles typographiques françaises.🧰 Tools
🪛 LanguageTool
[uncategorized] ~538-~538: Les deux-points sont précédés d’une espace insécable.
Context: ... | #### ZoomFactor Nom: ZoomFactor
Type:float64
Ceci d...(FRENCH_WHITESPACE)
[uncategorized] ~539-~539: Les deux-points sont précédés d’une espace insécable.
Context: ... #### ZoomFactor Nom: ZoomFactor
Type:float64
Ceci définit le facteur de z...(FRENCH_WHITESPACE)
542-544
: Réintégration du champ IsZoomControlEnabled
Le champIsZoomControlEnabled
est ajouté pour permettre le contrôle du zoom par l’utilisateur. Vérifiez que le libellé et la ponctuation respectent les contraintes typographiques françaises afin d’améliorer la lisibilité.
809-812
: Section WindowClassName en français
La section dédiée àWindowClassName
est ajoutée ici. Veuillez confirmer que la description (même si partiellement en anglais) est cohérente avec la version anglaise et que le comportement par défaut (retour à'wailsWindow'
si vide) est clairement indiqué.website/docs/guides/mac-appstore.mdx (1)
84-87
: Enhanced Quotation in Signing Commands
Les modifications apportées aux commandescodesign
etproductbuild
– avec l’ajout de guillemets autour des chemins d’accès – améliorent la robustesse des scripts. Vérifiez que ces ajustements sont correctement testés et qu’ils respectent les bonnes pratiques de citation en shell.v2/pkg/templates/templates/lit/frontend/wailsjs/runtime/runtime.d.ts (1)
127-129
: Breaking Change: WindowSetSize no longer returns a Promise.The function signature change from
Promise<Size>
tovoid
is a breaking change that affects all frontend templates. This change:
- Simplifies the API by making it synchronous
- Removes the ability to wait for the size change completion
- Removes the ability to get the final window size after the change
Please verify the following:
- Update the documentation at https://wails.io/docs/reference/runtime/window#windowsetsize
- Search for existing usages that depend on the Promise return value:
If you need to get the window size after setting it, you'll need to make a separate call to
WindowGetSize()
. Example migration:-const newSize = await WindowSetSize(800, 600); +WindowSetSize(800, 600); +const newSize = await WindowGetSize();❌ Verification inconclusive
🏁 Script executed:
#!/bin/bash # Search for await/then usage of WindowSetSize rg -A 2 "await.*WindowSetSize|WindowSetSize.*then"Length of output: 52
Action Required: Manually verify potential promise usages of WindowSetSize
Our automated search for patterns likeawait WindowSetSize
and.then
onWindowSetSize
returned no matches, which strongly suggests that no code currently relies on a Promise being returned from this function. However, given the low output and the importance of this breaking change, please manually verify that:
- The documentation at https://wails.io/docs/reference/runtime/window#windowsetsize is updated to reflect that
WindowSetSize()
is now synchronous, returningvoid
, and no longer provides the final window size.- There are no hidden usages in the codebase that expect a Promise (for example, any indirect chaining or dynamic usages that might not match our automated patterns).
If obtaining further confidence is necessary, consider running additional searches (e.g., a full-string search for
WindowSetSize(
in all files) or reviewing usage in sections where window sizing is adjusted.v2/pkg/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.d.ts (1)
127-129
: Skipping review as changes are identical to the previous file.v2/pkg/templates/templates/lit-ts/frontend/wailsjs/runtime/runtime.d.ts (1)
127-129
: Skipping review as changes are identical to the previous file.v2/pkg/templates/templates/react-ts/frontend/wailsjs/runtime/runtime.d.ts (1)
127-129
: Skipping review as changes are identical to the previous file.v2/pkg/templates/templates/vanilla-ts/frontend/wailsjs/runtime/runtime.d.ts (1)
129-129
: Breaking Change: WindowSetSize no longer returns a Promise.The change from
Promise<Size>
tovoid
return type is a breaking change that affects error handling and size verification workflows. Consider the following impacts:
- Existing code waiting for the Promise to resolve will break
- No way to verify if the size was set successfully
- Inconsistent with other window methods that return Promises
Let's verify the impact by searching for existing usage patterns:
Recommended Solutions:
- Keep the Promise return type for consistency and backwards compatibility
-export function WindowSetSize(width: number, height: number): void; +export function WindowSetSize(width: number, height: number): Promise<Size>;
- If synchronous behavior is required, consider adding a new method:
export function WindowSetSizeSync(width: number, height: number): void;
- Document the migration path for existing code:
// Old code const newSize = await WindowSetSize(800, 600); // New code await WindowSetSize(800, 600); const newSize = await WindowGetSize();❌ Verification inconclusive
🏁 Script executed:
#!/bin/bash # Search for WindowSetSize usage patterns in TypeScript/JavaScript files rg -A 2 'WindowSetSize.*then' --type ts --type js # Search for await usage rg -A 2 'await.*WindowSetSize' --type ts --type jsLength of output: 104
Breaking Change Impact – Manual Verification Needed
Our search did not reveal any instances whereWindowSetSize
is used with promise chaining (i.e. with.then
) or withawait
in the repository’s TypeScript/JavaScript files. This suggests that internal usage might not currently depend on it returning a Promise. However, it remains unclear if external consumers or integrations—who may expect aPromise<Size>
return type for error handling and size verification—are affected.
- No internal usages indicate await or .then usage were found.
- External dependencies or previously established workflows might rely on the Promise return for error handling.
- Consider verifying with external consumers and updating documentation/migration guides if necessary.
v2/pkg/templates/templates/vanilla/frontend/wailsjs/runtime/runtime.d.ts (1)
129-129
: Identical breaking change in vanilla template.The same concerns about the
WindowSetSize
return type change apply to this file.v2/pkg/templates/templates/svelte-ts/frontend/wailsjs/runtime/runtime.d.ts (1)
129-129
: Identical breaking change in svelte-ts template.The same concerns about the
WindowSetSize
return type change apply to this file.v2/pkg/templates/templates/vue-ts/frontend/wailsjs/runtime/runtime.d.ts (1)
129-129
: Identical breaking change in vue-ts template.The same concerns about the
WindowSetSize
return type change apply to this file.v2/pkg/templates/templates/vue/frontend/wailsjs/runtime/runtime.d.ts (1)
129-129
: Breaking change in WindowSetSize return type.The function signature change from
Promise<Size>
tovoid
is a breaking change that affects all frontend templates. This change:
- Makes the function synchronous instead of asynchronous
- Removes the ability to get the window size after setting it
Please verify the following:
Run this script to find code that depends on the Promise return value:
Update the documentation at https://wails.io/docs/reference/runtime/window#windowsetsize to reflect this change.
Consider providing an alternative way to get the window size after setting it, such as:
- Using
WindowGetSize()
afterWindowSetSize()
- Using event listeners to notify when the window size changes
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Description: Find code that awaits WindowSetSize or uses .then() on its result # Search for await WindowSetSize rg -A 5 'await\s+WindowSetSize' # Search for .then() usage rg -A 5 'WindowSetSize.*\.then'Length of output: 67
I'll run an additional search for any direct references to
WindowSetSize
in the codebase to check if there are other indications of usage that might depend on its previous Promise return value.
🏁 Script executed:
#!/bin/bash # Description: Find any reference to WindowSetSize in the repository to verify whether its invocation # or chaining might expect a Promise return. rg -n "WindowSetSize"Length of output: 37749
Verification of WindowSetSize Return Type Change
- The initial searches for
await WindowSetSize
and.then
usage produced no results, which indicates that no internal code expects a Promise return.- Additional repository-wide search shows that all template declarations of
WindowSetSize
now explicitly returnvoid
.- The documentation in many parts of the codebase and the changelog (e.g., changelog note in
website/src/pages/changelog.mdx
) reflects this change, although the external docs (e.g., at wails.io) should be updated if they still mention a Promise return or behavior inconsistent with these changes.- It appears that consumers who relied on the previous asynchronous behavior would indeed be impacted. However, there is no evidence of internal code expecting a Promise, and using alternatives like invoking
WindowGetSize()
after setting the size would be the recommended approach.Please ensure the external documentation at https://wails.io/docs/reference/runtime/window#windowsetsize is updated accordingly.
v2/pkg/templates/templates/svelte/frontend/wailsjs/runtime/runtime.d.ts (1)
129-129
: Duplicate of previous comment on WindowSetSize.v2/pkg/templates/templates/preact-ts/frontend/wailsjs/runtime/runtime.d.ts (1)
129-129
: Duplicate of previous comment on WindowSetSize.v2/pkg/templates/templates/react/frontend/wailsjs/runtime/runtime.d.ts (1)
129-129
: Duplicate of previous comment on WindowSetSize.v2/pkg/templates/templates/preact/frontend/wailsjs/runtime/runtime.d.ts (1)
129-129
: Consider implications of removing Promise return type.The change from
Promise<Size>
tovoid
is a breaking change that:
- Removes ability to confirm window size was set successfully
- Creates inconsistency with other async window operations
- May affect error handling in existing code
Please verify:
- Impact on existing code that awaits WindowSetSize
- Error handling strategy for failed resize operations
❌ Verification inconclusive
🏁 Script executed:
#!/bin/bash # Search for code awaiting WindowSetSize calls rg -A 2 "await.*WindowSetSize"Length of output: 32
I'll now run an additional search to look for any references to
WindowSetSize(
outside of the declaration file. This will help determine if any parts of the codebase rely on its previous async (Promise-based) behavior.
🏁 Script executed:
#!/bin/bash rg -n "WindowSetSize(" | grep -v "runtime.d.ts"Length of output: 248
Action Required: Verify the Impact of Removing the Promise Return Type for
WindowSetSize
Our automated searches did not reveal any usage where
WindowSetSize
is awaited (or chained with.then()
), which suggests that, within the current codebase, consumers might not be expecting a Promise-based result. However, this doesn’t fully rule out potential impacts on clients (or external consumers) that may rely on error propagation or confirmation signals provided by a Promise.• No awaited usage of
WindowSetSize
was detected beyond its type definition.
• The inconsistency with similar window functions (e.g.,WindowGetSize
) remains a concern for error handling and API uniformity.Please manually verify whether any client code (including external integrations) assumes asynchronous confirmation or error propagation for window resizing.
v2/internal/frontend/runtime/wrapper/runtime.d.ts (1)
137-137
: LGTM - Consistent with other runtime definitions.The signature change matches the modification in the preact template, confirming this is an intentional architectural change.
website/docs/reference/runtime/events.mdx (1)
21-21
: LGTM - Documentation improvement.The updated description better explains the EventsOff functionality, particularly the ability to unregister multiple listeners.
v2/internal/go-common-file-dialog/cfdutil/CFDUtil.go (2)
1-46
: Verify integration with TUI initialization featureWhile the code changes improve resource management, please clarify how these dialog utilities integrate with the new TUI initialization feature mentioned in the PR objectives.
Let's check for usage of these dialog functions in the TUI initialization code:
❌ Verification inconclusive
🏁 Script executed:
#!/bin/bash # Search for usage of dialog functions in TUI initialization rg -l "Show(Open|Save|PickFolder)" "v3/internal/commands/"Length of output: 58
Integration of Dialog Utilities with TUI Initialization Requires Clarification
The search in the
v3/internal/commands/
directory did not reveal any usage of the dialog utilities. This absence suggests that either the integration with TUI initialization is not implemented in that directory, or the functions are expected to be integrated elsewhere. Please confirm whether:
- These dialog functions are intended to be used by the TUI initialization code.
- The integration is planned for a different location in the codebase or handled indirectly.
- Additional documentation or example usage should be provided for clarity.
13-13
: Verify error handling for dialog.Release()The simplified defer statement improves code readability. However, we should verify if Release() errors need to be handled.
Let's check the Release() implementation and error cases:
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Search for Release() implementation and its error cases ast-grep --pattern 'func ($dialog *$_) Release() error { $$$ }'Length of output: 67
I'll broaden the search to locate the
Release()
implementation and verify whether it returns an error. Please stand by while I execute a broader search usingrg
.
🏁 Script executed:
#!/bin/bash # Search for any function definitions containing Release rg 'func .*Release\(' -n .Length of output: 2489
I'll gather additional context regarding the type of the
dialog
variable used inv2/internal/go-common-file-dialog/cfdutil/CFDUtil.go
to check if itsRelease()
method indeed returns an error that should be handled.
🏁 Script executed:
#!/bin/bash # Locate usage of "defer dialog.Release()" in CFDUtil.go to gather context on dialog's type. rg "dialog := " -n v2/internal/go-common-file-dialog/cfdutil/CFDUtil.goLength of output: 73
I'll now inspect the implementation of the
Release()
method for the file dialogs in the repository (specifically in theiFileOpenDialog
file) to see what kinds of errors may be returned and whether ignoring them is acceptable.
🏁 Script executed:
#!/bin/bash # Display context around the Release() implementation in iFileOpenDialog.go sed -n '80,110p' v2/internal/go-common-file-dialog/cfd/iFileOpenDialog.goLength of output: 1295
Deferred Release() Error Handling Is Consistent by Design
Our review of the code indicates that the
Release()
method (as implemented in files likeiFileOpenDialog.go
) returns an error. The previous implementation already wrapped this call in an anonymous function where the error was ignored, and the simplifieddefer dialog.Release()
maintains that behavior. If logging or handling a potential error during resource cleanup were deemed necessary, additional handling should be added. However, based on the repository’s established pattern, ignoring the error here is intentional and acceptable.v2/internal/typescriptify/typescriptify.go (9)
47-55
: Consider multi-parameter generics.If a type name includes multiple nested brackets (e.g.,
SomeType[ParamA[Sub],ParamB]
), splitting solely on the first bracket aggregates everything after that into one segment. Clarify whether this behavior is desired or if a more granular approach is needed.
537-537
: No issues found.Using
nameTypeOf
to build enum names is consistent with the rest of the code.
588-593
: LGTM: Properly ignoring non-JSON-serializable fields.Skipping channels, functions, unsafe pointers, and complex types is consistent with typical JSON limitations.
643-643
: Consistent naming convention.Appending prefix/suffix to the type name is in line with the approach for enums and other structs.
850-855
: Logical fallback to "any" is consistent.Defaulting to "any" for unrecognized array element kinds is a sensible approach to avoid compile-time errors in TypeScript.
874-880
: Uniform fallback to "any" is consistent with the codebase.The same fallback strategy for simple fields (if the kind is unknown) ensures coverage for all cases.
904-904
: Consistently applyingnameTypeOf
for enum fields.This maintains naming consistency for enumerated fields in generated TypeScript.
913-913
: Consistent naming approach for struct fields.Drawing from
nameTypeOf
follows the same pattern used elsewhere, preventing unsafe characters in TS identifiers.
932-932
: Aligned with naming conventions for arrays of structs.Applying
nameTypeOf
for nested struct arrays preserves consistency in the generated type names.v2/internal/binding/binding_test/binding_nonstringmapkey_test.go (1)
21-21
: UsingRecord<number, any>
is simpler and more idiomatic.Replacing
{[key: number]: any}
withRecord<number, any>
clarifies the type definition while preserving the original intent.v2/internal/binding/binding_test/binding_ignored_test.go (4)
1-8
: No immediate concerns.Package declaration and references to issues 3755 and 3809 look appropriate.
9-16
: Struct demonstrates ignoring non-serializable fields.Including channels, complex types, and an unsafe pointer is suitable for testing how the generator handles unsupported JSON types.
18-20
: Straightforward getter function.No issues with returning the struct instance.
22-47
: Comprehensive test definition for ignored fields.The
want
block confirms that only serializable fields (e.g.,Valid
) appear in the generated TypeScript code.v2/internal/binding/binding_test/binding_notags_test.go (2)
3-9
: LGTM! Good test coverage of different field types.The struct definition provides comprehensive coverage by including:
- Basic string fields
- Pointer types
- Recursive struct references
- Function type fields
7-8
: Consider adding test cases for nil pointer handling.While the test structure is good, it would be valuable to add test cases that explicitly verify the handling of nil pointers for both
Zip
andSpouse
fields.❌ Verification inconclusive
🏁 Script executed:
#!/bin/bash # Check if there are any existing nil pointer tests rg -l "nil.*Zip|nil.*Spouse" .Length of output: 32
Action Required: Add Nil Pointer Test Cases for Zip and Spouse Fields
The grep command confirmed that there aren’t any tests explicitly handling nil pointers for the Zip or Spouse fields. Consider adding tests to verify the behavior when these pointers are nil:
- Add test cases to explicitly verify handling of a nil Zip field.
- Add test cases to explicitly verify handling of a nil Spouse field.
v2/internal/binding/binding_test/binding_test.go (1)
53-57
: LGTM! Good test coverage expansion.The addition of new test cases enhances the test suite with coverage for:
- Structs without field tags
- Generic type handling
- Ignored fields
- Deep element structures
v2/internal/binding/binding_test/binding_type_alias_test.go (1)
18-18
: LGTM! Improved TypeScript type definitions.The change from index signature syntax to
Record
type is a good improvement as it:
- Uses more idiomatic TypeScript
- Provides better type safety
- Maintains the same functionality with clearer syntax
Also applies to: 22-22
v2/internal/binding/binding_test/binding_importedmap_test.go (1)
53-53
: LGTM! Consistent type definition improvement.The change to use
Record
type maintains consistency with other similar changes in the codebase and follows TypeScript best practices.v2/internal/binding/generate_test.go (2)
119-119
: LGTM! Map type conversion updated to use TypeScript's Record type.The change from
{[key: string]: type}
toRecord<string, type>
is a good improvement as it uses TypeScript's built-in utility type, which is the recommended way to define map/dictionary types.Also applies to: 124-124
131-140
: LGTM! Test cases added for generic type conversion.The new test cases properly validate the conversion of generic types with both primitive (
string
) and complex (*net/http.Request
) type parameters.v2/internal/binding/reflect.go (1)
169-170
: LGTM! Optimized string splitting.Using
strings.SplitN
with n=2 is more efficient thanstrings.Split
as it stops after finding the first occurrence, which is all we need for package and type name separation.v2/internal/binding/binding_test/binding_deepelements_test.go (2)
3-3
: LGTM! Test addresses multiple GitHub issues.The test file properly addresses issues #2303, #3442, and #3709 related to deep element binding.
9-31
: LGTM! Comprehensive test structure for deep elements.The
DeepElements
struct provides excellent coverage of various complex scenarios:
- Multi-dimensional slices and arrays
- Maps with different value types
- Nested structs with pointers
v2/internal/binding/binding_test/binding_generics_test.go (2)
5-5
: LGTM! Test addresses multiple GitHub issues.The test file properly addresses issues #3900, #3371, and #2323 related to generic type binding.
7-12
: LGTM! Well-structured generic paginated list.The
ListData[T]
struct is well-designed with:
- Proper pagination fields
- Generic type parameter for list items
- Appropriate JSON tags
v2/internal/binding/generate.go (2)
174-176
: LGTM! Good practice using a regex constant for unsafe characters.The regex pattern
[^A-Za-z0-9_]
correctly matches any character that is not alphanumeric or underscore, which aligns with JavaScript variable naming rules.
231-231
: LGTM! Good improvement using TypeScript's Record type.The change from object literal syntax to
Record<K, V>
is more idiomatic TypeScript and provides better type safety.v2/internal/binding/binding.go (4)
265-267
: LGTM! Good handling of nested pointer types.The loop correctly handles multiple levels of pointer indirection to get to the underlying type.
271-271
: LGTM! Clear and concise condition.The simplified condition
field.Anonymous || !field.IsExported()
is more readable and maintains the same functionality.
353-359
: LGTM! Comprehensive check for unsupported JSON types.The validation correctly identifies all types that cannot be JSON-encoded: channels, functions, unsafe pointers, and complex numbers.
361-363
: LGTM! Simplified JSON field export check.The early return when finding an exported field without a JSON tag is a good optimization.
website/i18n/ar/docusaurus-plugin-content-docs/current/community/templates.mdx
Outdated
Show resolved
Hide resolved
eugh I screwed up and merged master instead of v3. I think its reverted.. but ye. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
v3/internal/commands/init.go (4)
124-133
: Improve error messaging for better user experience.The error message "project name is required" after interactive mode might be confusing since the user just went through the form. Consider providing more context about why the project creation failed.
if options.ProjectName == "" { - return fmt.Errorf("project name is required") + return fmt.Errorf("project creation failed: project name is required. Please ensure you provide a valid project name in the interactive form") }
278-306
: Simplify template ordering logic.The template ordering logic is complex and could be simplified. Consider extracting it to a separate function for better maintainability.
+func orderTemplates(defaultTemplates []templates.TemplateData) []templates.TemplateData { + vanillaTemplate := templates.TemplateData{Name: "vanilla", Description: ""} + orderedTemplates := make([]templates.TemplateData, 0, len(defaultTemplates)+1) + + // Add vanilla first if it exists in defaultTemplates + for _, t := range defaultTemplates { + if t.Name == "vanilla" { + orderedTemplates = append(orderedTemplates, t) + break + } + } + + // If vanilla wasn't found, add the default vanilla template + if len(orderedTemplates) == 0 { + orderedTemplates = append(orderedTemplates, vanillaTemplate) + } + + // Add remaining templates + for _, t := range defaultTemplates { + if t.Name != "vanilla" { + orderedTemplates = append(orderedTemplates, t) + } + } + + return orderedTemplates +} templateSelect.OptionsFunc(func() []huh.Option[string] { defaultTemplates := templates.GetDefaultTemplates() - // Reorder templates: Ensure "vanilla" is first - vanillaTemplate := templates.TemplateData{Name: "vanilla", Description: ""} - orderedTemplates := []templates.TemplateData{} - vanillaFound := false - for _, t := range defaultTemplates { - if t.Name == vanillaTemplate.Name { - orderedTemplates = append([]templates.TemplateData{t}, orderedTemplates...) - vanillaFound = true - } else { - orderedTemplates = append(orderedTemplates, t) - } - } - if !vanillaFound { - orderedTemplates = append([]templates.TemplateData{vanillaTemplate}, orderedTemplates...) - } + orderedTemplates := orderTemplates(defaultTemplates)
308-313
: Extract form styling to a constant.The form styling configuration could be moved to a package-level constant to improve maintainability and reusability.
+var defaultFormStyle = lipgloss.NewStyle(). + BorderStyle(lipgloss.RoundedBorder()). + BorderForeground(lipgloss.Color("62")). + Padding(1, 2). + Margin(1, 0) -formStyle := lipgloss.NewStyle(). - BorderStyle(lipgloss.RoundedBorder()). - BorderForeground(lipgloss.Color("62")). - Padding(1, 2). - Margin(1, 0) +formStyle := defaultFormStyle
201-333
: Consider adding unit tests for the interactive form.The new interactive form functionality is complex and would benefit from unit tests to ensure reliability.
Would you like me to help create unit tests for the
startInteractive
function? We can mock the form inputs and verify the returned options.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
v3/internal/commands/init.go
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Run Go Tests (macos-latest, 1.23)
- GitHub Check: Run Go Tests (windows-latest, 1.23)
🔇 Additional comments (2)
v3/internal/commands/init.go (2)
10-11
: LGTM! Well-chosen TUI libraries.The addition of
charmbracelet/huh
andlipgloss
libraries is appropriate for implementing an interactive TUI feature.
316-320
: Return on form error to prevent continued execution.After a form error, you only log it, but you continue running the rest of the code. If the form fails, the program might end up with incomplete data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
v3/internal/commands/init.go (1)
311-315
: Return on form error to prevent continued execution.After a form error, you only log it before returning. Consider wrapping the error with more context.
Apply this diff to improve error handling:
err := form.Run() if err != nil { - term.Error(err) - return nil, err + term.Error(fmt.Errorf("Interactive form failed: %w", err)) + return nil, fmt.Errorf("form execution failed: %w", err) }
🧹 Nitpick comments (3)
v3/internal/commands/init.go (3)
124-133
: Improve error handling for interactive mode.While the error handling is present, it could be more descriptive. Consider wrapping the error from
startInteractive
to provide more context about where the error occurred.Apply this diff to improve error handling:
if options.ProjectName == "" { interactiveOptions, err := startInteractive(options) if err != nil { - return err + return fmt.Errorf("interactive project initialization failed: %w", err) } options = interactiveOptions if options.ProjectName == "" { - return fmt.Errorf("project name is required") + return fmt.Errorf("project name is required but was not provided in interactive mode") } }
275-301
: Improve template selection robustness.The template selection logic could be more robust:
- Consider caching template options to avoid repeated calls to
GetDefaultTemplates()
- Add validation for template existence
- Document why "vanilla" is the preferred default
Apply this diff to improve the implementation:
templateSelect.OptionsFunc(func() []huh.Option[string] { + // Cache templates to avoid repeated calls + if len(templateOptions) > 0 { + return templateOptions + } + defaultTemplates := templates.GetDefaultTemplates() + // "vanilla" is our default template as it provides the most basic starting point vanillaTemplate := templates.TemplateData{Name: "vanilla", Description: ""} orderedTemplates := []templates.TemplateData{} vanillaFound := false
208-214
: Document default values and add validation.The code sets default values but lacks documentation and validation for the version format.
Apply this diff to improve the implementation:
+// Default product version when not specified +const defaultProductVersion = "1.0.0" + if options == nil { options = &flags.Init{ - ProductVersion: "1.0.0", + ProductVersion: defaultProductVersion, } } else if options.ProductVersion == "" { - options.ProductVersion = "1.0.0" + options.ProductVersion = defaultProductVersion +} + +// Validate version format (x.y.z) +if !regexp.MustCompile(`^\d+\.\d+\.\d+$`).MatchString(options.ProductVersion) { + return nil, fmt.Errorf("invalid version format: %s (expected x.y.z)", options.ProductVersion) }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
v3/internal/commands/init.go
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Run Go Tests (macos-latest, 1.23)
- GitHub Check: Run Go Tests (windows-latest, 1.23)
🔇 Additional comments (1)
v3/internal/commands/init.go (1)
3-18
: LGTM! Import changes look good.The new imports for TUI libraries (
huh
andlipgloss
) are properly organized and necessary for the new interactive feature.
form := huh.NewForm( | ||
huh.NewGroup( | ||
huh.NewInput(). | ||
Title("Project Name"). | ||
Description("Name of project"). | ||
Value(&options.ProjectName), | ||
|
||
huh.NewInput(). | ||
Title("Project Dir"). | ||
Description("Target directory (empty for default)"). | ||
Value(&options.ProjectDir), | ||
|
||
templateSelect, | ||
), | ||
huh.NewGroup( | ||
huh.NewInput(). | ||
Title("Git Repo URL (optional)"). | ||
Description("Git repo to initialize (optional)"). | ||
Value(&options.Git), | ||
), | ||
huh.NewGroup( | ||
huh.NewInput(). | ||
Title("Company (optional)"). | ||
Value(&options.ProductCompany), | ||
huh.NewInput(). | ||
Title("Product Name (optional)"). | ||
Value(&options.ProductName), | ||
huh.NewInput(). | ||
Title("Version (optional)"). | ||
Value(&options.ProductVersion), | ||
huh.NewInput(). | ||
Title("ID (optional)"). | ||
Value(&options.ProductIdentifier), | ||
huh.NewInput(). | ||
Title("Copyright (optional)"). | ||
Value(&options.ProductCopyright), | ||
huh.NewText(). | ||
Title("Description (optional)"). | ||
Lines(1). | ||
Value(&options.ProductDescription), | ||
huh.NewText(). | ||
Title("Comments (optional)"). | ||
Lines(1). | ||
Value(&options.ProductComments), | ||
), | ||
huh.NewGroup( | ||
huh.NewConfirm(). | ||
Title("Confirm?"). | ||
Value(&confirmProjectCreation), | ||
), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add input validation for critical fields.
The form lacks validation for critical fields like project name and directory.
Add validation to ensure:
- Project name follows naming conventions
- Directory path is valid and writable
- Git URL format is valid (if provided)
Apply this diff to add validation:
huh.NewInput().
Title("Project Name").
Description("Name of project").
- Value(&options.ProjectName),
+ Value(&options.ProjectName).
+ Validate(func(s string) error {
+ if s == "" {
+ return fmt.Errorf("project name cannot be empty")
+ }
+ if !regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9_-]*$`).MatchString(s) {
+ return fmt.Errorf("invalid project name: must start with a letter and contain only letters, numbers, underscores, or hyphens")
+ }
+ return nil
+ }),
huh.NewInput().
Title("Project Dir").
Description("Target directory (empty for default)").
- Value(&options.ProjectDir),
+ Value(&options.ProjectDir).
+ Validate(func(s string) error {
+ if s == "" {
+ return nil
+ }
+ if _, err := os.Stat(s); err == nil {
+ return fmt.Errorf("directory already exists")
+ }
+ return nil
+ }),
huh.NewInput().
Title("Git Repo URL (optional)").
Description("Git repo to initialize (optional)").
- Value(&options.Git),
+ Value(&options.Git).
+ Validate(func(s string) error {
+ if s == "" {
+ return nil
+ }
+ if !regexp.MustCompile(`^(https?|git|ssh)://|^git@`).MatchString(s) {
+ return fmt.Errorf("invalid git URL format")
+ }
+ return nil
+ }),
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
form := huh.NewForm( | |
huh.NewGroup( | |
huh.NewInput(). | |
Title("Project Name"). | |
Description("Name of project"). | |
Value(&options.ProjectName), | |
huh.NewInput(). | |
Title("Project Dir"). | |
Description("Target directory (empty for default)"). | |
Value(&options.ProjectDir), | |
templateSelect, | |
), | |
huh.NewGroup( | |
huh.NewInput(). | |
Title("Git Repo URL (optional)"). | |
Description("Git repo to initialize (optional)"). | |
Value(&options.Git), | |
), | |
huh.NewGroup( | |
huh.NewInput(). | |
Title("Company (optional)"). | |
Value(&options.ProductCompany), | |
huh.NewInput(). | |
Title("Product Name (optional)"). | |
Value(&options.ProductName), | |
huh.NewInput(). | |
Title("Version (optional)"). | |
Value(&options.ProductVersion), | |
huh.NewInput(). | |
Title("ID (optional)"). | |
Value(&options.ProductIdentifier), | |
huh.NewInput(). | |
Title("Copyright (optional)"). | |
Value(&options.ProductCopyright), | |
huh.NewText(). | |
Title("Description (optional)"). | |
Lines(1). | |
Value(&options.ProductDescription), | |
huh.NewText(). | |
Title("Comments (optional)"). | |
Lines(1). | |
Value(&options.ProductComments), | |
), | |
huh.NewGroup( | |
huh.NewConfirm(). | |
Title("Confirm?"). | |
Value(&confirmProjectCreation), | |
), | |
) | |
form := huh.NewForm( | |
huh.NewGroup( | |
huh.NewInput(). | |
Title("Project Name"). | |
Description("Name of project"). | |
Value(&options.ProjectName). | |
Validate(func(s string) error { | |
if s == "" { | |
return fmt.Errorf("project name cannot be empty") | |
} | |
if !regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9_-]*$`).MatchString(s) { | |
return fmt.Errorf("invalid project name: must start with a letter and contain only letters, numbers, underscores, or hyphens") | |
} | |
return nil | |
}), | |
huh.NewInput(). | |
Title("Project Dir"). | |
Description("Target directory (empty for default)"). | |
Value(&options.ProjectDir). | |
Validate(func(s string) error { | |
if s == "" { | |
return nil | |
} | |
if _, err := os.Stat(s); err == nil { | |
return fmt.Errorf("directory already exists") | |
} | |
return nil | |
}), | |
templateSelect, | |
), | |
huh.NewGroup( | |
huh.NewInput(). | |
Title("Git Repo URL (optional)"). | |
Description("Git repo to initialize (optional)"). | |
Value(&options.Git). | |
Validate(func(s string) error { | |
if s == "" { | |
return nil | |
} | |
if !regexp.MustCompile(`^(https?|git|ssh)://|^git@`).MatchString(s) { | |
return fmt.Errorf("invalid git URL format") | |
} | |
return nil | |
}), | |
), | |
huh.NewGroup( | |
huh.NewInput(). | |
Title("Company (optional)"). | |
Value(&options.ProductCompany), | |
huh.NewInput(). | |
Title("Product Name (optional)"). | |
Value(&options.ProductName), | |
huh.NewInput(). | |
Title("Version (optional)"). | |
Value(&options.ProductVersion), | |
huh.NewInput(). | |
Title("ID (optional)"). | |
Value(&options.ProductIdentifier), | |
huh.NewInput(). | |
Title("Copyright (optional)"). | |
Value(&options.ProductCopyright), | |
huh.NewText(). | |
Title("Description (optional)"). | |
Lines(1). | |
Value(&options.ProductDescription), | |
huh.NewText(). | |
Title("Comments (optional)"). | |
Lines(1). | |
Value(&options.ProductComments), | |
), | |
huh.NewGroup( | |
huh.NewConfirm(). | |
Title("Confirm?"). | |
Value(&confirmProjectCreation), | |
), | |
) |
@leaanthony ok I think I've cleaned it up, I now also pass in the OG flag init struct which loads your defaults: |
For the next version we can look at custom build/config value configuration perhaps and extend the interactive customisation that gets templated and generated, including managing template creation/generation itself etc. |
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please select the option that is relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using
wails doctor
.If you checked Linux, please specify the distro and version.
Fedora 41
Test Configuration
Please paste the output of
wails doctor
. If you are unable to run this command, please describe your environment in as much detail as possible.Checklist:
website/src/pages/changelog.mdx
with details of this PRSummary by CodeRabbit