Copilot commented on code in PR #818:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/818#discussion_r3702381332


##########
web/src/pages/ai/chatDraft.ts:
##########
@@ -18,16 +18,21 @@
 export interface ChatDraft {
   prompt: string;
   model?: string;
+  mode?: string;
 }
 
+const SUPPORTED_MODES = new Set(['query', 'diagnose', 'manage', 'chat']);
+

Review Comment:
   `ChatDraft.mode` is typed as a free-form `string`, while `getChatDraft` only 
allows a fixed set of modes. This weakens type-safety (e.g., future call sites 
could accidentally pass an unsupported mode without TypeScript catching it) and 
duplicates the same mode list in multiple places (home page, draft parser, AI 
page). Consider introducing a shared `AiMode` union type (and possibly 
exporting the supported mode set) and using it for `activeMode`, `chatMode`, 
and `ChatDraft.mode` to prevent drift.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to