Skip to content

Commit 5b4523c

Browse files
committed
renamed local-model access lib to open-ai-api-standard. Updates to the styling of the converations panel.
added a new "start new conversation" option at the end of the conversations list for easily starting a new conversation.
1 parent 4ead6c5 commit 5b4523c

File tree

5 files changed

+48
-9
lines changed

5 files changed

+48
-9
lines changed

src/components/chat-header.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<script setup>
44
import { ref, computed } from 'vue';
5-
import { Settings, Trash2, MessagesSquare, Save, Github } from 'lucide-vue-next';
5+
import { Settings, Trash2, MessagesSquare, MessageSquareDiff, Github } from 'lucide-vue-next';
66
77
// Define props
88
const props = defineProps({
@@ -72,7 +72,7 @@ function onShowConversationsClick() {
7272
<MessagesSquare :stroke-width="0.5" :size="30" />
7373
</div>
7474
<span class="save-icon" @click="clearMessages">
75-
<Save :stroke-width="0.5" :size="30" />
75+
<MessageSquareDiff :stroke-width="0.5" :size="30" />
7676
</span>
7777
</div>
7878
</template>
@@ -142,6 +142,7 @@ $shadow-spread-radius: 0px;
142142
}
143143
144144
.save-icon {
145+
display: none;
145146
padding: 2px;
146147
top: 10%;
147148
right: 10px;
@@ -154,6 +155,10 @@ $shadow-spread-radius: 0px;
154155
&:hover {
155156
transform: scale(1.15);
156157
}
158+
159+
@media (max-width: 600px) {
160+
display: inline;
161+
}
157162
}
158163
159164

src/components/conversations-dialog.vue

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup>
22
import { onMounted, ref, computed } from 'vue';
3-
import { Eraser, Download, Upload } from 'lucide-vue-next';
3+
import { Eraser, Download, Upload, MessageSquarePlus } from 'lucide-vue-next';
44
// import ToolTip from './ToolTip.vue';
55
66
const props = defineProps({
@@ -47,7 +47,7 @@ function handleDoubleClick() {
4747
}
4848
4949
onMounted(() => {
50-
sidebarContentContainer.value = document.querySelector(".reize-container");
50+
sidebarContentContainer.value = document.querySelector(".resize-container");
5151
sidebarContentContainer.value.style.width = '420px';
5252
const lastConversationId = parseInt(localStorage.getItem("lastConversationId")) || 0;
5353
const lastConversation = props.conversations.find(conversation => conversation.id === lastConversationId);
@@ -75,6 +75,9 @@ async function loadSelectedConversation(conversation) {
7575
emit('load-conversation', conversation);
7676
}
7777
78+
function startNewConversation() {
79+
emit('new-conversation');
80+
}
7881
7982
function importConversations() {
8083
emit('import-conversations');
@@ -98,7 +101,7 @@ function toggleSidebar() {
98101
</script>
99102

100103
<template>
101-
<div class="reize-container">
104+
<div class="resize-container">
102105

103106
<div class="settings-header">
104107
<h2>
@@ -117,6 +120,12 @@ function toggleSidebar() {
117120
:class="{ 'selected': selectedConversation && selectedConversation.id === conversation.id }">
118121
<span>{{ conversation.conversation.title }}</span>
119122
</li>
123+
<li class="new-conversation-option" @click="startNewConversation">
124+
<span class="new-icon">
125+
<MessageSquarePlus :stroke-width="1.0" /> &nbsp;&nbsp;
126+
</span>
127+
Start New Conversation
128+
</li>
120129
</ul>
121130
</div>
122131

@@ -141,7 +150,6 @@ $shadow-blur-radius: 2px;
141150
$shadow-spread-radius: 0px;
142151
$icon-color: rgb(187, 187, 187);
143152
144-
145153
.resize-handle {
146154
position: absolute;
147155
top: 0;
@@ -220,10 +228,36 @@ $icon-color: rgb(187, 187, 187);
220228
height: calc(87vh - 100px);
221229
}
222230
231+
max-width: 100%;
232+
overflow-x: hidden;
223233
width: 100%;
224234
height: calc(97vh - 97px);
225235
min-height: 0vh;
226236
overflow: auto;
237+
box-sizing: border-box;
238+
239+
.new-conversation-option {
240+
text-align: left;
241+
background-color: #0B302E;
242+
color: #FFFFFF;
243+
font-weight: bold;
244+
border-radius: 5px;
245+
padding: 15px;
246+
padding-top: 24px;
247+
display: flex;
248+
cursor: pointer;
249+
position: relative;
250+
251+
&:hover {
252+
background-color: #082625;
253+
}
254+
255+
.new-icon {
256+
text-align: left;
257+
margin-top: -3px;
258+
}
259+
}
260+
227261
228262
ul {
229263
list-style-type: none;

src/libs/image-analysis.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { fetchGPTVisionResponse } from './gpt-api-access.js';
22
import { fetchClaudeVisionResponse } from './claude-api-access.js';
3-
import { fetchOpenAiLikeVisionResponse } from './local-model-access.js';
3+
import { fetchOpenAiLikeVisionResponse } from './open-ai-api-standard-access.js';
44

55
// Encode image as base64
66
async function encodeImage(file) {

src/views/ChatLayout.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { loadConversationTitles, loadStoredConversations, fetchGPTResponseStream
77
import { fetchClaudeConversationTitle, streamClaudeResponse } from '@/libs/claude-api-access';
88
import { getConversationTitleFromGPT, showToast } from '@/libs/utils';
99
import { analyzeImage } from '@/libs/image-analysis';
10-
import { fetchLocalModelResponseStream } from '@/libs/local-model-access';
10+
import { fetchLocalModelResponseStream } from '@/libs/open-ai-api-standard-access';
1111
1212
import messageItem from '@/components/message-item.vue';
1313
import chatInput from '@/components/chat-input.vue';
@@ -1131,7 +1131,7 @@ pre {
11311131
// Common styles for both sidebars
11321132
.sidebar-common {
11331133
background-color: #151517;
1134-
width: 50vw; // Adjust the width as needed
1134+
width: 28vw; // Adjust the width as needed
11351135
min-width: 25vw;
11361136
max-width: 100%; // Ensure it doesn't exceed the screen width
11371137
height: 100vh; // Full height

0 commit comments

Comments
 (0)