fix: regression in handling on non-standard URLs on Windows#8070
Open
asjqkkkk wants to merge 3 commits intoAppFlowy-IO:mainfrom
Open
fix: regression in handling on non-standard URLs on Windows#8070asjqkkkk wants to merge 3 commits intoAppFlowy-IO:mainfrom
asjqkkkk wants to merge 3 commits intoAppFlowy-IO:mainfrom
Conversation
Contributor
Reviewer's GuideRefines the URL launch helper to prevent automatic HTTP scheme prepending for custom or non-standard URLs on Windows by leveraging the existing custom URL detector. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @asjqkkkk - I've reviewed your changes - here's some feedback:
- There’s a typo in the variable name
isNotCustomUrlOnWidows—it should beisNotCustomUrlOnWindowsfor clarity. - Importing
isCustomUrLfromappflowy_editor/srccouples you to an internal API; consider exposing it publicly or replicating just the necessary logic here. - Update the comment above the platform check to accurately reflect the Windows exception instead of still listing Windows alongside Linux/Android.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- There’s a typo in the variable name `isNotCustomUrlOnWidows`—it should be `isNotCustomUrlOnWindows` for clarity.
- Importing `isCustomUrL` from `appflowy_editor/src` couples you to an internal API; consider exposing it publicly or replicating just the necessary logic here.
- Update the comment above the platform check to accurately reflect the Windows exception instead of still listing Windows alongside Linux/Android.
## Individual Comments
### Comment 1
<location> `frontend/appflowy_flutter/lib/core/helpers/url_launcher.dart:46` </location>
<code_context>
- // on Linux or Android or Windows, add http scheme to the url if it is not present
+ // on Linux or Android, add http scheme to the url if it is not present
+ final isNotCustomUrlOnWidows =
+ UniversalPlatform.isWindows && !isCustomUrL(url);
if ((UniversalPlatform.isLinux ||
</code_context>
<issue_to_address>
Typo in variable name
Please rename `isNotCustomUrlOnWidows` to `isNotCustomUrlOnWindows`.
</issue_to_address>
### Comment 2
<location> `frontend/appflowy_flutter/lib/core/helpers/url_launcher.dart:45` </location>
<code_context>
}
- // on Linux or Android or Windows, add http scheme to the url if it is not present
+ // on Linux or Android, add http scheme to the url if it is not present
+ final isNotCustomUrlOnWidows =
+ UniversalPlatform.isWindows && !isCustomUrL(url);
</code_context>
<issue_to_address>
Comment doesn’t reflect Windows condition
Please update the comment to include Windows, as the logic applies to Windows when the URL is not custom.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| } | ||
|
|
||
| // on Linux or Android or Windows, add http scheme to the url if it is not present | ||
| // on Linux or Android, add http scheme to the url if it is not present |
Contributor
There was a problem hiding this comment.
nitpick: Comment doesn’t reflect Windows condition
Please update the comment to include Windows, as the logic applies to Windows when the URL is not custom.
|
Any updates? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To fix #8050
Feature Preview
PR Checklist
Summary by Sourcery
Refine URL handling to prevent unintentional protocol prepending for custom editor URLs on Windows while preserving scheme addition for standard links on Linux and Android.
Bug Fixes:
Enhancements: