mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-29 16:03:34 +08:00
Merge pull request #47 from 706412584/worktree-prompt-too-long-recovery
Fix desktop window controls layout
This commit is contained in:
commit
c9cb42b780
@ -1379,6 +1379,13 @@ describe('Settings > About tab', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('shows the current product name', async () => {
|
||||||
|
render(<Settings />)
|
||||||
|
|
||||||
|
expect(await screen.findByRole('heading', { name: 'Code Council' })).toBeInTheDocument()
|
||||||
|
expect(screen.getByAltText('Code Council')).toBeInTheDocument()
|
||||||
|
})
|
||||||
|
|
||||||
it('renders release notes with markdown formatting', async () => {
|
it('renders release notes with markdown formatting', async () => {
|
||||||
render(<Settings />)
|
render(<Settings />)
|
||||||
|
|
||||||
|
|||||||
@ -340,6 +340,8 @@ describe('TabBar', () => {
|
|||||||
|
|
||||||
const scrollRegion = screen.getByTestId('tab-bar').querySelector('.overflow-x-auto')
|
const scrollRegion = screen.getByTestId('tab-bar').querySelector('.overflow-x-auto')
|
||||||
expect(scrollRegion).toBeInTheDocument()
|
expect(scrollRegion).toBeInTheDocument()
|
||||||
|
expect(scrollRegion).toHaveClass('min-w-0')
|
||||||
|
expect(scrollRegion).toHaveClass('flex-1')
|
||||||
|
|
||||||
Object.defineProperty(scrollRegion!, 'clientWidth', {
|
Object.defineProperty(scrollRegion!, 'clientWidth', {
|
||||||
configurable: true,
|
configurable: true,
|
||||||
|
|||||||
@ -4142,8 +4142,8 @@ function AboutSettings() {
|
|||||||
return (
|
return (
|
||||||
<div className="w-full min-w-0 flex flex-col items-center py-6">
|
<div className="w-full min-w-0 flex flex-col items-center py-6">
|
||||||
{/* Logo + App Name + Version */}
|
{/* Logo + App Name + Version */}
|
||||||
<img src={publicAssetPath('app-icon.png')} alt="Claude Code Haha" className="w-20 h-20 mb-4" />
|
<img src={publicAssetPath('app-icon.png')} alt="Code Council" className="w-20 h-20 mb-4" />
|
||||||
<h1 className="text-xl font-bold text-[var(--color-text-primary)]">Claude Code Haha</h1>
|
<h1 className="text-xl font-bold text-[var(--color-text-primary)]">Code Council</h1>
|
||||||
{version && (
|
{version && (
|
||||||
<div className="mt-1 flex items-center gap-2 text-xs text-[var(--color-text-tertiary)]">
|
<div className="mt-1 flex items-center gap-2 text-xs text-[var(--color-text-tertiary)]">
|
||||||
<span>{t('settings.about.version')} {version}</span>
|
<span>{t('settings.about.version')} {version}</span>
|
||||||
|
|||||||
@ -186,7 +186,7 @@ describe('chatStore history mapping', () => {
|
|||||||
sessionStoreSnapshot.sessions = []
|
sessionStoreSnapshot.sessions = []
|
||||||
cliTaskStoreSnapshot.tasks = []
|
cliTaskStoreSnapshot.tasks = []
|
||||||
cliTaskStoreSnapshot.sessionId = null
|
cliTaskStoreSnapshot.sessionId = null
|
||||||
useSessionRuntimeStore.setState({ selections: {} })
|
useSessionRuntimeStore.setState({ selections: {}, coordinatorModes: {}, soloPipelineModes: {} })
|
||||||
localStorage.clear()
|
localStorage.clear()
|
||||||
useChatStore.setState({
|
useChatStore.setState({
|
||||||
...initialState,
|
...initialState,
|
||||||
@ -1606,6 +1606,31 @@ describe('chatStore history mapping', () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('replays Solo Pipeline mode immediately before sending a user turn', () => {
|
||||||
|
useSessionRuntimeStore.setState({ coordinatorModes: {}, soloPipelineModes: { [TEST_SESSION_ID]: true } })
|
||||||
|
useChatStore.setState({
|
||||||
|
sessions: {
|
||||||
|
[TEST_SESSION_ID]: makeSession({ chatState: 'idle' }),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
useChatStore.getState().sendMessage(TEST_SESSION_ID, '继续 solo')
|
||||||
|
|
||||||
|
expect(sendMock).toHaveBeenNthCalledWith(1, TEST_SESSION_ID, {
|
||||||
|
type: 'set_coordinator_mode',
|
||||||
|
enabled: false,
|
||||||
|
})
|
||||||
|
expect(sendMock).toHaveBeenNthCalledWith(2, TEST_SESSION_ID, {
|
||||||
|
type: 'set_pipeline_mode',
|
||||||
|
flavor: 'solo',
|
||||||
|
})
|
||||||
|
expect(sendMock).toHaveBeenNthCalledWith(3, TEST_SESSION_ID, {
|
||||||
|
type: 'user_message',
|
||||||
|
content: '继续 solo',
|
||||||
|
attachments: undefined,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
it('can send a visual selection turn without rendering the full model prompt as user text', () => {
|
it('can send a visual selection turn without rendering the full model prompt as user text', () => {
|
||||||
useChatStore.setState({
|
useChatStore.setState({
|
||||||
sessions: {
|
sessions: {
|
||||||
@ -4460,7 +4485,7 @@ describe('chatStore context-exhausted suggestion (方案3)', () => {
|
|||||||
sendMock.mockReset()
|
sendMock.mockReset()
|
||||||
getMemberBySessionIdMock.mockReset()
|
getMemberBySessionIdMock.mockReset()
|
||||||
getMemberBySessionIdMock.mockReturnValue(null)
|
getMemberBySessionIdMock.mockReturnValue(null)
|
||||||
useSessionRuntimeStore.setState({ selections: {} })
|
useSessionRuntimeStore.setState({ selections: {}, coordinatorModes: {}, soloPipelineModes: {} })
|
||||||
useChatStore.setState({ ...initialState, sessions: {} })
|
useChatStore.setState({ ...initialState, sessions: {} })
|
||||||
// Reset the module-level compaction-thrash tracking for this session id.
|
// Reset the module-level compaction-thrash tracking for this session id.
|
||||||
useChatStore.getState().clearMessages(SID)
|
useChatStore.getState().clearMessages(SID)
|
||||||
@ -4521,7 +4546,7 @@ describe('chatStore message queue', () => {
|
|||||||
sendMock.mockReset()
|
sendMock.mockReset()
|
||||||
getMemberBySessionIdMock.mockReset()
|
getMemberBySessionIdMock.mockReset()
|
||||||
getMemberBySessionIdMock.mockReturnValue(null)
|
getMemberBySessionIdMock.mockReturnValue(null)
|
||||||
useSessionRuntimeStore.setState({ selections: {} })
|
useSessionRuntimeStore.setState({ selections: {}, coordinatorModes: {}, soloPipelineModes: {} })
|
||||||
useChatStore.setState({ ...initialState, sessions: {} })
|
useChatStore.setState({ ...initialState, sessions: {} })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -1176,6 +1176,23 @@ export const useChatStore = create<ChatStore>((set, get) => ({
|
|||||||
// 方案3: count this as a real user turn so rapid re-compaction (thrash)
|
// 方案3: count this as a real user turn so rapid re-compaction (thrash)
|
||||||
// can be told apart from compactions spread across genuine work.
|
// can be told apart from compactions spread across genuine work.
|
||||||
noteUserTurnForCompactionThrash(sessionId)
|
noteUserTurnForCompactionThrash(sessionId)
|
||||||
|
|
||||||
|
// 每次真实用户回合前都把服务端运行模式对齐一次。
|
||||||
|
// 这样即使 renderer 重连或服务端清理了内存标记,UI 里仍开启的
|
||||||
|
// Solo/协调模式也会在本轮消息前重新生效。
|
||||||
|
const runtimeModes = useSessionRuntimeStore.getState()
|
||||||
|
const coordinatorEnabled = runtimeModes.coordinatorModes[sessionId] ?? false
|
||||||
|
const soloPipelineEnabled = runtimeModes.soloPipelineModes[sessionId] ?? false
|
||||||
|
if (soloPipelineEnabled) {
|
||||||
|
wsManager.send(sessionId, { type: 'set_coordinator_mode', enabled: false })
|
||||||
|
wsManager.send(sessionId, { type: 'set_pipeline_mode', flavor: 'solo' })
|
||||||
|
} else if (coordinatorEnabled) {
|
||||||
|
wsManager.send(sessionId, { type: 'set_pipeline_mode', flavor: 'normal' })
|
||||||
|
wsManager.send(sessionId, { type: 'set_coordinator_mode', enabled: true })
|
||||||
|
} else {
|
||||||
|
wsManager.send(sessionId, { type: 'set_coordinator_mode', enabled: false })
|
||||||
|
wsManager.send(sessionId, { type: 'set_pipeline_mode', flavor: 'normal' })
|
||||||
|
}
|
||||||
wsManager.send(sessionId, { type: 'user_message', content, attachments: serverAttachments })
|
wsManager.send(sessionId, { type: 'user_message', content, attachments: serverAttachments })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user