Fix session title generation
This commit is contained in:
@@ -129,6 +129,16 @@ type ContextBudget = {
|
||||
token_counter_accurate?: boolean;
|
||||
};
|
||||
|
||||
function scheduleSessionListRefresh() {
|
||||
if (typeof window === "undefined") return;
|
||||
window.dispatchEvent(new Event("claw-sessions-changed"));
|
||||
for (const delay of [300, 1000, 2500]) {
|
||||
window.setTimeout(() => {
|
||||
window.dispatchEvent(new Event("claw-sessions-changed"));
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
|
||||
export const Thread: FC = () => {
|
||||
useRefreshReplayedRun();
|
||||
return (
|
||||
@@ -1145,7 +1155,9 @@ function SkillInsertDialog() {
|
||||
setSkills(payload.skills);
|
||||
const changedCount = payload.changed_files?.length ?? 0;
|
||||
if (payload.updated) {
|
||||
const shortHash = payload.after ? payload.after.slice(0, 7) : "最新提交";
|
||||
const shortHash = payload.after
|
||||
? payload.after.slice(0, 7)
|
||||
: "最新提交";
|
||||
setStatus(`Skill 已更新到 ${shortHash},变更 ${changedCount} 个文件。`);
|
||||
} else {
|
||||
setStatus("Skill 已是最新。");
|
||||
@@ -1761,6 +1773,7 @@ const ImeComposerInput: FC<ComponentProps<typeof TextareaAutosize>> = ({
|
||||
const clearAfterSubmit = () => {
|
||||
justSubmittedRef.current = true;
|
||||
setLocalText("");
|
||||
scheduleSessionListRefresh();
|
||||
};
|
||||
const unsubscribeComposer = aui.on("composer.send", clearAfterSubmit);
|
||||
const unsubscribeRun = aui.on("thread.runStart", clearAfterSubmit);
|
||||
|
||||
Reference in New Issue
Block a user