You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "tju-yxq (via GitHub)" <gi...@apache.org> on 2026/09/29 17:16:08 UTC

[PR] feat(ai): scope custom prompt templates per user [rocketmq-dashboard]

tju-yxq opened a new pull request, #5164:
URL: https://github.com/apache/rocketmq-dashboard/pull/5164

   ### Which Issue(s) This PR Fixes
   
   - Fixes #5163
   
   ### Brief Description
   
   Custom prompt templates move from one global `localStorage` key to an account-scoped key derived from the signed-in user (`userId`, falling back to the username). The template modal passes the owner from `useAuthStore` through `loadPromptTemplateCatalog` / `saveCustomPromptTemplate` / `deleteCustomPromptTemplate`, so each account sees and edits only its own snippets. The ownerless legacy key migrates to the scoped key only in unauthenticated single-user mode; for authenticated accounts it is cleared rather than assigned, so the cross-account disclosure cannot survive the upgrade. The corrupt-JSON repair behaviour from #4575 is preserved on the scoped keys, and the rebase onto current `master` re-targets the wiring at the `PromptTemplateModal` component extracted by the #4606 conversation-platform refactor.
   
   ### How Did You Test This Change?
   
   Run on the branch (`cd3ca43c`, based on `master` @ `0228dad5`):
   
   ```
   cd web && npm test -- promptTemplates AiPage --run
   Test Files  2 passed (2)
        Tests  30 passed (30)
   
   cd web && npm run lint
   0 errors (11 pre-existing warnings in unrelated files)
   ```
   
   The `promptTemplates` suite covers: per-user isolation (alice saves, bob's catalog stays empty), the legacy key not being assigned to the first authenticated account, the legacy migration in unauthenticated single-user mode, and the #4575 corrupt-JSON repair on the scoped key. The `AiPage` suite covers the page-level flows including the prompt template modal.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits
   - [x] Tests added or updated for non-trivial changes, test methods named `...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit checks)
   - [x] New source files carry the ASF license header
   - [ ] Documentation touched where behaviour changed (README / `docs/` / in-app help)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(ai): scope custom prompt templates per user [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #5164: feat(ai): scope custom prompt templates per user
URL: https://github.com/apache/rocketmq-dashboard/pull/5164


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(ai): scope custom prompt templates per user [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5164:
URL: https://github.com/apache/rocketmq-dashboard/pull/5164#issuecomment-6071663854

   This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org