diff --git a/public/css/mobile-styles.css b/public/css/mobile-styles.css
index ec2d80e4f..dd448c5e9 100644
--- a/public/css/mobile-styles.css
+++ b/public/css/mobile-styles.css
@@ -188,7 +188,8 @@
#showRawPrompt,
#copyPromptToClipboard,
- #groupCurrentMemberPopoutButton {
+ #groupCurrentMemberPopoutButton,
+ #summaryExtensionPopoutButton {
display: none;
}
diff --git a/public/css/toggle-dependent.css b/public/css/toggle-dependent.css
index 9dac7e9d8..fa60bd0ce 100644
--- a/public/css/toggle-dependent.css
+++ b/public/css/toggle-dependent.css
@@ -329,7 +329,8 @@ body.movingUI #expression-holder,
body.movingUI .zoomed_avatar,
body.movingUI .draggable,
body.movingUI #floatingPrompt,
-body.movingUI #groupMemberListPopout {
+body.movingUI #groupMemberListPopout,
+body.movingUI #summaryExtensionPopout {
resize: both;
}
diff --git a/public/scripts/extensions/memory/index.js b/public/scripts/extensions/memory/index.js
index 8bc6a630f..4d2f1c31a 100644
--- a/public/scripts/extensions/memory/index.js
+++ b/public/scripts/extensions/memory/index.js
@@ -3,6 +3,8 @@ import { getContext, getApiUrl, extension_settings, doExtrasFetch, modules } fro
import { eventSource, event_types, extension_prompt_types, generateQuietPrompt, is_send_press, saveSettingsDebounced, substituteParams } from "../../../script.js";
import { is_group_generating, selected_group } from "../../group-chats.js";
import { registerSlashCommand } from "../../slash-commands.js";
+import { loadMovingUIState } from '../../power-user.js';
+import { dragElement } from "../../RossAscends-mods.js";
export { MODULE_NAME };
const MODULE_NAME = '1_memory';
@@ -547,100 +549,175 @@ function setMemoryContext(value, saveToMessage) {
}
}
+function doPopout(e) {
+ const target = e.target;
+ //repurposes the zoomed avatar template to server as a floating div
+ if ($("#summaryExtensionPopout").length === 0) {
+ console.debug('did not see popout yet, creating')
+ const originalHTMLClone = $(target).parent().parent().parent().find('.inline-drawer-content').html()
+ const originalElement = $(target).parent().parent().parent().find('.inline-drawer-content')
+ const template = $('#zoomed_avatar_template').html();
+ const controlBarHtml = `
`
+ const newElement = $(template);
+ newElement.attr('id', 'summaryExtensionPopout');
+ newElement.removeClass('zoomed_avatar')
+ newElement.empty()
+ const prevSummaryBoxContents = $('#memory_contents').val(); //copy summary box before emptying
+ originalElement.empty();
+ originalElement.html(`Currently popped out
`)
+ newElement.append(controlBarHtml).append(originalHTMLClone)
+ $('body').append(newElement);
+ $("#summaryExtensionDrawerContents").addClass('scrollableInnerFull')
+ setMemoryContext(prevSummaryBoxContents, false); //paste prev summary box contents into popout box
+ setupListeners();
+ loadSettings();
+ loadMovingUIState();
+
+ $("#summaryExtensionPopout").fadeIn(250);
+ dragElement(newElement);
+
+ //setup listener for close button to restore extensions menu
+ $('#summaryExtensionPopoutClose').off('click').on('click', function () {
+ $("#summaryExtensionDrawerContents").removeClass('scrollableInnerFull')
+ const summaryPopoutHTML = $("#summaryExtensionDrawerContents")
+ $("#summaryExtensionPopout").fadeOut(250, () => {
+ originalElement.empty();
+ originalElement.html(summaryPopoutHTML);
+ $("#summaryExtensionPopout").remove()
+ })
+ loadSettings();
+ })
+ } else {
+ console.debug('saw existing popout, removing')
+ $("#summaryExtensionPopout").fadeOut(250, () => { $("#summaryExtensionPopoutClose").trigger('click') });
+ }
+}
+
+function setupListeners() {
+ //setup shared listeners for popout and regular ext menu
+ $('#memory_restore').off('click').on('click', onMemoryRestoreClick);
+ $('#memory_contents').off('click').on('input', onMemoryContentInput);
+ $('#memory_long_length').off('click').on('input', onMemoryLongInput);
+ $('#memory_short_length').off('click').on('input', onMemoryShortInput);
+ $('#memory_repetition_penalty').off('click').on('input', onMemoryRepetitionPenaltyInput);
+ $('#memory_temperature').off('click').on('input', onMemoryTemperatureInput);
+ $('#memory_length_penalty').off('click').on('input', onMemoryLengthPenaltyInput);
+ $('#memory_frozen').off('click').on('input', onMemoryFrozenInput);
+ $('#summary_source').off('click').on('change', onSummarySourceChange);
+ $('#memory_prompt_words').off('click').on('input', onMemoryPromptWordsInput);
+ $('#memory_prompt_interval').off('click').on('input', onMemoryPromptIntervalInput);
+ $('#memory_prompt').off('click').on('input', onMemoryPromptInput);
+ $('#memory_force_summarize').off('click').on('click', forceSummarizeChat);
+ $('#memory_template').off('click').on('input', onMemoryTemplateInput);
+ $('#memory_depth').off('click').on('input', onMemoryDepthInput);
+ $('input[name="memory_position"]').off('click').on('change', onMemoryPositionChange);
+ $('#memory_prompt_words_force').off('click').on('input', onMemoryPromptWordsForceInput);
+ $("#summarySettingsBlockToggle").off('click').on('click', function () {
+ console.log('saw settings button click')
+ $("#summarySettingsBlock").slideToggle(200, "swing"); //toggleClass("hidden");
+ });
+}
+
jQuery(function () {
function addExtensionControls() {
const settingsHtml = `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
`;
$('#extensions_settings2').append(settingsHtml);
- $('#memory_restore').on('click', onMemoryRestoreClick);
- $('#memory_contents').on('input', onMemoryContentInput);
- $('#memory_long_length').on('input', onMemoryLongInput);
- $('#memory_short_length').on('input', onMemoryShortInput);
- $('#memory_repetition_penalty').on('input', onMemoryRepetitionPenaltyInput);
- $('#memory_temperature').on('input', onMemoryTemperatureInput);
- $('#memory_length_penalty').on('input', onMemoryLengthPenaltyInput);
- $('#memory_frozen').on('input', onMemoryFrozenInput);
- $('#summary_source').on('change', onSummarySourceChange);
- $('#memory_prompt_words').on('input', onMemoryPromptWordsInput);
- $('#memory_prompt_interval').on('input', onMemoryPromptIntervalInput);
- $('#memory_prompt').on('input', onMemoryPromptInput);
- $('#memory_force_summarize').on('click', forceSummarizeChat);
- $('#memory_template').on('input', onMemoryTemplateInput);
- $('#memory_depth').on('input', onMemoryDepthInput);
- $('input[name="memory_position"]').on('change', onMemoryPositionChange);
- $('#memory_prompt_words_force').on('input', onMemoryPromptWordsForceInput);
+ setupListeners();
+ $("#summaryExtensionPopoutButton").off('click').on('click', function (e) {
+ doPopout(e);
+ e.stopPropagation();
+ });
}
addExtensionControls();
diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js
index 1c7ce81b6..da4849392 100644
--- a/public/scripts/power-user.js
+++ b/public/scripts/power-user.js
@@ -1410,7 +1410,8 @@ async function resetMovablePanels(type) {
'WorldInfo',
'floatingPrompt',
'expression-holder',
- 'groupMemberListPopout'
+ 'groupMemberListPopout',
+ 'summaryExtensionPopout'
];
const panelStyles = ['top', 'left', 'right', 'bottom', 'height', 'width', 'margin',];
diff --git a/public/style.css b/public/style.css
index daccef727..3abb7de87 100644
--- a/public/style.css
+++ b/public/style.css
@@ -3200,6 +3200,12 @@ a {
height: calc(100% - 30px);
}
+.scrollableInnerFull {
+ height: 100%;
+ overflow-Y: auto;
+ overflow-X: hidden;
+}
+
.fillLeft .scrollableInner {
padding: 0.5em 1em 0.5em 0.5em
}
@@ -3404,7 +3410,8 @@ a {
}
.zoomed_avatar,
-#groupMemberListPopout {
+#groupMemberListPopout,
+#summaryExtensionPopout {
min-width: 100px;
min-height: 100px;
max-height: 90vh;
@@ -3413,15 +3420,25 @@ a {
/* width: calc((100vw - var(--sheldWidth)) /2); */
position: absolute;
padding: 0;
- filter: drop-shadow(2px 2px 2px var(--grey7070a));
+ /* filter: drop-shadow(2px 2px 2px var(--grey7070a)); */
+ box-shadow: 1px 2px 2px var(--black30a);
z-index: 29;
overflow: hidden;
display: none;
bottom: 0;
- aspect-ratio: 2 / 3;
border-radius: 10px;
}
+.zoomed_avatar {
+ aspect-ratio: 2 / 3;
+}
+
+#groupMemberListPopout,
+#summaryExtensionPopout {
+ border: 1px solid var(--SmartThemeBorderColor);
+ padding: 5px;
+}
+
.draggable {
min-width: 100px;
min-height: 100px;
@@ -3621,4 +3638,4 @@ a {
height: 100vh;
z-index: 9999;
}
-}
+}
\ No newline at end of file