refactor(settings): move sidebar settings into a modal

Clicking Settings now opens a dialog with the status-check interval and
canvas snap options plus Save/Cancel, replacing the inline left-panel view.
Removes the 'settings' Sidebar view and SettingsPanel component.

ha-relevant: maybe
This commit is contained in:
Pouzor
2026-06-05 10:00:39 +02:00
parent 6e17a2afc6
commit fa8f949b45
6 changed files with 217 additions and 221 deletions
@@ -73,6 +73,7 @@ const defaultProps = {
onScan: vi.fn(),
onZigbeeImport: vi.fn(),
onSave: vi.fn(),
onOpenSettings: vi.fn(),
onOpenPending: vi.fn(),
}
@@ -257,14 +258,10 @@ describe('Sidebar', () => {
await waitFor(() => expect(screen.queryByText('No scans yet')).not.toBeInTheDocument())
})
it('toggles Settings panel on Settings click', async () => {
it('calls onOpenSettings when Settings is clicked', () => {
render(<Sidebar {...defaultProps} />)
fireEvent.click(screen.getByText('Settings'))
await waitFor(() =>
expect(screen.getByText('Status check interval (s)')).toBeInTheDocument(),
)
fireEvent.click(screen.getByRole('button', { name: 'Settings' }))
expect(screen.queryByText('Status check interval (s)')).not.toBeInTheDocument()
expect(defaultProps.onOpenSettings).toHaveBeenCalledOnce()
})
// ── Logout ─────────────────────────────────────────────────────────────────