From bcc49144677b6178a1b48b4977a542c2ec53b0c4 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 22 Sep 2024 19:15:24 +0300 Subject: [PATCH] Auto-hide instruct sequences in
--- public/index.html | 178 +++++++++++++++++--------------- public/scripts/instruct-mode.js | 8 ++ public/style.css | 9 ++ 3 files changed, 112 insertions(+), 83 deletions(-) diff --git a/public/index.html b/public/index.html index 80977d878..6c11b4a87 100644 --- a/public/index.html +++ b/public/index.html @@ -3357,100 +3357,112 @@ -
-
- -
- + +
+ User Message Sequences +
+
+ User Message Prefix + +
+
+ User Message Suffix +
-
- -
- +
+
+ Assistant Message Sequences +
+
+ Assistant Message Prefix + +
+
+ Assistant Message Suffix +
-
-
-
- User Message Prefix - +
+
+ System Message Sequences +
+
+ System Message Prefix + +
+
+ System Message Suffix + +
-
- User Message Suffix - +
+
-
-
-
- Assistant Message Prefix - +
+
+ System Prompt Sequences +
+
+ +
+ +
+
+
+ +
+ +
+
-
- Assistant Message Suffix - +
+
+ Misc. Sequences +
+
+ First Assistant Prefix + +
+
+ Last Assistant Prefix + +
- -
-
- System Message Prefix - +
+
+ First User Prefix + +
+
+ Last User Prefix + +
-
- System Message Suffix - +
+
+ System Instruction Prefix + +
+
+ Stop Sequence + +
-
-
- -
- -
- Misc. Sequences -
-
-
- First Assistant Prefix - +
+
+ User Filler Message + +
-
- Last Assistant Prefix - -
-
-
-
- First User Prefix - -
-
- Last User Prefix - -
-
-
-
- System Instruction Prefix - -
-
- Stop Sequence - -
-
-
-
- User Filler Message - -
-
+
diff --git a/public/scripts/instruct-mode.js b/public/scripts/instruct-mode.js index 30badcc31..033f5c3e8 100644 --- a/public/scripts/instruct-mode.js +++ b/public/scripts/instruct-mode.js @@ -682,4 +682,12 @@ jQuery(() => { selectMatchingContextTemplate(name); } }); + + if (!CSS.supports('field-sizing', 'content')) { + $('#InstructSequencesColumn details').on('toggle', function () { + if ($(this).prop('open')) { + resetScrollHeight($(this).find('textarea')); + } + }); + } }); diff --git a/public/style.css b/public/style.css index a7fb7d5cd..8cfd7e508 100644 --- a/public/style.css +++ b/public/style.css @@ -5469,3 +5469,12 @@ body:not(.movingUI) .drawer-content.maximized { #AdvancedFormatting .autoSetHeight { overflow-wrap: anywhere; } + +#InstructSequencesColumn summary { + font-size: 0.95em; + cursor: pointer; +} + +#InstructSequencesColumn details:not(:last-of-type) { + margin-bottom: 5px; +}