Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 32 additions & 37 deletions app/src/main/java/com/yugahashimoto/andcode/ui/AppDrawerContent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,6 @@ fun AppDrawerContent(
.padding(top = 6.dp),
) {
DrawerHeader()
NewChatRow(onClick = onNewChat)

// Only worth a switcher when there is something to switch between.
if (agents.size > 1) {
DrawerAgentChips(
agents = agents,
selectedRuntimeId = selectedRuntimeId,
onSelectAgent = onSelectAgent,
)
}

DrawerProjectsSection(
workspaces = workspaces,
Expand All @@ -156,6 +146,17 @@ fun AppDrawerContent(
onProjectQueryChange = { projectQuery = it },
)

// Only worth a switcher when there is something to switch between.
if (agents.size > 1) {
DrawerAgentChips(
agents = agents,
selectedRuntimeId = selectedRuntimeId,
onSelectAgent = onSelectAgent,
)
}

NewChatRow(onClick = onNewChat)

if (recentSessions.isNotEmpty()) {
DrawerSearchField(
query = searchQuery,
Expand Down Expand Up @@ -347,34 +348,28 @@ private fun DrawerChatList(
if (unpinned.isEmpty()) return

val defaultLabel = stringResource(R.string.drawer_project_default)
DrawerSectionHeader(
text = stringResource(R.string.drawer_recent_chats),
collapsed = collapsedSections.contains("recent"),
onToggle = { onToggleSection("recent") },
)
AnimatedVisibility(visible = !collapsedSections.contains("recent")) {
Column {
// Grouped by project, always. The project/status switch that used to sit here made
// the drawer ask a question before it answered one, and the status a chat is in
// already shows on its own row.
groupedByProject(unpinned).forEach { (key, sessions) ->
val sectionKey = "project_$key"
DrawerRecentProjectHeader(
label = sessions.first().projectLabel(defaultLabel),
collapsed = collapsedSections.contains(sectionKey),
onToggle = { onToggleSection(sectionKey) },
Column {
// Grouped by project, always. The project/status switch that used to sit here made
// the drawer ask a question before it answered one, and the status a chat is in
// already shows on its own row. There is no "Recent chats" heading above the list:
// it is the drawer's main content, so the heading only cost height.
groupedByProject(unpinned).forEach { (key, sessions) ->
val sectionKey = "project_$key"
DrawerRecentProjectHeader(
label = sessions.first().projectLabel(defaultLabel),
collapsed = collapsedSections.contains(sectionKey),
onToggle = { onToggleSection(sectionKey) },
)
AnimatedVisibility(visible = !collapsedSections.contains(sectionKey)) {
DrawerChatRows(
sessions = sessions,
selectedSessionIds = selectedSessionIds,
selectionMode = selectionMode,
indented = true,
onOpenSession = onOpenSession,
menuActions = menuActions,
onToggleSelection = onToggleSelection,
)
AnimatedVisibility(visible = !collapsedSections.contains(sectionKey)) {
DrawerChatRows(
sessions = sessions,
selectedSessionIds = selectedSessionIds,
selectionMode = selectionMode,
indented = true,
onOpenSession = onOpenSession,
menuActions = menuActions,
onToggleSelection = onToggleSelection,
)
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@

<string name="menu_description">القائمة</string>
<string name="drawer_search_description">بحث</string>
<string name="drawer_recent_chats">الدردشات الأخيرة</string>
<string name="drawer_project_default">افتراضي</string>
<string name="drawer_projects_title">المشاريع</string>
<string name="drawer_agents_title">الوكلاء</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@

<string name="menu_description">Menú</string>
<string name="drawer_search_description">Buscar</string>
<string name="drawer_recent_chats">Chats recientes</string>
<string name="drawer_project_default">Predeterminado</string>
<string name="drawer_projects_title">Proyectos</string>
<string name="drawer_agents_title">Agentes</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@

<string name="menu_description">Menu</string>
<string name="drawer_search_description">Rechercher</string>
<string name="drawer_recent_chats">Discussions récentes</string>
<string name="drawer_project_default">Par défaut</string>
<string name="drawer_projects_title">Projets</string>
<string name="drawer_agents_title">Agents</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@
<!-- Redesign: drawer -->
<string name="menu_description">メニュー</string>
<string name="drawer_search_description">検索</string>
<string name="drawer_recent_chats">最近のチャット</string>
<string name="drawer_project_default">デフォルト</string>
<string name="drawer_projects_title">プロジェクト</string>
<string name="drawer_agents_title">エージェント</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@

<string name="menu_description">Menu</string>
<string name="drawer_search_description">Pesquisar</string>
<string name="drawer_recent_chats">Chats recentes</string>
<string name="drawer_project_default">Padrão</string>
<string name="drawer_projects_title">Projetos</string>
<string name="drawer_agents_title">Agentes</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@

<string name="menu_description">Меню</string>
<string name="drawer_search_description">Поиск</string>
<string name="drawer_recent_chats">Недавние чаты</string>
<string name="drawer_project_default">По умолчанию</string>
<string name="drawer_projects_title">Проекты</string>
<string name="drawer_agents_title">Агенты</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@

<string name="menu_description">菜单</string>
<string name="drawer_search_description">搜索</string>
<string name="drawer_recent_chats">最近的聊天</string>
<string name="drawer_project_default">默认</string>
<string name="drawer_projects_title">项目</string>
<string name="drawer_agents_title">智能体</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@
<!-- Redesign: drawer -->
<string name="menu_description">Menu</string>
<string name="drawer_search_description">Search</string>
<string name="drawer_recent_chats">Recent chats</string>
<string name="drawer_project_default">Default</string>
<string name="drawer_projects_title">Projects</string>
<string name="drawer_agents_title">Agents</string>
Expand Down
Loading