fix: block title-leaking actions on locked conversations
Locked chats could leak their real title through sidebar search, "Generate Title", and "Duplicate" — all three now blocked.
This commit is contained in:
parent
7aefd7ba70
commit
d69e2bcf68
1 changed files with 8 additions and 3 deletions
|
|
@ -218,7 +218,10 @@ fun KaizenSidebar(
|
||||||
// ── Conversation list ──
|
// ── Conversation list ──
|
||||||
val filteredConversations = remember(conversations, searchQuery) {
|
val filteredConversations = remember(conversations, searchQuery) {
|
||||||
if (searchQuery.isBlank()) conversations
|
if (searchQuery.isBlank()) conversations
|
||||||
else conversations.filter { it.title.contains(searchQuery, ignoreCase = true) }
|
else conversations.filter {
|
||||||
|
if (it.locked) false
|
||||||
|
else it.title.contains(searchQuery, ignoreCase = true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Box(Modifier.weight(1f).fillMaxWidth()) {
|
Box(Modifier.weight(1f).fillMaxWidth()) {
|
||||||
|
|
@ -512,11 +515,13 @@ private fun HistoryItemRow(
|
||||||
if (!item.locked) {
|
if (!item.locked) {
|
||||||
MenuRow(KaizenIcons.Pencil, stringResource(R.string.sidebar_rename), cs.onBackground) { showMenu = false; onRename() }
|
MenuRow(KaizenIcons.Pencil, stringResource(R.string.sidebar_rename), cs.onBackground) { showMenu = false; onRename() }
|
||||||
}
|
}
|
||||||
if (!item.titleGenerated) {
|
if (!item.titleGenerated && !item.locked) {
|
||||||
MenuRow(KaizenIcons.Sparkles, stringResource(R.string.sidebar_generate_title), cs.onBackground) { showMenu = false; onGenerateTitle() }
|
MenuRow(KaizenIcons.Sparkles, stringResource(R.string.sidebar_generate_title), cs.onBackground) { showMenu = false; onGenerateTitle() }
|
||||||
}
|
}
|
||||||
MenuRow(KaizenIcons.Pin, stringResource(if (item.pinned) R.string.sidebar_unpin else R.string.sidebar_pin), cs.onBackground) { showMenu = false; onTogglePin() }
|
MenuRow(KaizenIcons.Pin, stringResource(if (item.pinned) R.string.sidebar_unpin else R.string.sidebar_pin), cs.onBackground) { showMenu = false; onTogglePin() }
|
||||||
|
if (!item.locked) {
|
||||||
MenuRow(KaizenIcons.Copy, stringResource(R.string.sidebar_duplicate), cs.onBackground) { showMenu = false; onDuplicate() }
|
MenuRow(KaizenIcons.Copy, stringResource(R.string.sidebar_duplicate), cs.onBackground) { showMenu = false; onDuplicate() }
|
||||||
|
}
|
||||||
MenuRow(
|
MenuRow(
|
||||||
if (item.locked) KaizenIcons.LockOpen else KaizenIcons.Lock,
|
if (item.locked) KaizenIcons.LockOpen else KaizenIcons.Lock,
|
||||||
stringResource(if (item.locked) R.string.sidebar_unlock else R.string.sidebar_lock),
|
stringResource(if (item.locked) R.string.sidebar_unlock else R.string.sidebar_lock),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue