Skip to content

fix: templatev2 delete issue #5834

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

Merged
merged 1 commit into from
May 29, 2025
Merged

fix: templatev2 delete issue #5834

merged 1 commit into from
May 29, 2025

Conversation

alpetric
Copy link
Contributor

@alpetric alpetric commented May 29, 2025

Important

Fixes TemplateEditor.svelte issue by updating code only when it changes, preventing unnecessary dispatches.

  • Behavior:
    • Fixes issue in TemplateEditor.svelte where code was updated and dispatched on every change event, even if unchanged.
    • Adds a check to update code only if newCode differs from code in onDidChangeModelContent and onDidBlurEditorText.
  • Misc:
    • No other files or functions are affected by this change.

This description was created by Ellipsis for a125a33. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to a125a33 in 1 minute and 31 seconds. Click for details.
  • Reviewed 30 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/src/lib/components/TemplateEditor.svelte:480
  • Draft comment:
    Use strict equality (===) when comparing the current code to the new code for type safety.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While === is generally preferred over == in JavaScript/TypeScript for type safety, in this case both variables are definitely strings based on the types. The == vs === distinction doesn't matter here since there's no type coercion possible between two strings. The suggestion is technically correct but doesn't provide meaningful value. The comment is technically accurate - === is more type-safe than ==. Am I being too dismissive of a valid best practice? While === is a good practice, we should focus on comments that provide real value. Here the types make it impossible for type coercion to occur, so the distinction is purely stylistic. The comment should be deleted as it suggests a change that provides no practical benefit in this specific context, where both variables are known to be strings.
2. frontend/src/lib/components/TemplateEditor.svelte:488
  • Draft comment:
    Typo alert: It looks like "meditor" might be a typo. Did you mean "editor"?
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_VLmK6plF3NuXxAx9

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@@ -504,7 +507,10 @@

editor.onDidBlurEditorText(() => {
dispatch('blur')
code = getCode()
const newCode = getCode()
if (code != newCode) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use strict equality (===) for the code comparison here as well to ensure consistency.

Suggested change
if (code != newCode) {
if (code !== newCode) {

Copy link

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: a125a33
Status: ✅  Deploy successful!
Preview URL: https://ae16c79f.windmill.pages.dev
Branch Preview URL: https://alp-also-fix-templatev2.windmill.pages.dev

View logs

@rubenfiszel rubenfiszel merged commit ed3ad32 into main May 29, 2025
14 checks passed
@rubenfiszel rubenfiszel deleted the alp/also_fix_templatev2 branch May 29, 2025 07:34
@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants