Skip to content

Commit 8aebc6b

Browse files
committed
fix(prompts): resolve sub-tab refresh empty content race condition; chore: remove docs folder; bump version to 0.1.14
1 parent 904f779 commit 8aebc6b

5 files changed

Lines changed: 23 additions & 32 deletions

File tree

docs/fixes/pi-provider-id-isolation-and-model-status.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codexmate",
3-
"version": "0.1.13",
3+
"version": "0.1.14",
44
"description": "Codex/Claude Code/OpenClaw 配置、会话与任务编排 CLI + Web 工具",
55
"main": "cli.js",
66
"bin": {

tests/unit/web-ui-behavior-parity.test.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,7 @@ test('captured bundled app skeleton only exposes expected data key drift versus
730730
'setPromptPresetRenameDraft',
731731
'switchPromptsSubTab',
732732
'loadPromptsContent',
733+
'loadPromptsTabContent',
733734
'openSessionLink',
734735
'saveNavState',
735736
'isLocalBridgeExcluded',

web-ui/app.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,11 @@ document.addEventListener('DOMContentLoaded', () => {
587587
return true;
588588
}
589589
})();
590-
void this.loadWebUiPreferences({ applyNavigation: applyPreferenceNavigation });
590+
this.loadWebUiPreferences({ applyNavigation: applyPreferenceNavigation }).then(() => {
591+
if (this.mainTab === 'prompts' && typeof this.loadPromptsTabContent === 'function') {
592+
this.loadPromptsTabContent();
593+
}
594+
});
591595
}
592596
if (typeof this.t === 'function') {
593597
this.confirmDialogConfirmText = this.t('confirm.ok');
@@ -786,14 +790,7 @@ document.addEventListener('DOMContentLoaded', () => {
786790
return;
787791
}
788792
if (newTab === 'prompts') {
789-
if (this.promptsSubTab === 'claude-project' && !this.projectPathOptions.length && !this.projectPathOptionsLoading && typeof this.loadProjectPathOptions === 'function') {
790-
this.loadProjectPathOptions();
791-
}
792-
if (this.promptsSubTab === 'system') {
793-
if (typeof this.loadSystemPrompt === 'function') this.loadSystemPrompt();
794-
} else if (typeof this.loadPromptsContent === 'function') {
795-
this.loadPromptsContent();
796-
}
793+
if (typeof this.loadPromptsTabContent === 'function') this.loadPromptsTabContent();
797794
}
798795
},
799796
promptsSubTab(newVal) {
@@ -805,11 +802,7 @@ document.addEventListener('DOMContentLoaded', () => {
805802
return;
806803
}
807804
if (this.mainTab === 'prompts') {
808-
if (this.promptsSubTab === 'system') {
809-
if (typeof this.loadSystemPrompt === 'function') this.loadSystemPrompt();
810-
} else if (typeof this.loadPromptsContent === 'function') {
811-
this.loadPromptsContent();
812-
}
805+
if (typeof this.loadPromptsTabContent === 'function') this.loadPromptsTabContent();
813806
}
814807
},
815808
projectClaudeMdPath(newPath) {

web-ui/modules/app.methods.agents.mjs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -980,17 +980,28 @@ export function createAgentsMethods(options = {}) {
980980
this.loadProjectPathOptions();
981981
}
982982
if (this.promptsSubTab === normalized) {
983-
if (normalized === 'system') this.loadSystemPrompt();
984-
else this.loadPromptsContent();
983+
if (typeof this.loadPromptsTabContent === 'function') this.loadPromptsTabContent();
985984
return;
986985
}
986+
this.__skipNextPromptsSubTabLoad = true;
987987
this.promptsSubTab = normalized;
988-
if (normalized === 'system') this.loadSystemPrompt();
988+
if (typeof this.loadPromptsTabContent === 'function') this.loadPromptsTabContent();
989989
this.$nextTick(() => {
990990
document.querySelector('.main-panel')?.scrollTo({ top: 0, left: 0, behavior: 'auto' });
991991
});
992992
},
993993

994+
loadPromptsTabContent() {
995+
if (this.promptsSubTab === 'system') {
996+
if (typeof this.loadSystemPrompt === 'function') this.loadSystemPrompt();
997+
} else {
998+
if (this.promptsSubTab === 'claude-project' && !this.projectPathOptions.length && !this.projectPathOptionsLoading && typeof this.loadProjectPathOptions === 'function') {
999+
this.loadProjectPathOptions();
1000+
}
1001+
if (typeof this.loadPromptsContent === 'function') this.loadPromptsContent();
1002+
}
1003+
},
1004+
9941005
async loadPromptsContent() {
9951006
const requestToken = issueLatestRequestToken(this, '_agentsOpenRequestToken');
9961007
this.agentsLoading = true;

0 commit comments

Comments
 (0)