Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/renderer/src/components/icons/ModelIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,11 @@ const invert = computed(() => {
</script>

<template>
<div>
<img
:src="icons[iconKey]"
:alt="iconKey"
:class="[customClass, { invert }, invert ? 'opacity-50' : '']"
/>
</div>
<img
:src="icons[iconKey]"
:alt="iconKey"
:class="[customClass, { invert }, invert ? 'opacity-50' : '']"
/>
Comment on lines +177 to +181
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix undefined binding: use props.customClass in template

customClass is a prop on props. Referencing it bare in the template resolves to an undefined binding and drops the intended size classes, which likely re-introduces the alignment issue you’re fixing.

Apply this diff:

-  <img
-    :src="icons[iconKey]"
-    :alt="iconKey"
-    :class="[customClass, { invert }, invert ? 'opacity-50' : '']"
-  />
+  <img
+    :src="icons[iconKey]"
+    :alt="iconKey"
+    loading="lazy"
+    decoding="async"
+    draggable="false"
+    :class="[props.customClass, { invert }, invert ? 'opacity-50' : '']"
+  />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<img
:src="icons[iconKey]"
:alt="iconKey"
:class="[customClass, { invert }, invert ? 'opacity-50' : '']"
/>
<img
:src="icons[iconKey]"
:alt="iconKey"
loading="lazy"
decoding="async"
draggable="false"
:class="[props.customClass, { invert }, invert ? 'opacity-50' : '']"
/>
🤖 Prompt for AI Agents
In src/renderer/src/components/icons/ModelIcon.vue around lines 177-181 the
template references customClass directly which is undefined in this component
scope; change the binding to use props.customClass instead (i.e.,
:class="[props.customClass, { invert }, invert ? 'opacity-50' : '']") so the
passed-in size/alignment classes are applied correctly.

</template>

<style scoped>
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/src/components/message/MessageItemAssistant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
>
<ModelIcon
:model-id="currentMessage.model_provider"
custom-class=" block"
class="w-3 h-3"
custom-class="w-3 h-3"
:is-dark="themeStore.isDark"
:alt="currentMessage.role"
/>
Expand Down