Repository navigation
feat(session): Add support for labeling and organizing chat sessions - #794
Merged
Merged
Conversation
- Implement label domain model and database persistence for conversations. - Enables users to apply, view, and manage custom labels on individual sessions. - Updates the session list view to support grouping and filtering by labels. - Integrates label badges across the chat and discover conversation views. - Adds label management dialogs and necessary UI components.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved label-state synchronization and write-ordering bugs can overwrite assignments and leave badges, menus, and usage counts stale.
7 open issues
Give color swatches accessible names and selected-state semantics · New Invalidate cached label usage counts after assignment changes · New Reconcile cached assignments and label definitions after bulk reloads · New Refresh label usage counts after assignment toggles · New Serialize assignment writes to prevent stale snapshots overwriting newer ones · New Notify open chat views when labels change · New Render the manage-labels dialog when the sidebar is collapsed · New
What changed in this PR
Adds reusable, colored labels to Askimo’s chat sessions, complementing project organization with label assignment, grouping, filtering, and badges.
Changes:
- Adds the label domain model, database migration, repository, service methods, and persistence tests.
- Integrates label management, assignment menus, badges, and sidebar grouping/filtering, with localized text and tests.
- Also updates Swing color-picker handling, OpenAI test model selections, and CLI native-image metadata.
| File | Description |
|---|---|
shared/src/commonMain/kotlin/io/askimo/core/chat/domain/Label.kt |
Defines labels and their name-length limit. |
shared-jvm/src/test/kotlin/io/askimo/core/chat/repository/LabelRepositoryIT.kt |
Tests label persistence, assignments, and sync helpers. |
shared-jvm/src/main/sqldelight/migrations/67.sqm |
Creates label and session-assignment tables. |
shared-jvm/src/main/sqldelight/io/askimo/core/db/sqldelight/Labels.sq |
Defines label queries and schema. |
shared-jvm/src/main/kotlin/io/askimo/core/db/DatabaseManager.kt |
Registers label adapters and repository access. |
shared-jvm/src/main/kotlin/io/askimo/core/chat/service/ChatSessionService.kt |
Exposes label management and assignment operations. |
shared-jvm/src/main/kotlin/io/askimo/core/chat/repository/LabelRepository.kt |
Implements label storage and assignment persistence. |
desktop/src/main/kotlin/io/askimo/desktop/Main.kt |
Passes label state to Discover. |
desktop-shared/src/test/kotlin/io/askimo/ui/session/SessionGroupOptionTest.kt |
Tests label-based session grouping. |
desktop-shared/src/test/kotlin/io/askimo/ui/session/SessionFilterTest.kt |
Tests any-match label filtering. |
desktop-shared/src/main/resources/i18n/messages.properties |
Adds English label UI strings. |
desktop-shared/src/main/resources/i18n/messages_zh_TW.properties |
Adds Traditional Chinese label strings. |
desktop-shared/src/main/resources/i18n/messages_zh_CN.properties |
Adds Simplified Chinese label strings. |
desktop-shared/src/main/resources/i18n/messages_vi_VN.properties |
Adds Vietnamese label strings. |
desktop-shared/src/main/resources/i18n/messages_pt_BR.properties |
Adds Brazilian Portuguese label strings. |
desktop-shared/src/main/resources/i18n/messages_ko_KR.properties |
Adds Korean label strings. |
desktop-shared/src/main/resources/i18n/messages_ja_JP.properties |
Adds Japanese label strings. |
desktop-shared/src/main/resources/i18n/messages_fr.properties |
Adds French label strings. |
desktop-shared/src/main/resources/i18n/messages_es.properties |
Adds Spanish label strings. |
desktop-shared/src/main/resources/i18n/messages_de.properties |
Adds German label strings. |
desktop-shared/src/main/kotlin/io/askimo/ui/shell/NavigationSidebar.kt |
Integrates label menus, badges, grouping, and filtering. |
desktop-shared/src/main/kotlin/io/askimo/ui/settings/AppearanceSettingsSection.kt |
Makes color selection suspend while using Swing’s event thread. |
desktop-shared/src/main/kotlin/io/askimo/ui/session/SessionsViewModel.kt |
Manages label state, filtering, and mutations. |
desktop-shared/src/main/kotlin/io/askimo/ui/session/SessionsView.kt |
Adds label badges and actions to session rows. |
desktop-shared/src/main/kotlin/io/askimo/ui/session/SessionGroupOption.kt |
Adds label groups and an unlabeled bucket. |
desktop-shared/src/main/kotlin/io/askimo/ui/session/SessionFilter.kt |
Implements filtering by selected labels. |
desktop-shared/src/main/kotlin/io/askimo/ui/session/SessionActionsMenu.kt |
Adds chat-level label assignment and management. |
desktop-shared/src/main/kotlin/io/askimo/ui/session/SessionActionMenu.kt |
Adds labels to the shared sidebar action menu. |
desktop-shared/src/main/kotlin/io/askimo/ui/session/ManageLabelsDialog.kt |
Adds label creation, editing, color selection, and deletion. |
desktop-shared/src/main/kotlin/io/askimo/ui/session/LabelsMenu.kt |
Provides a reusable label-assignment submenu. |
desktop-shared/src/main/kotlin/io/askimo/ui/session/LabelColor.kt |
Provides label badges, color parsing, and presets. |
desktop-shared/src/main/kotlin/io/askimo/ui/discover/DiscoverView.kt |
Displays labels on recent conversations. |
desktop-shared/src/main/kotlin/io/askimo/ui/chat/ChatView.kt |
Displays and refreshes chat-header label badges. |
cli/src/test/kotlin/io/askimo/core/providers/openai/OpenAiModelFactoryTest.kt |
Changes the OpenAI test model selection. |
cli/src/test/kotlin/io/askimo/core/providers/openai/OpenAiModelFactoryProxyTest.kt |
Changes the proxy test model selection. |
cli/src/main/resources/META-INF/native-image/io.askimo/cli/reachability-metadata.json |
Updates reflection and service-resource registrations. |
Review effort: Balanced
| it | ||
| } | ||
| } | ||
| .clickable { onSelectColor(hex) } |
| allLabels = labelRepository.list() | ||
| assignedLabels = labelRepository.labelsForSession(sessionId) | ||
| } | ||
| val labelUsageCounts = remember(allLabels) { |
| Triple(labels, bySession, usageCounts) | ||
| } | ||
| allLabels = labels | ||
| labelsBySessionId = labelsBySessionId + bySession |
|
|
||
| scope.launch { | ||
| try { | ||
| withContext(Dispatchers.IO) { sessionService.setSessionLabels(sessionId, newIds) } |
Comment on lines
+335
to
+337
| scope.launch { | ||
| try { | ||
| withContext(Dispatchers.IO) { sessionService.setSessionLabels(sessionId, newIds) } |
|
|
||
| scope.launch { | ||
| try { | ||
| withContext(Dispatchers.IO) { sessionService.setSessionLabels(sessionId, newIds) } |
Comment on lines
+552
to
+553
| if (sessionsViewModel.showManageLabelsDialog) { | ||
| manageLabelsDialog( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Related Issue(s)
Type of Change
What Changed & Why
How to Test
./gradlew testScreenshots / Recordings (if applicable)
Checklist
main./gradlew spotlessApplyand./gradlew detektlocally./gradlew testand all tests passgit commit -sAdditional Notes