fix(client): rename the row rename request type off the Host name
The typert Cordis catalog drops any exported name that two declarations share, so ui-workspace's `SessionRenameRequest` made the generator remove Session Controller's request type from the model-facing API catalog. The row-side pending rename is `SessionRenameTarget`: the Session and the title the dialog seeds from.
This commit is contained in:
1 parent
21586fe28c
commit
4517603c28
4 files changed
+9
-9
No files matched your search
@@ -299,7 +299,7 @@ export interface RenameSessionInjected {
|
||||
}
|
||||
|
||||
/** A Session rename the rename action asked for; the dialog entry opens on it. */
|
||||
export interface SessionRenameRequest {
|
||||
export interface SessionRenameTarget {
|
||||
/** Session to rename. */
|
||||
sessionId: SessionId
|
||||
/** Title the dialog seeds its draft from. */
|
||||
@@ -310,7 +310,7 @@ export interface SessionRenameRequest {
|
||||
export interface SessionRenameDialogInjected {
|
||||
hooks: {
|
||||
/** The rename asked for, until the dialog consumes or cancels it. */
|
||||
renameRequest: HostObservable<SessionRenameRequest | null>
|
||||
renameRequest: HostObservable<SessionRenameTarget | null>
|
||||
}
|
||||
/** Consume or cancel the pending request. */
|
||||
settleSessionRename: () => void
|
||||
|
||||
@@ -32,7 +32,7 @@ import type {} from '@deepseek-ai/dsh-client-ui-session/client'
|
||||
import {
|
||||
type ArchiveSessionInjected, type ForkSessionInjected, menuOpenStateFactory, type PinSessionInjected,
|
||||
type RenameSessionInjected, type RowToast, type RowToastInjected, type RowToastState, type SessionRenameDialogInjected,
|
||||
type SessionRenameRequest, type WorkspaceBrowserInjected, type WorkspacePickerInjected,
|
||||
type SessionRenameTarget, type WorkspaceBrowserInjected, type WorkspacePickerInjected,
|
||||
} from './contract/slots.ts'
|
||||
import { UiWorkspaceService } from './navigation.ts'
|
||||
import { createWorkspaceViewStore } from './stores.ts'
|
||||
@@ -49,7 +49,7 @@ import { en, zh, type WorkspaceKey } from './locales.ts'
|
||||
export type { UiWorkspace } from './navigation.ts'
|
||||
export type {
|
||||
DirectoryFlowOwnerProps, DirectoryFlowSlotName, DirectoryPickingHooks, DirectoryPickingInjected,
|
||||
MenuOpenState, RowToast, SessionRenameRequest, SessionRowOwnerProps, UseMenuOpenState, WorkspaceBrowserInjected,
|
||||
MenuOpenState, RowToast, SessionRenameTarget, SessionRowOwnerProps, UseMenuOpenState, WorkspaceBrowserInjected,
|
||||
WorkspaceBrowserProps,
|
||||
WorkspacePickerInjected, WorkspacePickerProps,
|
||||
} from './contract/slots.ts'
|
||||
@@ -136,7 +136,7 @@ export function apply(ctx: Context): void {
|
||||
// the pending rename request and the notice on display. Each business
|
||||
// writes through its own injected callback and the surface reads through
|
||||
// its bound hook.
|
||||
const renameRequest = createSnapshotStore<SessionRenameRequest | null>(null)
|
||||
const renameRequest = createSnapshotStore<SessionRenameTarget | null>(null)
|
||||
const rowToast = createSnapshotStore<RowToastState | null>(null)
|
||||
let toastSeq = 0
|
||||
const notify = (toast: RowToast): void => { rowToast.set({ ...toast, seq: ++toastSeq }) }
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { useRef, useState } from 'react'
|
||||
import { Button, IconEditOutlineRegular, MenuItemButton, Modal } from '@deepseek-ai/dsh-client-ui-primitives'
|
||||
import type {
|
||||
RenameSessionInjected, SessionMenuItemProps, SessionRenameDialogInjected, SessionRenameDialogProps, SessionRenameRequest,
|
||||
RenameSessionInjected, SessionMenuItemProps, SessionRenameDialogInjected, SessionRenameDialogProps, SessionRenameTarget,
|
||||
} from '../contract/slots.ts'
|
||||
import css from '../rows/WorkspaceBrowser.module.css'
|
||||
|
||||
@@ -58,7 +58,7 @@ export function SessionRenameDialog({ useRenameRequest, settleSessionRename, ren
|
||||
|
||||
/** One request's dialog: the draft seeds from the request on mount; in-flight and error state die with it. */
|
||||
function RenameForm({ request, renameSession, onSettle, t }: {
|
||||
request: SessionRenameRequest
|
||||
request: SessionRenameTarget
|
||||
renameSession: SessionRenameDialogInjected['renameSession']
|
||||
onSettle: () => void
|
||||
t: SessionRenameDialogProps['t']
|
||||
|
||||
@@ -19,7 +19,7 @@ import type { GlobalStandardProps, PropsLocale, PropsRuntime } from '@deepseek-a
|
||||
import { bindSnapshotSelector, makeTranslate } from '@deepseek-ai/dsh-client-test-runtime'
|
||||
import { zh as commonZh } from '@deepseek-ai/dsh-client-locale/src/locales/zh.ts'
|
||||
import type {
|
||||
MenuOpenState, RowToast, RowToastState, SessionRenameDialogInjected, SessionRenameRequest,
|
||||
MenuOpenState, RowToast, RowToastState, SessionRenameDialogInjected, SessionRenameTarget,
|
||||
} from '../src/client/contract/slots.ts'
|
||||
import { ArchiveSessionMenuItem, ArchiveSessionRowButton } from '../src/client/session-actions/ArchiveSession.tsx'
|
||||
import { ForkSessionMenuItem } from '../src/client/session-actions/ForkSession.tsx'
|
||||
@@ -246,7 +246,7 @@ describe('fork and rename rows', () => {
|
||||
describe('SessionRenameDialog', () => {
|
||||
/** The dialog over a test-owned request source; settling clears the request the way apply does. */
|
||||
function renameDialog(renameSession: SessionRenameDialogInjected['renameSession']) {
|
||||
const request = createSnapshotStore<SessionRenameRequest | null>(null)
|
||||
const request = createSnapshotStore<SessionRenameTarget | null>(null)
|
||||
const settleSessionRename = vi.fn(() => { request.set(null) })
|
||||
render(
|
||||
<SessionRenameDialog
|
||||
|
||||
Reference in new issue
Block a user