fix: open conversion preview directly from Troubleshooter convert button

The convert button in the Data Bank file browser previously just set a
hidden form value and showed a toast telling the user to "open the
Convert section," which was confusing. Now it directly opens the
conversion preview dialog.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
bal-spec 2026-03-09 23:04:23 -07:00
parent 52e8dc6a75
commit 6d3bab686e
2 changed files with 6 additions and 3 deletions

View file

@ -2,6 +2,10 @@
## 2.1.7
### Improvements
- **Convert button opens preview directly**: The convert button (rotate arrows) in the Troubleshooter's Data Bank file browser now opens the conversion preview dialog immediately, instead of showing a confusing toast asking the user to find the Convert section manually.
### Bug Fixes
- **Fix "Protect Recent Messages" not actually protecting**: The protection buffer calculated a reduced end boundary (`effectiveEnd`) but never passed it to `collectRecentMessages()`, which independently used `chat.length` — extracting the "protected" messages anyway. Now the collection boundary respects the protection, so the most recent N messages are genuinely excluded from auto-extraction. Fixes [#3](https://github.com/bal-spec/sillytavern-character-memory/issues/3) regression.

View file

@ -5944,14 +5944,13 @@ async function showTroubleshooter(initialSection = 'health') {
}
});
// Data Bank: Convert file
// Data Bank: Convert file — set the source and open conversion preview directly
$modal.on('click', '.charMemory_tsConvertBtn', function () {
const $row = $(this).closest('.charMemory_tsFileRow');
const url = $row.data('url');
// Select 'databank' source in the Convert tool and set the file
$('input[name="charMemory_formatSource"][value="databank"]').prop('checked', true);
$('#charMemory_convertSource').val(url);
toastr.info('File selected in Convert tool. Open the Convert section to proceed.', 'CharMemory', { timeOut: 4000 });
previewConversion();
});
// Data Bank: Import file