From f97363dff5754b5dc33206c007ec30bf3992863a Mon Sep 17 00:00:00 2001 From: Brian Joseph Petro Date: Sat, 7 Dec 2024 16:29:14 -0500 Subject: [PATCH] - Changed the class name of the settings container from `settings-container` to `sc-settings` in `threads.js` for improved clarity. - Updated the `post_process` function to reflect the new settings container class name. - Added a console log in the `re_render_settings` method of `SmartModel` to aid in debugging and provide better visibility into the settings rendering process. - Removed the deprecated `reload_model` method from `SmartRankModel`, cleaning up the codebase. --- smart-chats/components/threads.js | 4 ++-- smart-model/smart_model.js | 1 + smart-rank-model/smart_rank_model.js | 11 +---------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/smart-chats/components/threads.js b/smart-chats/components/threads.js index a3f88eb7..309c77a6 100644 --- a/smart-chats/components/threads.js +++ b/smart-chats/components/threads.js @@ -34,7 +34,7 @@ export function build_html(threads_collection, opts = {}) { ${this.get_icon_html('x')} -
+
@@ -71,7 +71,7 @@ export async function post_process(threads_collection, frag, opts) { const chat_box = frag.querySelector('.sc-thread'); const settings_button = frag.querySelector('button[title="Chat Settings"]'); const overlay_container = frag.querySelector(".smart-chat-overlay"); - const settings_container = overlay_container.querySelector(".settings-container"); + const settings_container = overlay_container.querySelector(".sc-settings"); // Initialize thread if needed let thread; diff --git a/smart-model/smart_model.js b/smart-model/smart_model.js index fbbd821f..6ed78358 100644 --- a/smart-model/smart_model.js +++ b/smart-model/smart_model.js @@ -347,6 +347,7 @@ export class SmartModel { } re_render_settings() { + console.log('re_render_settings', this.opts); if(typeof this.opts.re_render_settings === 'function') this.opts.re_render_settings(); else console.warn('re_render_settings is not a function (must be passed in model opts)'); } diff --git a/smart-rank-model/smart_rank_model.js b/smart-rank-model/smart_rank_model.js index c726617e..3c4baadf 100644 --- a/smart-rank-model/smart_rank_model.js +++ b/smart-rank-model/smart_rank_model.js @@ -135,13 +135,4 @@ export class SmartRankModel extends SmartModel { return this.process_settings_config(_settings_config); } - - /** - * Reload ranking model. - */ - reload_model() { - if (this.adapter && typeof this.adapter.load === 'function') { - this.adapter.load(); - } - } -} +} \ No newline at end of file