Repository navigation
prevent-link-loss - Improve reliability - #9873
Conversation
|
This looks like an AI-generated PR, so we're preemptively closing it. If you're human and tested it, include a screenshot/video/gif of the working PR and we can reopen the PR. Don't open more PRs until this one is resolved. |
|
How the tables have turned 😔 |
sry I aven't testd yet |
There was a problem hiding this comment.
Pull request overview
This PR continues the “Svelte components” migration (#9810) by converting the prevent-link-loss feature’s UI from the prior delegate/React+dom-chef banner to a Svelte component, while keeping the underlying link-rewrite logic in the shared helper.
Changes:
- Extracted
isVulnerableToLinkLossintosource/github-helpers/prevent-link-loss.tsfor reuse. - Replaced the
prevent-link-lossfeature’s imperative banner rendering with a mounted Svelte component per textarea. - Added a new
prevent-link-loss.sveltecomponent that shows a warning banner and applies the “Fix link” rewrite.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| source/github-helpers/prevent-link-loss.ts | Adds a shared isVulnerableToLinkLoss helper for detecting when rewrites would change the text. |
| source/features/prevent-link-loss.tsx | Switches the feature from delegated event handling to observe(...) + mount(...) of a Svelte banner component. |
| source/features/prevent-link-loss.svelte | New Svelte UI for detecting vulnerable links and applying the “Fix link” replacements. |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
|
It works |
prevent-link-loss sveltifiedprevent-link-loss - Improve reliability
|
I'm not super convinced that this is necessary, it's just a minor improvement over the weird/unconventional |
Testing
Test content:
Test URLs:
New issue form: https://github.com/refined-github/refined-github/issues/new?assignees=&labels=bug&projects=&template=1_bug_report.yml
New comment form: refined-github/sandbox#3
New review form: https://github.com/refined-github/sandbox/pull/4/files#review-changes-modal
New review comment form: https://github.com/refined-github/sandbox/pull/4/files
Screenshot
it works, boss