improvements to the ui

This commit is contained in:
2026-06-16 09:36:18 +02:00
parent 7bac3fe7c5
commit 8fc6478bb1
12 changed files with 292 additions and 170 deletions

View File

@@ -39,13 +39,13 @@ describe('App (mock data, jsdom)', () => {
const c = renderApp()
await waitFor(() => expect(rowWithText(c, '.git-row', 'UserController.php')).toBeTruthy())
expect(c.querySelector('.workbench')).toBeTruthy()
expect(c.textContent).toContain('Source Control')
expect(c.textContent).toContain('Explorer')
expect(c.querySelector('.commit-box')).toBeTruthy() // git panel
expect(c.querySelector('.tree-body')).toBeTruthy() // explorer
// no file open yet
expect(c.textContent).toContain('No file open')
})
it('opens a changed file from the git panel into a diff tab', async () => {
it('opens a changed file from the git panel into the diff view', async () => {
const c = renderApp()
const row = await waitFor(() => {
const r = rowWithText(c, '.git-row', 'UserController.php')
@@ -53,12 +53,14 @@ describe('App (mock data, jsdom)', () => {
return r
})
fireEvent.click(row)
await waitFor(() => expect(rowWithText(c, '.tab', 'UserController.php')).toBeTruthy())
// changed file → diff toolbar with a status word
// no tabs anymore — the file opens straight into the editor's diff toolbar,
// and its path shows in the title-bar breadcrumb.
await waitFor(() => expect(c.querySelector('.diff-bar')).toBeTruthy())
expect(c.querySelector('.diff-bar')?.textContent).toContain('Modified')
expect(rowWithText(c, '.tb-crumb', 'UserController.php')).toBeTruthy()
})
it('makes an edited buffer dirty (tab dot)', async () => {
it('makes an edited buffer dirty (breadcrumb dot)', async () => {
const c = renderApp()
const treeRow = await waitFor(() => {
const r = rowWithText(c, '.tree-row', 'store.js')
@@ -71,9 +73,9 @@ describe('App (mock data, jsdom)', () => {
if (!t) throw new Error('editor not ready')
return t
})
expect(c.querySelector('.tab.dirtyclose')).toBeNull()
expect(c.querySelector('.tb-dirty')).toBeNull()
fireEvent.change(ta, { target: { value: '// edited\n' } })
await waitFor(() => expect(c.querySelector('.tab.dirtyclose')).toBeTruthy())
await waitFor(() => expect(c.querySelector('.tb-dirty')).toBeTruthy())
})
it('searches file contents from the search modal', async () => {