feat(chat): add collapsible prompt index and polish magazine layout
Add a toggle in the chat header to collapse messages into a compact prompt index showing user queries with content-type badges. Clicking a prompt surfaces the corresponding content panel. Also fixes magazine section extraction (### headers, emoji stripping, author regex) and improves tile layout with editorial rhythm. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
2f27cb86c4
commit
aab55ef9ca
@@ -53,6 +53,7 @@ export const useChatStore = defineStore('chat', () => {
|
||||
const panelSide = ref<'left' | 'right'>(savedSide ?? 'left')
|
||||
|
||||
const webSearchEnabled = ref(localStorage.getItem('aiui-web-search') !== 'false')
|
||||
const chatCollapsed = ref(localStorage.getItem('aiui-chat-collapsed') === 'true')
|
||||
|
||||
// Load chats from server on startup — _loaded gate prevents the watcher
|
||||
// from overwriting the file with empty data before the load completes
|
||||
@@ -81,6 +82,10 @@ export const useChatStore = defineStore('chat', () => {
|
||||
localStorage.setItem('aiui-web-search', String(val))
|
||||
})
|
||||
|
||||
watch(chatCollapsed, (val) => {
|
||||
localStorage.setItem('aiui-chat-collapsed', String(val))
|
||||
})
|
||||
|
||||
watch(
|
||||
[conversations, activeConversationId],
|
||||
([conv, active]) => {
|
||||
@@ -151,6 +156,10 @@ export const useChatStore = defineStore('chat', () => {
|
||||
panelSide.value = panelSide.value === 'right' ? 'left' : 'right'
|
||||
}
|
||||
|
||||
function toggleChatCollapse() {
|
||||
chatCollapsed.value = !chatCollapsed.value
|
||||
}
|
||||
|
||||
function setActiveConversation(id: string) {
|
||||
if (conversations.value.has(id)) {
|
||||
activeConversationId.value = id
|
||||
@@ -175,11 +184,13 @@ export const useChatStore = defineStore('chat', () => {
|
||||
loaded,
|
||||
panelSide,
|
||||
webSearchEnabled,
|
||||
chatCollapsed,
|
||||
createConversation,
|
||||
addMessage,
|
||||
appendToLastMessage,
|
||||
setMessageWebResults,
|
||||
switchSide,
|
||||
toggleChatCollapse,
|
||||
setActiveConversation,
|
||||
deleteConversation,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user