Skip to content

Commit 66e901b

Browse files
Merge pull request #1127 from objectstack-ai/copilot/fix-i18n-object-format
service-ai: complete I18nLabelSchema migration for Setup nav labels
2 parents 1dcc09e + 1210f29 commit 66e901b

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111
- **CI: Replace `pnpm/action-setup@v6` with corepack** — Switched all GitHub Actions workflows (`ci.yml`, `lint.yml`, `release.yml`, `validate-deps.yml`, `pr-automation.yml`) from `pnpm/action-setup@v6` to `corepack enable` to fix persistent `ERR_PNPM_BROKEN_LOCKFILE` errors. Corepack reads the exact `packageManager` field from `package.json` (including SHA verification), ensuring the correct pnpm version is used in CI. Also bumped pnpm store cache keys to v3 and added a pnpm version verification step.
1212
- **Broken pnpm lockfile** — Regenerated `pnpm-lock.yaml` from scratch to fix `ERR_PNPM_BROKEN_LOCKFILE` ("expected a single document in the stream, but found more") that was causing all CI jobs to fail. The previous merge of PR #1117 only included workflow cache key changes but did not carry over the regenerated lockfile.
13+
- **service-ai: Fix navigation item labels using deprecated i18n object format** — Replaced `{ key, defaultValue }` i18n objects with plain string labels in `AIServicePlugin`'s Setup App navigation contributions, completing the `I18nLabelSchema` migration from [#1054](https://github.com/objectstack-ai/framework/issues/1054).
1314

1415
### Added
1516
- **MCP Runtime Server Plugin (`plugin-mcp-server`)** — New kernel plugin that exposes ObjectStack

packages/services/service-ai/src/__tests__/ai-service.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,23 @@ describe('AIServicePlugin', () => {
818818
expect(ctx.replaceService).toHaveBeenCalledWith('ai', expect.any(Object));
819819
});
820820

821+
it('should contribute Setup navigation labels as plain strings', async () => {
822+
const plugin = new AIServicePlugin();
823+
const ctx = createMockContext();
824+
const contribute = vi.fn();
825+
ctx.registerService('setupNav', { contribute });
826+
827+
await plugin.init(ctx);
828+
829+
expect(contribute).toHaveBeenCalledWith({
830+
areaId: 'area_ai',
831+
items: [
832+
expect.objectContaining({ id: 'nav_ai_conversations', label: 'Conversations' }),
833+
expect.objectContaining({ id: 'nav_ai_messages', label: 'Messages' }),
834+
],
835+
});
836+
});
837+
821838
it('should clean up on destroy', async () => {
822839
const plugin = new AIServicePlugin();
823840
const ctx = createMockContext();

packages/services/service-ai/src/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ export class AIServicePlugin implements Plugin {
231231
setupNav.contribute({
232232
areaId: 'area_ai',
233233
items: [
234-
{ id: 'nav_ai_conversations', type: 'object', label: { key: 'setup.nav.ai_conversations', defaultValue: 'Conversations' }, objectName: 'conversations', icon: 'message-square', order: 10 },
235-
{ id: 'nav_ai_messages', type: 'object', label: { key: 'setup.nav.ai_messages', defaultValue: 'Messages' }, objectName: 'messages', icon: 'messages-square', order: 20 },
234+
{ id: 'nav_ai_conversations', type: 'object', label: 'Conversations', objectName: 'conversations', icon: 'message-square', order: 10 },
235+
{ id: 'nav_ai_messages', type: 'object', label: 'Messages', objectName: 'messages', icon: 'messages-square', order: 20 },
236236
],
237237
});
238238
ctx.logger.info('[AI] Navigation items contributed to Setup App');

0 commit comments

Comments
 (0)