feat(sessions): show project and last activity on history cards (#1133)

This commit is contained in:
Alfredo Ortegón Sepúlveda authored and GitHub committed 2026-09-16 00:14:09 +03:00
1 parent 529b424eb4
commit aed8ba4a6d
25 files changed
+1617 -80

No files matched your search

@@ -0,0 +1,39 @@
package com.m57.hermescontrol.data.model
import kotlinx.serialization.Serializable
/** Result of the `projects.list` JSON-RPC: the profile's named workspaces. */
@Serializable
data class ProjectsListResponse(
val projects: List<ProjectInfo> = emptyList(),
val activeId: String? = null,
)
/**
* A user-created project from the backend's per-profile `projects.db`. A
* session belongs to the project whose folder contains its cwd or repo root.
*/
@Serializable
data class ProjectInfo(
val id: String,
val name: String = "",
val slug: String? = null,
// CSS color string chosen in the desktop app, e.g. "hsl(210 68% 58%)".
val color: String? = null,
val icon: String? = null,
val primaryPath: String? = null,
// Older backends store SQLite 0/1 here.
@Serializable(with = LenientNullableBooleanSerializer::class)
val archived: Boolean? = null,
val folders: List<ProjectFolder> = emptyList(),
) {
val isArchived: Boolean get() = archived == true
}
@Serializable
data class ProjectFolder(
val path: String,
val label: String? = null,
@Serializable(with = LenientNullableBooleanSerializer::class)
val isPrimary: Boolean? = null,
)
@@ -79,6 +79,10 @@ data class SessionInfo(
val display_name: String? = null,
val model: String? = null,
val terminal_backend: String? = null,
// Workspace the session ran in. The project label resolves from these
// (explicit project folder, else the repo root, else the cwd leaf).
val cwd: String? = null,
val git_repo_root: String? = null,
// Epoch seconds of the latest message (backend-computed, present on all
// list rows). Recency source of truth; started_at is the fallback.
val last_active: Double? = null,