mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
feat(ui): dock repo and session tools in a desktop side panel
Add a docked desktop tool panel with an icon rail, driven by the shared panel URL param, and keep the mobile dialogs and drawers. Extract dialog bodies into reusable content components, rename the walkthrough dialog to a sheet, and make walkthrough generation asynchronous with client polling.
This commit is contained in:
1 parent
bdbcc60716
commit
485ab940aa
49 files changed
+2631
-1753
No files matched your search
@@ -1,29 +1,25 @@
|
||||
import { fetchWrapper } from './fetchWrapper'
|
||||
import { API_BASE_URL } from '@/config'
|
||||
import type {
|
||||
ChangeWalkthrough,
|
||||
ChangeWalkthroughState,
|
||||
GenerateChangeWalkthroughRequest,
|
||||
} from '@opencode-manager/shared/schemas'
|
||||
|
||||
function walkthroughUrl(sessionId: string): string {
|
||||
return `${API_BASE_URL}/api/change-walkthroughs/${encodeURIComponent(sessionId)}`
|
||||
}
|
||||
|
||||
export async function getChangeWalkthrough(sessionId: string): Promise<ChangeWalkthroughState> {
|
||||
return fetchWrapper<ChangeWalkthroughState>(
|
||||
`${API_BASE_URL}/api/change-walkthroughs/${encodeURIComponent(sessionId)}`,
|
||||
)
|
||||
return fetchWrapper<ChangeWalkthroughState>(walkthroughUrl(sessionId))
|
||||
}
|
||||
|
||||
export async function generateChangeWalkthrough(
|
||||
sessionId: string,
|
||||
request: GenerateChangeWalkthroughRequest,
|
||||
): Promise<ChangeWalkthrough> {
|
||||
const res = await fetchWrapper<{ walkthrough: ChangeWalkthrough }>(
|
||||
`${API_BASE_URL}/api/change-walkthroughs/${encodeURIComponent(sessionId)}`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(request),
|
||||
timeout: 150_000,
|
||||
},
|
||||
)
|
||||
return res.walkthrough
|
||||
): Promise<ChangeWalkthroughState> {
|
||||
return fetchWrapper<ChangeWalkthroughState>(walkthroughUrl(sessionId), {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(request),
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user