This commit is contained in:
Timothy Jaeryang Baek committed 2026-11-21 18:55:53 +04:00
1 parent f5cabe6eed
commit 679087e7b3
70 files changed
+274 -16

No files matched your search

+9 -6
View File
@@ -184,7 +184,7 @@ def chat_search_message_content_match_sql(dialect_name: str, key: str) -> str:
def chat_list_order(sort_by: str = 'updated_at', sort_dir: str = 'desc', user_id: str | None = None):
if sort_by != 'unread_updated_at':
sort_column = Chat.title if sort_by == 'title' else Chat.updated_at
sort_column = {'title': Chat.title, 'created_at': Chat.created_at}.get(sort_by, Chat.updated_at)
order_clause = sort_column.asc() if sort_dir == 'asc' else sort_column.desc()
return order_clause, Chat.id
@@ -1817,7 +1817,7 @@ class ChatTable:
async def get_chat_title_id_list_by_user_id(
self,
user_id: str,
include_archived: bool = False,
status: str = 'active', # 'active', 'archived' or 'all'
include_folders: bool = False,
include_pinned: bool = False,
sort_by: str = 'updated_at',
@@ -1827,9 +1827,9 @@ class ChatTable:
db: AsyncSession | None = None,
) -> list[ChatTitleIdResponse]:
async with get_async_db_context(db) as session:
stmt = select(Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at).filter_by(
user_id=user_id
)
stmt = select(
Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at, Chat.archived
).filter_by(user_id=user_id)
stmt = stmt.where(Chat.meta['internal'].as_boolean().is_not(True))
if not include_folders:
@@ -1838,7 +1838,9 @@ class ChatTable:
if not include_pinned:
stmt = stmt.filter(or_(Chat.pinned == False, Chat.pinned == None))
if not include_archived:
if status == 'archived':
stmt = stmt.filter_by(archived=True)
elif status != 'all':
stmt = stmt.filter_by(archived=False)
stmt = stmt.order_by(*chat_list_order(sort_by, sort_dir))
@@ -1859,6 +1861,7 @@ class ChatTable:
'updated_at': chat[2],
'created_at': chat[3],
'last_read_at': chat[4],
'archived': bool(chat[5]),
}
)
for chat in all_chats
+5 -1
View File
@@ -344,6 +344,7 @@ async def get_session_user_chat_list(
include_folders: bool | None = False,
sort_by: str = 'updated_at',
sort_dir: str = 'desc',
status: Literal['active', 'archived', 'all'] = 'active',
db: AsyncSession = Depends(get_async_session),
):
try:
@@ -359,6 +360,7 @@ async def get_session_user_chat_list(
sort_dir=sort_dir,
skip=skip,
limit=limit,
status=status,
db=db,
)
else:
@@ -368,12 +370,14 @@ async def get_session_user_chat_list(
include_pinned=include_pinned,
sort_by=sort_by,
sort_dir=sort_dir,
status=status,
db=db,
)
return await add_active_state_to_chat_list(request, chats, db=db)
except Exception as e:
log.exception(e)
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=ERROR_MESSAGES.DEFAULT())
# `status` here is the query parameter, so the code is written out.
raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT())
@router.post('/read')
+15 -2
View File
@@ -203,7 +203,11 @@ export const getChatList = async (
token: string = '',
page: number | null = null,
include_pinned: boolean = false,
include_folders: boolean = false
include_folders: boolean = false,
view: {
sortBy?: 'updated_at' | 'created_at';
status?: 'active' | 'archived' | 'all';
} = {}
) => {
let error = null;
const searchParams = new URLSearchParams();
@@ -212,6 +216,14 @@ export const getChatList = async (
searchParams.append('page', `${page}`);
}
if (view.sortBy) {
searchParams.append('sort_by', view.sortBy);
}
if (view.status) {
searchParams.append('status', view.status);
}
if (include_folders) {
searchParams.append('include_folders', 'true');
}
@@ -249,9 +261,10 @@ export const getChatList = async (
return [];
}
// Date headings follow the date the list is sorted by.
return res.map((chat) => ({
...chat,
time_range: getTimeRange(chat.updated_at)
time_range: getTimeRange(view.sortBy === 'created_at' ? chat.created_at : chat.updated_at)
}));
};
+70 -1
View File
@@ -39,7 +39,9 @@
registerFolderRefreshHandler,
setAllChatsRead,
setChatActive,
setChatReadAt
setChatReadAt,
chatListView,
setChatListView
} from '$lib/stores/chatList';
import {
folderStates,
@@ -120,6 +122,8 @@
import Dropdown from '../common/Dropdown.svelte';
import DropdownMenu from '../common/DropdownMenu.svelte';
import CheckIcon from '../icons/Check.svelte';
import ChevronRight from '../icons/ChevronRight.svelte';
import DropdownSub from '../common/DropdownSub.svelte';
import ArchiveBoxIcon from '../icons/ArchiveBox.svelte';
import GarbageBinIcon from '../icons/GarbageBin.svelte';
import XMarkIcon from '../icons/XMark.svelte';
@@ -267,6 +271,25 @@
let showFolders = false;
let showSharedFolders = false;
let showChatsMenu = false;
$: chatListMenus = [
{
label: $i18n.t('Status'),
key: 'status',
choices: [
{ value: 'active', label: $i18n.t('Active') },
{ value: 'archived', label: $i18n.t('Archived') },
{ value: 'all', label: $i18n.t('All') }
]
},
{
label: $i18n.t('Sort by'),
key: 'sortBy',
choices: [
{ value: 'updated_at', label: $i18n.t('Last activity') },
{ value: 'created_at', label: $i18n.t('Created') }
]
}
] as const;
let folders: Record<string, any> = {};
type SelectedSidebarFolder = { id: string } | null;
@@ -1804,6 +1827,51 @@
<div slot="content">
<DropdownMenu className="min-w-[10.625rem]">
{#each chatListMenus as menu (menu.key)}
{@const current = menu.choices.find(
(choice) => choice.value === $chatListView[menu.key]
)}
<DropdownSub
contentClass="select-none z-50 max-h-80 overflow-y-auto"
maxWidth={320}
sideOffset={6}
>
<button
slot="trigger"
type="button"
class="flex h-[1.6875rem] w-full cursor-pointer select-none items-center gap-2 rounded-xl px-2 text-left text-[0.8125rem] outline-hidden"
>
<span class="min-w-0 flex-1 truncate text-left">{menu.label}</span>
<span class="truncate text-base-500 dark:text-base-400"
>{current?.label}</span
>
<ChevronRight
className="size-3.5 shrink-0 text-base-400 rtl:rotate-180"
/>
</button>
{#each menu.choices as choice (choice.value)}
<button
type="button"
role="menuitemradio"
aria-checked={choice.value === current?.value}
on:click={() => {
showChatsMenu = false;
if (choice.value !== current?.value) {
setChatListView(localStorage.token, {
[menu.key]: choice.value
});
}
}}
>
<span class="flex-1 text-left">{choice.label}</span>
{#if choice.value === current?.value}<CheckIcon
className="size-3! shrink-0"
/>{/if}
</button>
{/each}
</DropdownSub>
{/each}
<hr class="border-base-50/30 dark:border-base-800/30" />
<button
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] select-none cursor-pointer hover:bg-base-100 dark:hover:bg-base-900"
on:click={markAllChatsReadHandler}
@@ -1964,6 +2032,7 @@
createdAt={chat.created_at}
updatedAt={chat.updated_at}
lastReadAt={chat.last_read_at}
archived={chat.archived === true}
active={chat.active ?? false}
pendingApproval={chat.pending_approval ?? false}
{shiftKey}
@@ -97,6 +97,7 @@
export let createdAt: number | null = null;
export let updatedAt: number | null = null;
export let lastReadAt: number | null = null;
export let archived = false;
export let active = false;
export let pendingApproval = false;
@@ -368,16 +369,17 @@
archiving = true;
try {
// The endpoint toggles, so an archived chat (shown under Archived or All) is unarchived.
await archiveChatById(localStorage.token, id);
updateFolderChatLists({ id }, undefined, true);
if ($chatId === id) {
if (!archived && $chatId === id) {
await goto('/');
chatId.set('');
}
await refreshAfterChange(null, true);
toast.success($i18n.t('Chat archived.'));
toast.success(archived ? $i18n.t('Chat unarchived.') : $i18n.t('Chat archived.'));
} catch (error) {
console.error('Error archiving chat:', error);
toast.error($i18n.t('Failed to archive chat.'));
@@ -862,9 +864,12 @@
{:else if !readonly && shiftKey && mouseOver && !chatSelection}
<div class=" flex items-center self-center space-x-1.5">
{#if $visibleControls['chat.archive']}
<Tooltip content={$i18n.t('Archive')} className="flex items-center">
<Tooltip
content={archived ? $i18n.t('Unarchive') : $i18n.t('Archive')}
className="flex items-center"
>
<button
aria-label={$i18n.t('Archive')}
aria-label={archived ? $i18n.t('Unarchive') : $i18n.t('Archive')}
class="flex size-5 items-center justify-center self-center dark:hover:text-base-0 transition disabled:cursor-not-allowed"
disabled={archiving}
on:click={() => {
@@ -897,6 +902,7 @@
<div class="flex self-center z-10 items-end">
<ChatMenu
{readonly}
{archived}
chatId={id}
cloneChatHandler={() => {
cloneChatHandler(id);
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(اتركه فارغًا لاستخدام نقطة النهاية التجارية)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
+2
View File
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(اتركه فارغًا لاستخدام نقطة النهاية التجارية)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(kommersiya son nöqtəsindən istifadə etmək üçün boş buraxın)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(оставете празно, за да използвате търговската крайна точка)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(বাণিজ্যিক এন্ডপয়েন্ট ব্যবহার করতে ফাঁকা রাখুন)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(ཚོང་ལས་མཇུག་མཐུད་སྤྱོད་པར་སྟོང་པར་འཇོག་རོགས།)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(ostavite prazno za korištenje komercijalne krajnje tačke)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(deixa-ho buit per utilitzar un punt d'accés comercial)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(ibiling blangko aron gamiton ang komersiyal nga endpoint)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(ponechte prázdné pro použití komerčního koncového bodu)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(lad stå tom for at bruge kommercielt endpoint)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(leer lassen, um kommerziellen Endpunkt zu verwenden)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(leave blank for to use such commercial endpoint)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(αφήστε κενό για να χρησιμοποιήσετε εμπορικό endpoint)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(dejar vacío para usar el endpoint comercial)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(jäta tühjaks, et kasutada kommertslõpp-punkti)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(utzi hutsik amaiera-puntu komertziala erabiltzeko)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(برای استفاده از نقطه پایانی تجاری خالی بگذارید)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(Jätä tyhjäksi, jos haluat käyttää kaupallista päätettä)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(iwanang blangko para gamitin ang commercial na endpoint)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(lat standa tómt fyri at brúka handilsliga endapunktið)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "laisser vide pour l'utilisation d'un point d'extension commercial",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "laisser vide pour l'utilisation d'un point d'extension commercial",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(deixe en branco para usar o punto final comercial)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(השאר ריק כדי להשתמש בנקודת הקצה המסחרית)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(व्यावसायिक एंडपॉइंट का उपयोग करने के लिए खाली छोड़ें)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(ostavite prazno za korištenje komercijalne krajnje točke)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(hagyd üresen a kereskedelmi végpont használatához)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(kosongkan untuk menggunakan endpoint komersial)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(fág bán le haghaidh críochphointe tráchtála a úsáid)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(lascia vuoto per utilizzare l'endpoint commerciale)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(商用エンドポイントを使用する場合は空欄のままにしてください)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(დატოვეთ ცარიელი ფასიანი ბოლოწერტილის გამოსაყენებლად)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(eǧǧ-it d ilem i useqdec n wagaz n taggara aznuzan)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(상용 엔드포인트를 사용하시려면 비워두세요)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(palikite tuščią, kad būtų naudojamas komercinis galinis taškas)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(atstājiet tukšu, lai izmantotu komerciālo galapunktu)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(biarkan kosong untuk menggunakan titik akhir komersial)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(la stå tomt for å bruke det kommersielle endepunktet)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(laat leeg om een commercieel endpoint te gebruiken)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(ਵਪਾਰਕ ਐਂਡਪੁਆਇੰਟ ਵਰਤਣ ਲਈ ਖਾਲੀ ਛੱਡੋ)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(pozostaw puste, aby użyć komercyjnego punktu końcowego)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(deixe em branco para usar o endpoint comercial)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "deixe em branco para utilizar o endpoint comercial",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(lăsați necompletat pentru a folosi endpoint-ul comercial)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(оставьте пустым поле для использования коммерческой конечной точки)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(nechajte prázdne pre použitie komerčného koncového bodu)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(pustite prazno za uporabo komercialne končne točke)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(оставите празно за коришћење комерцијалне крајње тачке)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(lämna tomt för att använda kommersiell endpoint)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(வணிக முனைப்புள்ளியைப் பயன்படுத்துவதற்கு காலியாக விடவும்)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(เว้นว่างไว้เพื่อใช้ endpoint เชิงพาณิชย์)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(täjirçilik ahyrky nokadyny ulanmak üçin boş goýuň)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "Ticari uç noktayı kullanmak için boş bırakın",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(تجارەتلىك ئۇلانمىنى ئىشلىتىش ئۈچۈن بوش قالدۇرۇڭ)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(залиште порожнім, щоб використовувати комерційну кінцеву точку)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(تجارتی اینڈ پوائنٹ استعمال کرنے کے لیے خالی چھوڑیں)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(тижорий сўнгги нуқтадан фойдаланиш учун бўш қолдиринг)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(tijoriy so'nggi nuqtadan foydalanish uchun bo'sh qoldiring)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(để trống để dùng endpoint thương mại)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(留空以使用商用端点)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
@@ -6,6 +6,7 @@
"(leave blank for to use commercial endpoint)": "(留空以使用商業端點)",
"Add Machine": "",
"Add key myself": "",
"Archived": "",
"Checking that it responds": "",
"Checking the machine": "",
"Configuring": "",
@@ -17,6 +18,7 @@
"Installation failed": "",
"Installing": "",
"Installing Open Terminal": "",
"Last activity": "",
"Leave empty for the latest release.": "",
"Leave empty for the latest release. Upgrade installs this version.": "",
"Logs": "",
+37 -2
View File
@@ -15,6 +15,35 @@ const pinnedChatsStore = writable<ChatListItem[]>([]);
export const chats = readonly(chatsStore);
export const pinnedChats = readonly(pinnedChatsStore);
// How the sidebar's chat list is filtered and sorted; remembered per browser.
export type ChatListView = {
status: 'active' | 'archived' | 'all';
sortBy: 'updated_at' | 'created_at';
};
const chatListViewStore = writable<ChatListView>({
status: 'active',
sortBy: 'updated_at',
...(() => {
try {
return JSON.parse(localStorage.getItem('sidebar-chat-list-view') ?? '{}');
} catch {
return {};
}
})()
});
export const chatListView = readonly(chatListViewStore);
export const setChatListView = async (token: string, patch: Partial<ChatListView>) => {
chatListViewStore.update((view) => ({ ...view, ...patch }));
try {
localStorage.setItem('sidebar-chat-list-view', JSON.stringify(get(chatListViewStore)));
} catch {
// Not remembered, but the list still updates.
}
return refreshChatList(token);
};
let currentPage = 1;
let paginationReady = false;
let requestGeneration = 0;
@@ -40,7 +69,7 @@ export const refreshChatList = async (
loadingNextPage = false;
const [nextChats, nextPinnedChats] = await Promise.all([
getChatList(token, 1) as Promise<ChatListItem[]>,
getChatList(token, 1, false, false, get(chatListViewStore)) as Promise<ChatListItem[]>,
options.refreshPinned && !options.clearPinned
? (getPinnedChatList(token) as Promise<ChatListItem[]>)
: Promise.resolve(undefined as ChatListItem[] | undefined)
@@ -110,7 +139,13 @@ export const loadNextChatListPage = async (token: string = ''): Promise<ChatList
loadingNextPage = true;
try {
const nextChats = (await getChatList(token, nextPage)) as ChatListItem[];
const nextChats = (await getChatList(
token,
nextPage,
false,
false,
get(chatListViewStore)
)) as ChatListItem[];
if (generation !== requestGeneration) {
return { accepted: false, allLoaded };