Skip to content

Update URL when changing project settings URL #1690

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 3 commits into from
Mar 29, 2025
Merged

Update URL when changing project settings URL #1690

merged 3 commits into from
Mar 29, 2025

Conversation

Kitenite
Copy link
Contributor

@Kitenite Kitenite commented Mar 29, 2025

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Release
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes


Important

Adds URL update handling in project settings and frame management, ensuring changes are reflected across the application.

  • Behavior:
    • Adds handleUpdateUrl function in index.tsx to update project URL and save frame URLs.
    • Updates onChange handler for URL input in index.tsx to use handleUpdateUrl.
    • Modifies saveFrames() in CanvasManager to update frame URLs.
  • Error Handling:
    • Changes error handling in writeFile() in files.ts to throw original error instead of wrapping it.
  • Misc:
    • Adds saveFrames() method to CanvasManager in canvas/index.ts.
    • Adjusts useEffect dependencies in Frame.tsx to include settings.url.

This description was created by Ellipsis for 7f2fbd6. It will automatically update as commits are pushed.

@Kitenite Kitenite merged commit 2c53c8d into main Mar 29, 2025
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.

👍 Looks good to me! Reviewed everything up to 7f2fbd6 in 2 minutes and 8 seconds

More details
  • Looked at 110 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 8 drafted comments based on config settings.
1. apps/studio/electron/main/code/files.ts:60
  • Draft comment:
    Review: The catch block now rethrows the original error instead of wrapping it with a new Error. This preserves the stack trace but loses the custom context message provided earlier. Ensure this change is intentional.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
    The comment violates our rules in two ways: 1) It asks to "ensure this change is intentional" which is exactly the kind of verification request we should avoid 2) The change appears intentional and consistent with error handling elsewhere in the file. The original error is still logged with context via console.error, so no information is lost.
    Maybe preserving the original error type and stack trace is actually a regression since it might expose internal implementation details to callers?
    No, preserving original errors is generally better practice as it maintains complete error information and is consistent with Node.js conventions. The error context is still logged.
    Delete this comment. It asks for unnecessary verification and the change appears to be an intentional improvement to error handling.
2. apps/studio/src/routes/editor/WebviewArea/Frame.tsx:132
  • Draft comment:
    Cleanup: The useEffect cleanup for observing settings calls unobserveSettings immediately. Instead, return a function that calls unobserveSettings. E.g.: return () => editorEngine.canvas.unobserveSettings(settings.id, observer);
  • 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.
3. apps/studio/electron/main/code/files.ts:60
  • Draft comment:
    Throwing the original error preserves the stack trace but loses the constructed context message; confirm this is intentional.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
4. apps/studio/src/components/Modals/Settings/Project/index.tsx:37
  • Draft comment:
    Extracting handleUpdateUrl to update the project URL and cascade changes to all frames is a clear improvement. Consider debouncing these updates if rapid keystrokes cause excessive saves.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
5. apps/studio/src/components/Modals/Settings/Project/index.tsx:47
  • Draft comment:
    The PR description and issue refer to onboarding docs, yet the changes only address URL updating. Please ensure the PR scope is described accurately.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    This comment is asking the PR author to update the PR description, which is against the rules. It does not provide a specific code suggestion or ask for a test to be written. Therefore, it should be removed.
6. apps/studio/src/lib/editor/engine/canvas/index.ts:102
  • Draft comment:
    The new saveFrames method cleanly persists frame updates by setting webFrames and saving settings.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
7. apps/studio/src/routes/editor/WebviewArea/Frame.tsx:202
  • Draft comment:
    Including settings.url in the dependency array ensures the frame reacts to URL changes; this update is appropriate.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
8. apps/studio/src/components/Modals/Settings/Project/index.tsx:9
  • Draft comment:
    Typo found in import statement: './ReinstallButon' should probably be './ReinstallButton' if that is the intended file name.
  • 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_C0XKAAQE4iuQeWZF


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@Kitenite Kitenite deleted the bugs/url branch March 29, 2025 19:27
@Rupak182 Rupak182 mentioned this pull request Mar 30, 2025
6 tasks
zongkelong pushed a commit to zongkelong/coolook that referenced this pull request Mar 31, 2025
…slation_zh

* 'main' of https://github.com/onlook-dev/onlook:
  Publish version v0.2.23 (onlook-dev#1694)
  Fix edit panel not fully hidden (onlook-dev#1695)
  Update file watcher and remove elide lines (onlook-dev#1693)
  Add sticky position (onlook-dev#1692)
  Publish version v0.2.22 (onlook-dev#1679)
  added text transforms (onlook-dev#1689)
  Update URL when changing project settings URL (onlook-dev#1690)
  fix: error when setting text color (onlook-dev#1688)
  Revert freestyle source (onlook-dev#1686)
ml-delaurier pushed a commit to ml-delaurier/nolook that referenced this pull request Apr 23, 2025
* Update URL when changing project URL

* Update URL input
t1c1 pushed a commit to t1c1/onlookbotcodes that referenced this pull request Jun 5, 2025
* Update URL when changing project URL

* Update URL input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant