mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
address skill workshop review comments
This commit is contained in:
@@ -3087,18 +3087,17 @@ export function renderApp(state: AppViewState) {
|
||||
state.skillWorkshopStatusFilter,
|
||||
state.skillWorkshopQuery,
|
||||
);
|
||||
const selectedIndex = Math.max(
|
||||
0,
|
||||
visibleProposals.findIndex(
|
||||
(proposal) => proposal.key === state.skillWorkshopSelectedKey,
|
||||
),
|
||||
const selectedIndex = visibleProposals.findIndex(
|
||||
(proposal) => proposal.key === state.skillWorkshopSelectedKey,
|
||||
);
|
||||
const selectRelativeProposal = (delta: -1 | 1) => {
|
||||
if (visibleProposals.length === 0) {
|
||||
return;
|
||||
}
|
||||
const nextIndex =
|
||||
(selectedIndex + delta + visibleProposals.length) % visibleProposals.length;
|
||||
selectedIndex < 0
|
||||
? 0
|
||||
: (selectedIndex + delta + visibleProposals.length) % visibleProposals.length;
|
||||
selectSkillWorkshopProposal(state, visibleProposals[nextIndex].key);
|
||||
};
|
||||
return m.renderSkillWorkshop({
|
||||
@@ -3123,7 +3122,6 @@ export function renderApp(state: AppViewState) {
|
||||
onQueryChange: (query) => (state.skillWorkshopQuery = query),
|
||||
onFilePreviewQueryChange: (query) => (state.skillWorkshopFilePreviewQuery = query),
|
||||
onQueueWidthChange: (width) => (state.skillWorkshopQueueWidth = width),
|
||||
onQueueWidthCommit: (width) => (state.skillWorkshopQueueWidth = width),
|
||||
onModeChange: (mode) => (state.skillWorkshopMode = mode),
|
||||
onSelect: (key) => {
|
||||
state.skillWorkshopFilePreviewKey = null;
|
||||
@@ -3144,7 +3142,7 @@ export function renderApp(state: AppViewState) {
|
||||
},
|
||||
onRevisionSubmit: (key) =>
|
||||
void requestSkillWorkshopRevision(state, key, async (message) => {
|
||||
state.setTab("chat" as import("./navigation.ts").Tab);
|
||||
state.setTab("chat" as Tab);
|
||||
await state.handleSendChat(message, { restoreDraft: true });
|
||||
}),
|
||||
onPreviewFile: (key, path) => {
|
||||
|
||||
@@ -77,7 +77,6 @@ export type SkillWorkshopProps = {
|
||||
onQueryChange: (query: string) => void;
|
||||
onFilePreviewQueryChange: (query: string) => void;
|
||||
onQueueWidthChange: (width: number) => void;
|
||||
onQueueWidthCommit: (width: number) => void;
|
||||
onModeChange: (mode: SkillWorkshopMode) => void;
|
||||
onSelect: (key: string) => void;
|
||||
onPrev: () => void;
|
||||
@@ -273,7 +272,6 @@ function startQueueResize(event: PointerEvent, props: SkillWorkshopProps): void
|
||||
|
||||
const startX = event.clientX;
|
||||
const startWidth = props.queueWidth;
|
||||
let currentWidth = startWidth;
|
||||
const body = document.body;
|
||||
const previousCursor = body.style.cursor;
|
||||
const previousUserSelect = body.style.userSelect;
|
||||
@@ -289,13 +287,11 @@ function startQueueResize(event: PointerEvent, props: SkillWorkshopProps): void
|
||||
};
|
||||
|
||||
const onMove = (moveEvent: PointerEvent) => {
|
||||
currentWidth = startWidth + moveEvent.clientX - startX;
|
||||
props.onQueueWidthChange(currentWidth);
|
||||
props.onQueueWidthChange(startWidth + moveEvent.clientX - startX);
|
||||
};
|
||||
|
||||
const onUp = () => {
|
||||
cleanup();
|
||||
props.onQueueWidthCommit(currentWidth);
|
||||
};
|
||||
|
||||
window.addEventListener("pointermove", onMove);
|
||||
@@ -309,7 +305,7 @@ function resizeQueueWithKeyboard(event: KeyboardEvent, props: SkillWorkshopProps
|
||||
}
|
||||
event.preventDefault();
|
||||
const delta = event.key === "ArrowLeft" ? -24 : 24;
|
||||
props.onQueueWidthCommit(props.queueWidth + delta);
|
||||
props.onQueueWidthChange(props.queueWidth + delta);
|
||||
}
|
||||
|
||||
function renderLifecycleTabs(props: SkillWorkshopProps) {
|
||||
|
||||
Reference in New Issue
Block a user