Skip to content

Commit 9d0bfeb

Browse files
author
githubnull
committed
fix: optimize AddTask page layout for better space utilization
- Reduce overall height to prevent scrollbar on config panel - Make both code editors equal height - Fix parse/clear buttons visibility - Fix card title being obscured when editor is active - Bump version to 1.7.8
1 parent 8a1f8b3 commit 9d0bfeb

3 files changed

Lines changed: 119 additions & 17 deletions

File tree

src/backEnd/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
MAX_TASKS_COUNT_LOCK = threading.Lock()
55

66

7-
VERSION = "1.7.7"
7+
VERSION = "1.7.8"

src/frontEnd/src/components/HttpCodeEditor.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,8 @@ defineExpose({
549549
border-radius: 6px;
550550
overflow: hidden;
551551
background: var(--surface-card);
552+
min-height: 0;
553+
height: 100%;
552554
553555
&.show-search {
554556
.search-toolbar {
@@ -610,13 +612,26 @@ defineExpose({
610612
.editor-wrapper {
611613
position: relative;
612614
flex: 1;
615+
min-height: 0;
616+
display: flex;
617+
flex-direction: column;
613618
}
614619
615620
.editor-container {
616621
width: 100%;
622+
flex: 1;
623+
min-height: 0;
617624
618625
:deep(.cm-editor) {
619626
height: 100%;
627+
display: flex;
628+
flex-direction: column;
629+
}
630+
631+
:deep(.cm-scroller) {
632+
flex: 1;
633+
min-height: 0;
634+
overflow: auto;
620635
}
621636
}
622637

src/frontEnd/src/views/AddTask/index.vue

Lines changed: 103 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
<HttpCodeEditor
2323
v-model="inputContent"
2424
:placeholder="inputPlaceholder"
25-
min-height="180px"
26-
max-height="250px"
25+
min-height="100px"
26+
max-height="none"
27+
class="flex-editor"
2728
@change="onInputChange"
2829
/>
2930
<div class="input-actions">
@@ -57,8 +58,9 @@
5758
<HttpCodeEditor
5859
v-model="rawHttpContent"
5960
:placeholder="httpPlaceholder"
60-
min-height="280px"
61-
max-height="400px"
61+
min-height="100px"
62+
max-height="none"
63+
class="flex-editor"
6264
/>
6365
<div class="editor-status" v-if="parsedRequest">
6466
<span class="status-item">
@@ -773,41 +775,86 @@ onMounted(async () => {
773775

774776
<style scoped>
775777
.add-task-container {
776-
padding: 1.5rem;
777-
max-width: 1600px;
778-
margin: 0 auto;
778+
width: 100%;
779+
height: 100%;
780+
padding: 0.75rem 1rem;
781+
margin: 0;
782+
box-sizing: border-box;
779783
}
780784
781785
.page-header {
782-
margin-bottom: 1.5rem;
786+
margin-bottom: 0.75rem;
783787
}
784788
785789
.page-header h2 {
786-
margin: 0 0 0.5rem 0;
790+
margin: 0 0 0.25rem 0;
787791
color: var(--text-color);
792+
font-size: 1.25rem;
788793
}
789794
790795
.page-header .subtitle {
791796
margin: 0;
792797
color: var(--text-color-secondary);
793-
font-size: 0.9rem;
798+
font-size: 0.85rem;
794799
}
795800
796801
.content-wrapper {
797802
display: grid;
798-
grid-template-columns: 1fr 480px;
799-
gap: 1.5rem;
803+
grid-template-columns: 1fr 520px;
804+
gap: 1rem;
805+
height: calc(100vh - 180px);
806+
max-height: 800px;
800807
}
801808
802809
.left-panel {
803810
display: flex;
804811
flex-direction: column;
805-
gap: 1rem;
812+
gap: 0.5rem;
813+
min-height: 0;
814+
overflow: visible;
806815
}
807816
808817
.right-panel {
809818
display: flex;
810819
flex-direction: column;
820+
min-height: 0;
821+
overflow: hidden;
822+
}
823+
824+
/* 两个编辑器卡片高度相等 */
825+
.input-card,
826+
.editor-card {
827+
flex: 1 1 0;
828+
min-height: 0;
829+
display: flex;
830+
flex-direction: column;
831+
overflow: visible;
832+
}
833+
834+
.input-card :deep(.p-card-body),
835+
.editor-card :deep(.p-card-body) {
836+
flex: 1;
837+
display: flex;
838+
flex-direction: column;
839+
min-height: 0;
840+
overflow: visible;
841+
}
842+
843+
.input-card :deep(.p-card-content),
844+
.editor-card :deep(.p-card-content) {
845+
flex: 1;
846+
display: flex;
847+
flex-direction: column;
848+
min-height: 0;
849+
}
850+
851+
/* 修复Card标题被遮挡问题 */
852+
.input-card :deep(.p-card-title),
853+
.editor-card :deep(.p-card-title) {
854+
position: relative;
855+
z-index: 1;
856+
background: var(--surface-card);
857+
padding-right: 1rem;
811858
}
812859
813860
.card-title-row {
@@ -817,11 +864,28 @@ onMounted(async () => {
817864
}
818865
819866
/* HttpCodeEditor 组件样式 */
867+
.input-card :deep(.http-code-editor),
868+
.editor-card :deep(.http-code-editor) {
869+
flex: 1;
870+
min-height: 120px;
871+
max-height: none;
872+
}
873+
874+
.flex-editor {
875+
flex: 1;
876+
min-height: 0;
877+
}
820878
879+
/* 按钮区域确保可见 */
821880
.input-actions {
822881
display: flex;
823882
gap: 0.5rem;
824-
margin-top: 1rem;
883+
margin-top: 0.5rem;
884+
padding: 0.25rem 0;
885+
flex-shrink: 0;
886+
position: relative;
887+
z-index: 10;
888+
background: var(--surface-card);
825889
}
826890
827891
.editor-status {
@@ -841,9 +905,17 @@ onMounted(async () => {
841905
}
842906
843907
/* 配置卡片 */
908+
.config-card {
909+
flex: 1;
910+
min-height: 0;
911+
display: flex;
912+
flex-direction: column;
913+
}
914+
844915
.config-card :deep(.p-card-body) {
845-
max-height: calc(100vh - 200px);
916+
flex: 1;
846917
overflow-y: auto;
918+
min-height: 0;
847919
}
848920
849921
.config-group {
@@ -978,17 +1050,32 @@ onMounted(async () => {
9781050
}
9791051
9801052
/* 响应式布局 */
1053+
@media (max-width: 1400px) {
1054+
.content-wrapper {
1055+
grid-template-columns: 1fr 480px;
1056+
}
1057+
}
1058+
9811059
@media (max-width: 1200px) {
9821060
.content-wrapper {
9831061
grid-template-columns: 1fr;
1062+
height: auto;
1063+
}
1064+
1065+
.left-panel, .right-panel {
1066+
overflow: visible;
9841067
}
9851068
9861069
.config-card :deep(.p-card-body) {
987-
max-height: none;
1070+
max-height: 600px;
9881071
}
9891072
}
9901073
9911074
@media (max-width: 768px) {
1075+
.add-task-container {
1076+
padding: 0.5rem;
1077+
}
1078+
9921079
.config-grid {
9931080
grid-template-columns: 1fr;
9941081
}

0 commit comments

Comments
 (0)