- ChatPanel now fills its own window instead of being absolutely positioned over the avatar; its interactive regions (messages, input bar, objective card) opt out of the window's drag region so they stay clickable/selectable while the rest of the panel can be used to move the window. - New StepperView: the #stepper window's root component, relays "session-status-changed" from the main process into its own Zustand store instance (new setStatus action) since this window has no direct access to the chat window's state. - App.tsx no longer renders ChatPanel/PipelineStepper at all (they live in separate windows now) or resizes itself - it only toggles the chat window via IPC and keeps a local optimistic flag for the context menu's checkmark, resynced if the window is closed externally. - Fixed AvatarStatusIndicator's position: .avatar-status-anchor used to be computed from the in-window chat panel's height (bottom: calc(2% + 64vh + ...)), which misplaced it once that panel stopped living in this window. It now mirrors .thinking's simple fixed anchor above the avatar's head. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
|
import { render, screen, act } from '@testing-library/react'
|
|
import StepperView from '../../../src/renderer/src/components/StepperView'
|
|
import { useSessionStore } from '../../../src/renderer/src/stores/useSessionStore'
|
|
|
|
let onSessionStatusChangedCb: ((status: string) => void) | undefined
|
|
|
|
beforeEach(() => {
|
|
vi.clearAllMocks()
|
|
onSessionStatusChangedCb = undefined
|
|
;(window as unknown as { api: Record<string, unknown> }).api = {
|
|
notifySessionEnded: vi.fn(),
|
|
onSessionStatusChanged: vi.fn((cb: (status: string) => void) => {
|
|
onSessionStatusChangedCb = cb
|
|
return () => {}
|
|
})
|
|
}
|
|
useSessionStore.getState().restart()
|
|
})
|
|
|
|
describe('<StepperView />', () => {
|
|
it('should render all 7 steps as pending when no status has been received yet', () => {
|
|
render(<StepperView />)
|
|
expect(screen.getByText('Objectif')).toBeInTheDocument()
|
|
expect(screen.getByText('Evaluation finale')).toBeInTheDocument()
|
|
})
|
|
|
|
it('should update the active step when the main process relays a new session status', () => {
|
|
render(<StepperView />)
|
|
|
|
act(() => onSessionStatusChangedCb?.('objective_validated'))
|
|
|
|
const objectifStep = screen.getByText('Objectif').closest('li')
|
|
expect(objectifStep).toHaveClass('step--done')
|
|
const cartographieStep = screen.getByText('Cartographie').closest('li')
|
|
expect(cartographieStep).toHaveClass('step--active')
|
|
})
|
|
})
|