Skip to content

feature: Project Explorer update, first pass. #7656

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

Open
wants to merge 142 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
fcf584e
chore: saving off skeleton progress... need to write unit tests do so…
nadr0 Jun 12, 2025
320a7e1
chore: big cleanup, typing, adding comments, better structure
nadr0 Jun 13, 2025
c1e0206
chore: moved selected row and opened rows up a level in the react com…
nadr0 Jun 13, 2025
a5768a0
feature: button to collapse all folders
nadr0 Jun 13, 2025
4983c54
feat: implemented projet explorer refresh
nadr0 Jun 13, 2025
24d5bbd
feat: sort was not sorting folders and files at each level, selection…
nadr0 Jun 13, 2025
c8bba25
chore: unable to implement insert at index, need to come back to this…
nadr0 Jun 13, 2025
23b12de
chore: css pointer and hover
nadr0 Jun 13, 2025
e45eb57
chore: adding custom folder icon
nadr0 Jun 13, 2025
746fbcb
chore: adding opened icon
nadr0 Jun 13, 2025
5106e3f
feat: adding line for indentation visual
nadr0 Jun 13, 2025
424d2aa
fix: react key warning
nadr0 Jun 13, 2025
90b6c90
fix: trying to make progress on selection, active index, keyboard, an…
nadr0 Jun 16, 2025
41ebfa0
chore: aria support
nadr0 Jun 16, 2025
c4ec055
chore: implementing removing the click area when you click outside th…
nadr0 Jun 16, 2025
b02da6a
fix: fmt?
nadr0 Jun 16, 2025
5e08013
chore: active index logic, keyboard arrow logic
nadr0 Jun 16, 2025
01337c1
chore: outline offset logic
nadr0 Jun 16, 2025
26e0fba
chore: some arrow key usage, need to move data up a level I think
nadr0 Jun 16, 2025
5c97b3d
chore: more data up a level
nadr0 Jun 16, 2025
b5b1d7d
fix: improving file/folder structure and resolving typescript errors
nadr0 Jun 16, 2025
bc2ba07
chore: clean up
nadr0 Jun 16, 2025
8b9776c
fix: fmt
nadr0 Jun 16, 2025
9338dde
fix: hmm trying to deal with state management
nadr0 Jun 16, 2025
d728667
fix: moving the filter logic up
nadr0 Jun 16, 2025
0b24f0a
chore: keyboard interactions
nadr0 Jun 16, 2025
e429ff7
fix: ope
nadr0 Jun 16, 2025
bc58484
fix:commiting broken context menu
nadr0 Jun 16, 2025
7ef9b25
fix: some testing code for dragging
nadr0 Jun 16, 2025
9308ffe
chore:debug with react dev tools
nadr0 Jun 17, 2025
f0fb454
fix: dang
nadr0 Jun 17, 2025
48f68f6
fix: context menu selection outline
nadr0 Jun 17, 2025
199fffc
fix: fmt
nadr0 Jun 17, 2025
14ef435
fix: moved path into the file entry
nadr0 Jun 17, 2025
c1dafdd
fix: saving off renaming progress
nadr0 Jun 17, 2025
12a4b44
fix: fmt
nadr0 Jun 17, 2025
6ac164d
chore: saving off some progress for the renaming, need a new systemio…
nadr0 Jun 17, 2025
5e972eb
fix: renaming folders!
nadr0 Jun 17, 2025
b6adb79
fix: blocking arrow keys on renaming
nadr0 Jun 17, 2025
f2374d7
chore: renaming files with the systemio
nadr0 Jun 17, 2025
4cb9184
fix: force renaming with extensions since they can rename their file …
nadr0 Jun 17, 2025
deab673
fix: deleting file or folder
nadr0 Jun 17, 2025
ff0b688
fix: deleting folders
nadr0 Jun 17, 2025
d25ecfc
fix: open in new window
nadr0 Jun 17, 2025
c7c3d4b
fix: fixing linter and ts issues
nadr0 Jun 17, 2025
e2b49e3
fix: more tsc error fixing
nadr0 Jun 17, 2025
40198b0
fix: renaming handlers
nadr0 Jun 17, 2025
af34dc7
fix: on context menu open
nadr0 Jun 17, 2025
6234e23
fix: more ts fixes
nadr0 Jun 17, 2025
e2b2b80
fix: more tsc fixes
nadr0 Jun 17, 2025
cec90e7
fix: need to fix some major event typescript handling
nadr0 Jun 17, 2025
06f0276
fix: testing with multiples!
nadr0 Jun 17, 2025
f1d9380
fix: handling blur,focus for the containers to start tabbing and usin…
nadr0 Jun 18, 2025
ff3a0f6
fix: updating icons
nadr0 Jun 18, 2025
950aa13
fix: placeholders and showing them for add file or foldeR
nadr0 Jun 18, 2025
dddc7e3
fix: big add file and folder logic
nadr0 Jun 18, 2025
e14bfdf
fix: fmt
nadr0 Jun 18, 2025
6442e4a
fix: implemented adding files and folders at the activeIndex level in…
nadr0 Jun 18, 2025
ba5b113
chore: css fixes based on Frank's design
nadr0 Jun 18, 2025
7fbc71e
chore: more css updates
nadr0 Jun 18, 2025
5fcc99d
chore: css to know what region you are renaming or adding a new file in
nadr0 Jun 18, 2025
05bc96b
chore: improving some css and layout issues
nadr0 Jun 18, 2025
d81bd6d
fix: the caching of the callback from the context menu borked the fun…
nadr0 Jun 20, 2025
5679998
chore: trying to layout the project explorer in the tab properly
nadr0 Jun 20, 2025
9fbcd1c
fix: proxy header actions
nadr0 Jun 20, 2025
e12f5ce
fix: clear internal state across projects switching
nadr0 Jun 20, 2025
185c666
fix: ope, opening any file known to man!
nadr0 Jun 20, 2025
8dfeab7
fix: only running on kcl files and fmt
nadr0 Jun 20, 2025
137bee9
fix: parent path shows error
nadr0 Jun 20, 2025
d53cf66
fix: fmt
nadr0 Jun 20, 2025
422908d
chore: opening parent folders all the way down to the file that is lo…
nadr0 Jun 20, 2025
9449825
fix: error handling missing file scenario
nadr0 Jun 20, 2025
bf838e0
fix: getting rid of debug index
nadr0 Jun 20, 2025
4f499ce
chore: placeholder is empty string so the fake name is not shown to t…
nadr0 Jun 20, 2025
299d54f
fix: keep placeholder if it is a real file, only hide it on the fake …
nadr0 Jun 20, 2025
9976f5d
fix: auto fmt
nadr0 Jun 20, 2025
9033edb
chore: improved copy for renaming folders
nadr0 Jun 23, 2025
0ccd14f
chore: updated and tested copy for renaming file names
nadr0 Jun 23, 2025
414d111
chore: updated copy for creating a blank kcl file
nadr0 Jun 23, 2025
eded753
chore: fixed copy for creating a blank folder:
nadr0 Jun 23, 2025
0f3c1d0
chore: redirect to file after creation
nadr0 Jun 23, 2025
59c008c
chore: redirect on rename file at any tree level
nadr0 Jun 23, 2025
47fba02
fix: auto fmt
nadr0 Jun 23, 2025
9e16737
fix: only navigate on rename if the file you are renaming is the one …
nadr0 Jun 23, 2025
3817d60
fix: redirect only on rename, need to have a cleaner path library and…
nadr0 Jun 24, 2025
1ba18dd
fix: fmt
nadr0 Jun 24, 2025
aeb57c8
fix: adding comments
nadr0 Jun 24, 2025
75e8550
fix: delete and navigate
nadr0 Jun 24, 2025
9d45de9
fix: fmt
nadr0 Jun 24, 2025
22ce9b4
fix: on enter it opens file
nadr0 Jun 24, 2025
4fe0eb3
fix: removing debug package
nadr0 Jun 24, 2025
bd62f14
fix: fixing tsc errors
nadr0 Jun 24, 2025
8c281cf
fix: resolving tsc errors
nadr0 Jun 24, 2025
ebf1ec5
fix: home should not change
nadr0 Jun 24, 2025
b733722
fix: fixing bug with enter with project loader name ref
nadr0 Jun 24, 2025
30e9410
fix: fixing height to allow clicking empty space then the arrow keys …
nadr0 Jun 24, 2025
bc6b44e
fix: ope testing code when helping adam got here
nadr0 Jun 24, 2025
0fce24e
fix: adding toast since it is using a create file and navigate functi…
nadr0 Jun 24, 2025
7da6d7a
fix: typo
nadr0 Jun 24, 2025
ab29916
fix: trying to fix more tsc errors
nadr0 Jun 24, 2025
821af16
chore: readonly and navigation booleans
nadr0 Jun 24, 2025
332cc27
fix: aria set size and position in set were computed wrong
nadr0 Jun 24, 2025
9b90c98
chore: deleted the old file tree:
nadr0 Jun 25, 2025
4d7623b
chore: filemachineprovider still has useful code, it is now modelingp…
nadr0 Jun 25, 2025
cdac1f8
fix: formatter
nadr0 Jun 25, 2025
519ed1d
fix: adding some unit tests
nadr0 Jun 25, 2025
bb4ef3f
chore: adding unit tests for adding the placeholders
nadr0 Jun 25, 2025
5330492
fix: 2 e2e tests, made a new helper function for the future
nadr0 Jun 25, 2025
327bcfa
fix: fixing another e2e test
nadr0 Jun 25, 2025
ee44a4f
fix: finally found the right helper function, don't know why this is …
nadr0 Jun 25, 2025
95fe5a3
fix: e2e tests...
nadr0 Jun 25, 2025
6927d26
fix: updating button role to the treeitem
nadr0 Jun 25, 2025
142798a
fix: fixing e2e test
nadr0 Jun 26, 2025
4adb01f
ope: I need the delete confirmation
nadr0 Jun 26, 2025
ce9a51c
fix: local state for modal confirmation but the action takes place on…
nadr0 Jun 26, 2025
0d925d2
fix: fixing more e2e tests
nadr0 Jun 26, 2025
5183934
fix: fixing more e2e tests
nadr0 Jun 26, 2025
2b838af
chore: added insert on importable files
nadr0 Jun 26, 2025
d834e4b
fix: fmt
nadr0 Jun 26, 2025
86aec2d
fix: fixing another e2e test
nadr0 Jun 26, 2025
4987297
fix: fixing locator for another e2e test
nadr0 Jun 26, 2025
f1bbbfc
fix: another e2e test
nadr0 Jun 26, 2025
ccc7ec9
fix: I thought I fixed this typo already
nadr0 Jun 26, 2025
2fd87fa
fix: make ENOENT a warning, it isn't a real error
nadr0 Jun 26, 2025
d867d82
fix: last known index so you can swap file/folder when creating in th…
nadr0 Jun 26, 2025
9ea06ae
fix: fixing another locator for e2e test
nadr0 Jun 26, 2025
eb1a541
chore: Jest to vitestga!
nadr0 Jun 26, 2025
ca3d467
fix: this is covered in the unit test runner
nadr0 Jun 26, 2025
55625b5
fix: cleanup testing code
nadr0 Jun 26, 2025
dcbdf9f
Fix tsc errors
franknoirot Jun 26, 2025
6750f36
fix: merging main
nadr0 Jul 1, 2025
2bee64b
fix: moved file so the url is found
nadr0 Jul 1, 2025
5ec5759
fix: ope, wrong function
nadr0 Jul 1, 2025
8122586
fix: merging main
nadr0 Jul 21, 2025
6e1686d
Merge branch 'main' into nadro/gh-6878/no-virtual-list
nadr0 Jul 23, 2025
3e55b8d
fix: addressing PR comments, implementing close folder if you are on …
nadr0 Jul 23, 2025
8c46042
chore: learning and implementing unit component testing, got some goo…
nadr0 Jul 24, 2025
bb85e8e
chore: adding more ProjectExplorer tests, added an event click test! …
nadr0 Jul 24, 2025
2d8806f
chore: adding a unit test for clicking collapse button in ProjectExpl…
nadr0 Jul 24, 2025
e943d3b
chore: adding more unit test scenarios I manually tested but now in r…
nadr0 Jul 24, 2025
7e3ef9c
chore: added unit test for opening and closing folders to check child…
nadr0 Jul 24, 2025
50bfec0
Merge branch 'main' into nadro/gh-6878/no-virtual-list
nadr0 Jul 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,48 +97,3 @@ jobs:
git commit -am "Look at this (photo)Graph *in the voice of Nickelback*" || true
git push
git push origin ${{ github.head_ref }}

npm-test-unit-components:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All jest unit test component stuff is merged into vitest since it is compatible and supports more of our repository level configurations.

runs-on: namespace-profile-ubuntu-2-cores
needs: npm-build-wasm
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- run: npm install
- uses: taiki-e/install-action@c07504cae06f832dc8de08911c9a9c5cddb0d2d3
with:
tool: wasm-pack

- name: Download all artifacts
uses: actions/download-artifact@v4

- name: Copy prepared wasm
run: |
ls -R prepared-wasm
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
mkdir rust/kcl-wasm-lib/pkg
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg

- name: Copy prepared ts-rs bindings
run: |
ls -R prepared-ts-rs-bindings
mkdir rust/kcl-lib/bindings
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/

- name: Run component tests
run: npm run test:unit:components

- name: Upload results
if: always()
run: .github/ci-cd-scripts/upload-results.sh
env:
TAB_API_URL: ${{ secrets.TAB_API_URL }}
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
CI_SUITE: unit:components
5 changes: 2 additions & 3 deletions e2e/playwright/desktop-export.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { expect, test } from '@e2e/playwright/zoo-test'
test(
'export works on the first try',
{ tag: ['@desktop', '@macos', '@windows', '@skipLocalEngine'] },
async ({ page, context, scene, tronApp, cmdBar }, testInfo) => {
async ({ page, context, scene, tronApp, cmdBar, toolbar }, testInfo) => {
if (!tronApp) {
fail()
}
Expand Down Expand Up @@ -95,8 +95,7 @@ test(
await u.openFilePanel()

// Click on the other file
const otherKclButton = page.getByRole('button', { name: 'other.kcl' })
await otherKclButton.click()
await toolbar.openFile('other.kcl')

// Close the file pane
await u.closeFilePanel()
Expand Down
89 changes: 23 additions & 66 deletions e2e/playwright/file-tree.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ test.describe('when using the file tree to', () => {
{
tag: '@desktop',
},
async ({ page }, testInfo) => {
async ({ page, toolbar }, testInfo) => {
const {
panesOpen,
pasteCodeInEditor,
Expand All @@ -319,19 +319,11 @@ test.describe('when using the file tree to', () => {

// Create a large lego file
await createNewFile('lego')
const legoFile = page.getByRole('listitem').filter({
has: page.getByRole('button', { name: 'lego.kcl' }),
})
await expect(legoFile).toBeVisible({ timeout: 60_000 })
await legoFile.click()
const kclLego = await fsp.readFile(
'rust/kcl-lib/e2e/executor/inputs/lego.kcl',
'utf-8'
)
await pasteCodeInEditor(kclLego)
const mainFile = page.getByRole('listitem').filter({
has: page.getByRole('button', { name: 'main.kcl' }),
})

// Open settings and enable the debug panel
await page
Expand All @@ -345,12 +337,12 @@ test.describe('when using the file tree to', () => {
await test.step('swap between small and large files', async () => {
await openDebugPanel()
// Previously created a file so we need to start back at main.kcl
await mainFile.click()
await toolbar.openFile('main.kcl')
await expectCmdLog('[data-message-type="execution-done"]', 60_000)
// Click the large file
await legoFile.click()
await toolbar.openFile('lego.kcl')
// Once it is building, click back to the smaller file
await mainFile.click()
await toolbar.openFile('main.kcl')
await expectCmdLog('[data-message-type="execution-done"]', 60_000)
await closeDebugPanel()
})
Expand Down Expand Up @@ -390,13 +382,8 @@ test.describe('Renaming in the file tree', () => {
const filePath = join(dir, 'Test Project', `${newFileName}.kcl`)
return fs.existsSync(filePath)
}

const fileToRename = page
.getByRole('listitem')
.filter({ has: page.getByRole('button', { name: 'fileToRename.kcl' }) })
const renamedFile = page
.getByRole('listitem')
.filter({ has: page.getByRole('button', { name: 'newFileName.kcl' }) })
const fileToRename = u.locatorFile('fileToRename.kcl')
const renamedFile = u.locatorFile('newFileName.kcl')
const renameMenuItem = page.getByRole('button', { name: 'Rename' })
const renameInput = page.getByPlaceholder('fileToRename.kcl')
const codeLocator = page.locator('.cm-content')
Expand Down Expand Up @@ -479,12 +466,8 @@ test.describe('Renaming in the file tree', () => {
}
const projectLink = page.getByText('Test Project')
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
const fileToRename = page
.getByRole('listitem')
.filter({ has: page.getByRole('button', { name: 'fileToRename.kcl' }) })
const renamedFile = page.getByRole('listitem').filter({
has: page.getByRole('button', { name: newFileName + FILE_EXT }),
})
const fileToRename = u.locatorFile('fileToRename.kcl')
const renamedFile = u.locatorFile(newFileName + FILE_EXT)
const renameMenuItem = page.getByRole('button', { name: 'Rename' })
const renameInput = page.getByPlaceholder('fileToRename.kcl')
const codeLocator = page.locator('.cm-content')
Expand Down Expand Up @@ -560,10 +543,8 @@ test.describe('Renaming in the file tree', () => {
// Constants and locators
const projectLink = page.getByText('Test Project')
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
const folderToRename = page.getByRole('button', {
name: 'folderToRename',
})
const renamedFolder = page.getByRole('button', { name: 'newFolderName' })
const folderToRename = u.locatorFolder('folderToRename')
const renamedFolder = u.locatorFolder('newFolderName')
const renameMenuItem = page.getByRole('button', { name: 'Rename' })
const originalFolderName = 'folderToRename'
const renameInput = page.getByPlaceholder(originalFolderName)
Expand Down Expand Up @@ -642,13 +623,9 @@ test.describe('Renaming in the file tree', () => {
// Constants and locators
const projectLink = page.getByText('Test Project')
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
const folderToRename = page.getByRole('button', {
name: 'folderToRename',
})
const renamedFolder = page.getByRole('button', { name: 'newFolderName' })
const fileWithinFolder = page.getByRole('listitem').filter({
has: page.getByRole('button', { name: 'someFileWithin.kcl' }),
})
const folderToRename = u.locatorFolder('folderToRename')
const renamedFolder = u.locatorFolder('newFolderName')
const fileWithinFolder = u.locatorFile('someFileWithin.kcl')
const renameMenuItem = page.getByRole('button', { name: 'Rename' })
const originalFolderName = 'folderToRename'
const renameInput = page.getByPlaceholder(originalFolderName)
Expand Down Expand Up @@ -742,9 +719,7 @@ test.describe('Deleting items from the file pane', () => {
// Constants and locators
const projectCard = page.getByText('testProject')
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
const fileToDelete = page
.getByRole('listitem')
.filter({ has: page.getByRole('button', { name: 'fileToDelete.kcl' }) })
const fileToDelete = u.locatorFile('fileToDelete.kcl')
const deleteMenuItem = page.getByRole('button', { name: 'Delete' })
const deleteConfirmation = page.getByTestId('delete-confirmation')

Expand Down Expand Up @@ -809,9 +784,7 @@ test.describe('Deleting items from the file pane', () => {
// Constants and locators
const projectCard = page.getByText('Test Project')
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
const folderToDelete = page.getByRole('button', {
name: 'folderToDelete',
})
const folderToDelete = u.locatorFolder('folderToDelete')
const deleteMenuItem = page.getByRole('button', { name: 'Delete' })
const deleteConfirmation = page.getByTestId('delete-confirmation')

Expand Down Expand Up @@ -863,12 +836,8 @@ test.describe('Deleting items from the file pane', () => {
// Constants and locators
const projectCard = page.getByText('Test Project')
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
const folderToDelete = page.getByRole('button', {
name: 'folderToDelete',
})
const fileWithinFolder = page.getByRole('listitem').filter({
has: page.getByRole('button', { name: 'someFileWithin.kcl' }),
})
const folderToDelete = u.locatorFolder('folderToDelete')
const fileWithinFolder = u.locatorFile('someFileWithin.kcl')
const deleteMenuItem = page.getByRole('button', { name: 'Delete' })
const deleteConfirmation = page.getByTestId('delete-confirmation')

Expand Down Expand Up @@ -931,12 +900,8 @@ test.describe('Deleting items from the file pane', () => {
// Constants and locators
const projectCard = page.getByText(TEST_PROJECT_NAME)
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
const folderToDelete = page.getByRole('button', {
name: 'folderToDelete',
})
const fileWithinFolder = page.getByRole('listitem').filter({
has: page.getByRole('button', { name: 'someFileWithin.kcl' }),
})
const folderToDelete = u.locatorFolder('folderToDelete')
const fileWithinFolder = u.locatorFile('someFileWithin.kcl')

await test.step('Open project and navigate into folderToDelete', async () => {
await projectCard.click()
Expand Down Expand Up @@ -995,12 +960,8 @@ test.describe('Deleting items from the file pane', () => {
// Constants and locators
const projectCard = page.getByText(TEST_PROJECT_NAME)
const projectMenuButton = page.getByTestId('project-sidebar-toggle')
const folderToDelete = page.getByRole('button', {
name: 'folderToDelete',
})
const fileWithinFolder = page.getByRole('listitem').filter({
has: page.getByRole('button', { name: 'someFileWithin.kcl' }),
})
const folderToDelete = u.locatorFolder('folderToDelete')
const fileWithinFolder = u.locatorFile('someFileWithin.kcl')

await test.step('Open project and navigate into folderToDelete', async () => {
await projectCard.click()
Expand Down Expand Up @@ -1065,9 +1026,7 @@ test.describe('Undo and redo do not keep history when navigating between files',

// Constants and locators
const projectCard = page.getByText('testProject')
const otherFile = page
.getByRole('listitem')
.filter({ has: page.getByRole('button', { name: 'other.kcl' }) })
const otherFile = u.locatorFile('other.kcl')

await test.step('Open project and make a change to the file', async () => {
await projectCard.click()
Expand Down Expand Up @@ -1132,9 +1091,7 @@ test.describe('Undo and redo do not keep history when navigating between files',

// Constants and locators
const projectCard = page.getByText('testProject')
const otherFile = page
.getByRole('listitem')
.filter({ has: page.getByRole('button', { name: 'other.kcl' }) })
const otherFile = u.locatorFile('other.kcl')

const badContent = 'this shit'
await test.step('Open project and make a change to the file', async () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/fixtures/toolbarFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ToolbarFixture {
this.exitSketchBtn = page.getByTestId('sketch-exit')
this.fileTreeBtn = page.locator('[id="files-button-holder"]')
this.createFileBtn = page.getByTestId('create-file-button')
this.treeInputField = page.getByTestId('tree-input-field')
this.treeInputField = page.getByTestId('file-rename-field')
this.loadButton = page.getByTestId('add-file-to-project-pane-button')

this.filePane = page.locator('#files-pane')
Expand Down
27 changes: 9 additions & 18 deletions e2e/playwright/projects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ test(
test(
'open a file in a project works and renders, open empty file, it should clear the scene',
{ tag: '@desktop' },
async ({ context, page }, testInfo) => {
async ({ context, page, scene, toolbar }, testInfo) => {
await context.folderSetupFn(async (dir) => {
const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
Expand Down Expand Up @@ -289,11 +289,8 @@ test(
// open the file pane.
await page.getByTestId('files-pane-button').click()

// OPen the other file.
const file = page.getByRole('button', { name: 'empty.kcl' })
await expect(file).toBeVisible()

await file.click()
// Open the other file.
await toolbar.openFile('empty.kcl')

// planes colors means the scene has been cleared.
await expect
Expand All @@ -312,7 +309,7 @@ test(
test(
'open a file in a project works and renders, open another file in the same project with errors, it should clear the scene',
{ tag: '@desktop' },
async ({ scene, cmdBar, context, page }, testInfo) => {
async ({ scene, cmdBar, context, page, toolbar }, testInfo) => {
await context.folderSetupFn(async (dir) => {
const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
Expand Down Expand Up @@ -358,10 +355,7 @@ test(
await page.getByTestId('files-pane-button').click()

// Open the other file.
const file = page.getByRole('button', { name: 'broken-code-test.kcl' })
await expect(file).toBeVisible()

await file.click()
await toolbar.openFile('broken-code-test.kcl')

// error in guter
await expect(page.locator('.cm-lint-marker-error')).toBeVisible()
Expand Down Expand Up @@ -1092,7 +1086,7 @@ test(`Create a few projects using the default project name`, async ({
test(
'File in the file pane should open with a single click',
{ tag: '@desktop' },
async ({ context, homePage, page }, testInfo) => {
async ({ context, homePage, page, scene, toolbar }, testInfo) => {
const projectName = 'router-template-slate'
await context.folderSetupFn(async (dir) => {
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
Expand All @@ -1119,11 +1113,7 @@ test(
await expect(u.codeLocator).toContainText('minClampingDistance')

await page.getByRole('button', { name: 'Project Files' }).click()

const file = page.getByRole('button', { name: 'otherThingToClickOn.kcl' })
await expect(file).toBeVisible()

await file.click()
await toolbar.openFile('otherThingToClickOn.kcl')

await expect(u.codeLocator).toContainText(
'A mounting bracket for the Focusrite Scarlett Solo audio interface'
Expand Down Expand Up @@ -1864,7 +1854,8 @@ test(
})

await test.step('check the last file is out of view initially, and can be scrolled to', async () => {
const element = page.getByText('tangential_arc.kcl')
const u = await getUtils(page)
const element = u.locatorFile('tangential_arc.kcl')
const container = page.getByTestId('file-pane-scroll-container')

await expect(await isOutOfViewInScrollContainer(element, container)).toBe(
Expand Down
Loading
Loading