prompt-optimizer icon indicating copy to clipboard operation
prompt-optimizer copied to clipboard

feat(template): 修复在切换模板语言后,模板选择器不响应式更新

Open Su-u-un opened this issue 5 months ago • 1 comments

问题描述

  1. 在模板管理器,对语言进行切换后,点击关闭按钮,关闭模板管理器的弹窗,发现模板选择器没有响应式更新(如果是点击遮罩层不会出现此bug,因为点击遮罩层把模板选择器也手动关闭了)
  2. 同时模板选择器选中的模板名也没有更新。 CPT2506261035-696x300

相关修复

  • 在关闭模板管理后,对模板选择器的模板列表进行更新
  • 在模板选择器中,对展示的模板进行更新

未修复问题

模板选择器中模板的描述词过长,会导致组件宽度超出外部容器,内容被截断。暂时未找到好的方式修复

Su-u-un avatar Jun 26 '25 02:06 Su-u-un

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
prompt-optimizer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2025 1:37am

vercel[bot] avatar Jun 26 '25 02:06 vercel[bot]

bugbot run

linshenkx avatar Jun 27 '25 00:06 linshenkx

Bug: Null/Undefined Handling in Array Comparison

The deepCompareTemplateContent function's array comparison logic assumes array elements are valid objects with role and content properties. Without null/undefined checks, accessing item.role or item.content can cause a TypeError if an array element is null, undefined, or lacks these properties.

packages/ui/src/components/TemplateSelect.vue#L230-L235 Fix in Cursor

Was this report helpful? Give feedback by reacting with 👍 or 👎

过度工程化,不需要处理

linshenkx avatar Jun 27 '25 01:06 linshenkx

感谢 Su-u-un 发现的bug并提出修复 !

linshenkx avatar Jun 27 '25 01:06 linshenkx