Skip to content

Commit

Permalink
- Changed the class name of the settings container from `settings-con…
Browse files Browse the repository at this point in the history
…tainer` 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.
  • Loading branch information
Brian Joseph Petro committed Dec 7, 2024
1 parent 73ee54a commit f97363d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
4 changes: 2 additions & 2 deletions smart-chats/components/threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function build_html(threads_collection, opts = {}) {
${this.get_icon_html('x')}
</button>
</div>
<div class="settings-container"></div>
<div class="sc-settings"></div>
</div>
<div class="sc-thread">
<!-- Thread messages will be inserted here -->
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions smart-model/smart_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)');
}
Expand Down
11 changes: 1 addition & 10 deletions smart-rank-model/smart_rank_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
}

0 comments on commit f97363d

Please sign in to comment.