Skip to content

feat: Implement Dev panel & IDE functionalities #1740

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 16 commits into from
Apr 13, 2025

Conversation

iNerdStack
Copy link
Contributor

@iNerdStack iNerdStack commented Apr 6, 2025

Description

This pull request introduces the new Onlook IDE and dev panel and adds functionality for scanning and retrieving project files, as well as the ability to view and edit files.

Related Issues

related to #1594

Type of Change

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

Testing

Screenshots (if applicable)

Additional Notes


Important

Introduces Onlook IDE with file scanning, retrieval, and editing capabilities, and updates UI and dependencies for integration.

  • Behavior:
    • Adds Onlook IDE to ide.ts and integrates it into the system.
    • Implements file scanning and retrieval in files-scan.ts.
    • Adds file viewing and editing capabilities in index.ts.
  • Events:
    • Adds VIEW_CODE_IN_ONLOOK and SHOW_EDITOR_TAB to MainChannels in ipc.ts.
    • Handles file-related IPC events in events/files.ts and events/code.ts.
  • UI:
    • Implements DevTab and file tree components in DevTab/index.tsx, FileTreeNode.tsx, and FileTreeRow.tsx.
  • Dependencies:
    • Adds CodeMirror and related packages to package.json for code editing support.

This description was created by Ellipsis for 19999e6. 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.

👍 Looks good to me! Reviewed everything up to 19999e6 in 1 minute and 57 seconds

More details
  • Looked at 2279 lines of code in 20 files
  • Skipped 0 files when reviewing.
  • Skipped posting 8 drafted comments based on config settings.
1. packages/models/src/constants/ipc.ts:52
  • Draft comment:
    Ensure the new channel VIEW_CODE_IN_ONLOOK follows naming conventions and is consistently used in the IPC integration.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
2. packages/models/src/ide/index.ts:6
  • Draft comment:
    The ONLOOK IDE addition looks good. Confirm that the default IDE remains appropriate and that its integration is error-free across the app.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. packages/models/src/constants/ipc.ts:52
  • Draft comment:
    New channel VIEW_CODE_IN_ONLOOK added here looks good. Ensure related docs and usage in the dev panel are updated accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. packages/models/src/ide/index.ts:6
  • Draft comment:
    ONLOOK added in IdeType is consistent with the new IDE functionality. Consider if the DEFAULT_IDE should be updated based on user preference.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
5. apps/studio/package.json:30
  • Draft comment:
    The script key 'pree2e' appears to be a potential typographical mistake. If this is meant to run before e2e tests, consider renaming it to something more conventional (like 'pre:e2e') to avoid confusion.
  • 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.
6. packages/models/src/constants/ipc.ts:34
  • Draft comment:
    Typo: The constant 'QUIT_AND_INSTALL' has a string value 'quit-and-update-app'. Consider renaming the value to 'quit-and-install' (or adjusting the constant name) for consistency.
  • 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.
7. packages/models/src/constants/ipc.ts:65
  • Draft comment:
    Typo: The constant 'GET_TEMPLATE_NODE_CLASS' has a string value 'get-template-node-classes'. The mismatch in singular vs plural could be confusing. Please verify and adjust for consistency.
  • 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.
8. packages/models/src/constants/ipc.ts:55
  • Draft comment:
    Typo: The constant 'CLEAN_CODE_KEYS' is assigned the string 'clean-move-keys'. This appears to be a typographical error. Please check if it should be 'clean-code-keys' instead.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_1uuyuTfRmxiNtLox


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

@spartan-uyen
Copy link

Title: Undo in one file loads code from another file

Summary: When editing and saving a file in Onlook IDE, performing undo twice causes the file content to be replaced by another file’s content.

Steps to Reproduce:

  1. Open layout.tsx file.
  2. Then open page.tsx.
  3. Make a small change in page.tsx (e.g., rename Web App title) and save.
  4. Press Command + Z twice to undo.
  5. Observe the content of page.tsx.

Actual Result:
page.tsx unexpectedly loads the content of layout.tsx.
https://github.com/user-attachments/assets/1db0ff06-7441-4015-99df-df989106d3b8

Expected Result:
Undo should only affect changes made in page.tsx, without replacing it with content from other files.

@spartan-uyen
Copy link

Title: "View in code" in brand panel does not work in new IDE

Summary: In the new IDE, using "View in code" from the brand panel on a selected color does not trigger any action.

Steps to Reproduce:

  1. Open the brand panel.
  2. Select any color.
  3. Click on View in code.
  4. Observe the IDE to see

Actual Result:
No action occurs—neither the project is opened nor the code editor navigates to the related color definition.
https://github.com/user-attachments/assets/73c81f70-1212-4095-b610-41a92f4e6154

Expected Result:
The project should open automatically, and the code editor should scroll to the corresponding color in the appropriate file.

@spartan-uyen
Copy link

Title: Undo from top bar does not revert code changes in IDE

Summary: When editing code (e.g., changing the text of a text element) and clicking the Undo button on the top bar, the changes are not reverted in the IDE.

Steps to Reproduce:

  1. Open a code file in the IDE (e.g., page.tsx).
  2. Modify some text or content inside the file.
  3. Click the Undo button on the top bar.
  4. Observe the code in the IDE.

Actual Result:
The code remains unchanged and keeps the modified text, as if Undo was never triggered.
https://github.com/user-attachments/assets/96f5c9b6-3186-4f41-9415-77a280a829f0

Expected Result:
The code should revert to its previous state, undoing the last edit.

@spartan-uyen
Copy link

Title: Editing text on canvas does not update code in IDE

Summary: When a user edits text directly on the canvas, the corresponding code in the IDE does not reflect the change.

Steps to Reproduce:

  1. Open a project and add a text element to the canvas.
  2. Edit the text directly on the canvas.
  3. Open the corresponding code file in the IDE (e.g., page.tsx).
  4. Check if the updated text is reflected in the code.

Actual Result:
The code in the IDE does not change; it still shows the original text. I need to refresh or open it again to see the new change
Uploading Screen Recording 2025-04-08 at 17.12.28.mov…

Expected Result:
The code should automatically update to reflect the new text entered on the canvas.

@spartan-uyen
Copy link

Title: Double-clicking text opens duplicate code tab

Summary: When double-clicking a text element on the canvas, instead of navigating to the existing code tab, a duplicate tab is opened.

Steps to Reproduce:

  1. Open a text element in the IDE and keep the corresponding code file open (e.g., page.tsx).
  2. Double-click the text element on the canvas.
  3. Observe the tabs in the IDE.

Actual Result:
A new tab with the same file (e.g., page.tsx) is opened, resulting in duplicate tabs.
https://github.com/user-attachments/assets/b1a51e0d-d6e3-40c5-ad7a-ef2d77c1e4c9

Expected Result:
The existing code tab should be focused and navigated to the corresponding code line, not duplicated.

@spartan-uyen
Copy link

Title: Selected IDE tab not retained after switching panels

Summary: When switching away from the IDE to another panel (e.g., Chat or Style) and returning, the previously selected file tab is not preserved.

Steps to Reproduce:

  1. Open a file in the IDE (e.g., page.tsx) without making any edits.
  2. Switch to another panel, such as Chat or Style.
  3. Return to the IDE panel.

Actual Result:
The IDE opens with no file tab selected. Previously opened tabs are not retained.
https://github.com/user-attachments/assets/356d4c83-9d7d-4ed3-a755-a271c2e6983e

Expected Result:
The previously selected file tab should remain open and focused when returning to the IDE.

@spartan-uyen
Copy link

Title: Image file opens as raw code in new IDE

Summary: When opening an image file in the new IDE, the content is shown as raw encoded text instead of rendering the actual image.

Steps to Reproduce:

  1. Open the new IDE.
  2. Navigate to an image file (e.g., .png or .jpg).
  3. Click to open the image file.

Actual Result:
The IDE displays raw encoded content (e.g., {����IEND�B`�) instead of rendering the image.
https://github.com/user-attachments/assets/a8270bd1-623f-4e44-969a-058717721cff

Expected Result:
The IDE should display the actual image preview, similar to how it works in VS Code.

@spartan-uyen
Copy link

Title: Long tab names break into multiple lines instead of truncating

Summary: When opening a file with a long name, the tab label wraps to a second line instead of maintaining a single-line display with truncation.

Steps to Reproduce:

  1. Open a file with a long filename in the IDE (e.g., very-long-file-name-example.tsx).
  2. Observe the tab label in the tab bar.

Actual Result:
The file name wraps to the next line.
image

Expected Result:
Long file names should remain on a single line and be truncated with ellipsis (...) if needed, preserving the layout.

Copy link
Contributor

@Kitenite Kitenite left a comment

Choose a reason for hiding this comment

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

@Kitenite Kitenite merged commit 0897527 into onlook-dev:main Apr 13, 2025
@iNerdStack iNerdStack deleted the ide branch April 15, 2025 20:04
ml-delaurier pushed a commit to ml-delaurier/nolook that referenced this pull request Apr 23, 2025
* implemented code mirror code

* implement file scans & other ide functionalities

* fix bun lockfile

* clean up

* more clean up

* Move tab change logic

* Clean up

* fix undo in one file loads code from another file

* fix "View in code" in brand panel does not work in new IDE

* persist devtab state and improve "view in onlook" functionalities

* fix Long tab names break into multiple lines instead of truncating

* Ignore next-prod dir
t1c1 pushed a commit to t1c1/onlookbotcodes that referenced this pull request Jun 5, 2025
* implemented code mirror code

* implement file scans & other ide functionalities

* fix bun lockfile

* clean up

* more clean up

* Move tab change logic

* Clean up

* fix undo in one file loads code from another file

* fix "View in code" in brand panel does not work in new IDE

* persist devtab state and improve "view in onlook" functionalities

* fix Long tab names break into multiple lines instead of truncating

* Ignore next-prod dir
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.

3 participants