Skip to content

Commit e04c3fd

Browse files
authored
Prompts related optimization (#984)
* feat(prompts): enhance button visibility and layout - Show button only if user is logged in - Add gap between items in prompts list - Clean up unnecessary whitespace in styles * fix(prompts): adjust layout and overflow styles - Update height calculation in PromptsHub - Add overflow-y-auto to PromptsLibrary - Remove fixed positioning in PromptsMenu
1 parent 1baa592 commit e04c3fd

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

frontend/src/components/prompts/PromptsHub.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="w-full min-h-[calc(100vh-153px)] flex md:flex-col text-[#101828] relative">
2+
<div class="w-full h-[calc(100vh-153px)] flex md:flex-col text-[#101828] relative">
33
<PromptsMenu />
44
<PromptsLibrary
55
:current-component="currentComponent"

frontend/src/components/prompts/PromptsIndex.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@change="filterChange"
2020
/>
2121
<CsgButton
22-
v-if="!actionLimited"
22+
v-if="isLoggedIn && !actionLimited"
2323
:loading="loading"
2424
class="btn btn-secondary-gray btn-lg"
2525
@click="changeCurrentComponent('newPromptsList')"
@@ -77,7 +77,7 @@
7777
const promptsData = ref([])
7878
const totalPrompts = ref(0)
7979
80-
const { actionLimited } = storeToRefs(userStore)
80+
const { actionLimited, isLoggedIn } = storeToRefs(userStore)
8181
8282
const emit = defineEmits(['changeCurrentComponent'])
8383
const changeCurrentComponent = (currentComponent) => {

frontend/src/components/prompts/PromptsLibrary.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- 提示词库根页面 -->
22
<template>
3-
<div class="grow text-[#101828] w-full">
4-
<PromptsIndex
3+
<div class="grow text-[#101828] w-full overflow-y-auto">
4+
<PromptsIndex
55
v-if="theCurrentComponent === 'PromptsIndex'"
66
@changeCurrentComponent="changeCurrentComponent"
77
/>

frontend/src/components/prompts/PromptsList.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</div>
2121
<div class="text-sm text-gray-500">{{ repo.description }}</div>
2222
<div
23-
class="flex text-sm text-gray-500 items-center"
23+
class="flex gap-3 text-sm text-gray-500 items-center"
2424
v-if="theModels.length"
2525
>
2626
<span class="min-w-[max-content] text-md text-gray-700">
@@ -326,35 +326,35 @@ import CsgButton from '../shared/CsgButton.vue'
326326
) !important;
327327
}
328328
}
329-
329+
330330
:deep(.el-select) {
331331
--el-component-size-large: 44px !important;
332332
}
333-
333+
334334
:deep(.el-select .el-input) {
335335
height: 44px !important;
336336
}
337-
337+
338338
:deep(.el-select .el-input__wrapper) {
339339
height: 44px !important;
340340
line-height: 44px !important;
341341
padding: 0 16px !important;
342342
}
343-
343+
344344
:deep(.el-select .el-input__inner) {
345345
height: 44px !important;
346346
line-height: 44px !important;
347347
}
348-
348+
349349
:deep(.el-select:not(.el-select--large) .el-input__wrapper) {
350350
height: 44px !important;
351351
}
352-
352+
353353
:deep(.el-select__popper .el-select-dropdown__item) {
354354
height: 44px !important;
355355
line-height: 44px !important;
356356
}
357-
357+
358358
:deep(.btn-prev) {
359359
border-radius: 6px 0 0 6px;
360360
margin: 0 !important;

frontend/src/components/prompts/PromptsMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class="w-[240px] md:hidden md:w-full px-5 pt-[24px] font-medium text-[#475467] border-r"
44
:style="`background:linear-gradient(270deg, #FCFCFC 0%, #FFF 100%)`"
55
>
6-
<div class="flex flex-col fixed top-[104px] gap-1 md:flex-row text-[14px] leading-[24px]">
6+
<div class="flex flex-col top-[104px] gap-1 md:flex-row text-[14px] leading-[24px]">
77
<a
88
href="/prompts/library"
99
class="p-3 hover:bg-[#F9FAFB] rounded-[8px] cursor-pointer"

0 commit comments

Comments
 (0)