feat(backend,frontend): lot utilisateur #310 #311 #312 #313 — horodatage conversation, stop agent robuste, préférence terminal par défaut, paramètres projet (QA verte)
- #310: horodatage de tous les messages et événements de conversation visibles — composant partagé EntryTimestamp, timestamps propagés dans le transcript chat, les annonces inter-agent et le viewer de conversation, normalisation côté domain/adapters (conversation_log, paginate). - #311: stop d'agent robuste pour PTY non monté, sessions headless et CLI custom — lifecycle/orchestrator durcis, ponts chat app-tauri/web-server alignés, arrêt fiable sans session orpheline. - #312: préférence globale d'interface terminal par défaut — nouveau store settings (domain/application/infrastructure + tests), DTO et commandes backend, adapter frontend userSettings, panneau TerminalSettings dans les paramètres globaux. - #313: Paramètres du projet — contexte de projet éditable et couleur de thème par projet (ProjectSettingsPanel + projectTheme), teinte des onglets projet, persistance via DTO projet. QA verte (GO QA sur feature/batch-310-311-312-313-chat-stop-prefs-theme) — vérifications Git: git diff --cached --check OK; staging borné à crates/ et frontend/ (74 fichiers, +2105/-531), commit unique de lot conforme à la convention des lots (précédents batch-151/158/159, batch-210/211/212) car les fichiers partagés (dto.rs, commands.rs, CustomAgentChatView) entrelacent les 4 tickets. fichiers .ideai/* (agents/test.md, chat-drafts.json, system-permissions.json, tickets/counter.json, tickets/index.json, tickets/308-313/), attachments/ et scripts/ hors périmètre et préservés en worktree ; aucun push. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -120,8 +120,9 @@ pub use store::{
|
||||
AdaptiveMemoryRecall, BackgroundTaskReconcileReport, EmbedderEnvProbe, FsBackgroundTaskStore,
|
||||
FsDeviceSessionStore, FsEmbedderProfileStore, FsEmbedderPromptStore, FsLiveStateStore,
|
||||
FsMcpToolPermissionStore, FsMemoryStore, FsOpenProjectRestoreStore, FsPermissionStore,
|
||||
FsProfileStore, FsProjectStore, FsSecretStore, FsSkillStore, FsSystemPermissionStore,
|
||||
FsTemplateStore, FsWindowStateStore, HashEmbedder, IdeaiContextStore, NaiveMemoryRecall,
|
||||
OnnxModelInfo, StubEmbedder, VectorMemoryRecall, DEFAULT_OLLAMA_BASE_URL, ONNX_CACHE_SUBDIR,
|
||||
RECOMMENDED_ONNX_MODELS, VECTOR_HTTP_ENABLED, VECTOR_ONNX_ENABLED,
|
||||
FsProfileStore, FsProjectSettingsStore, FsProjectStore, FsSecretStore, FsSkillStore,
|
||||
FsSystemPermissionStore, FsTemplateStore, FsUserSettingsStore, FsWindowStateStore,
|
||||
HashEmbedder, IdeaiContextStore, NaiveMemoryRecall, OnnxModelInfo, StubEmbedder,
|
||||
VectorMemoryRecall, DEFAULT_OLLAMA_BASE_URL, ONNX_CACHE_SUBDIR, RECOMMENDED_ONNX_MODELS,
|
||||
VECTOR_HTTP_ENABLED, VECTOR_ONNX_ENABLED,
|
||||
};
|
||||
|
||||
@ -17,6 +17,7 @@ mod profile;
|
||||
mod project;
|
||||
mod project_plugin;
|
||||
mod secrets;
|
||||
mod settings;
|
||||
mod skill;
|
||||
mod system_permission;
|
||||
mod template;
|
||||
@ -44,6 +45,7 @@ pub use profile::{FsEmbedderProfileStore, FsProfileStore};
|
||||
pub use project::FsProjectStore;
|
||||
pub use project_plugin::FsProjectPluginSettingsStore;
|
||||
pub use secrets::FsSecretStore;
|
||||
pub use settings::{FsProjectSettingsStore, FsUserSettingsStore};
|
||||
pub use skill::FsSkillStore;
|
||||
pub use system_permission::FsSystemPermissionStore;
|
||||
pub use template::FsTemplateStore;
|
||||
|
||||
104
crates/infrastructure/src/store/settings.rs
Normal file
104
crates/infrastructure/src/store/settings.rs
Normal file
@ -0,0 +1,104 @@
|
||||
//! JSON persistence for global user settings and project-owned settings.
|
||||
|
||||
use async_trait::async_trait;
|
||||
use domain::{
|
||||
FileSystem, FsError, IdeaUserSettings, ProjectPath, ProjectSettings, ProjectSettingsStore,
|
||||
RemotePath, StoreError, UserSettingsStore,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Clone)]
|
||||
/// File-backed global user-settings adapter.
|
||||
pub struct FsUserSettingsStore {
|
||||
fs: Arc<dyn FileSystem>,
|
||||
app_data_dir: String,
|
||||
}
|
||||
impl FsUserSettingsStore {
|
||||
/// Builds an adapter rooted in the machine-local application data directory.
|
||||
#[must_use]
|
||||
pub fn new(fs: Arc<dyn FileSystem>, app_data_dir: impl Into<String>) -> Self {
|
||||
Self {
|
||||
fs,
|
||||
app_data_dir: app_data_dir.into(),
|
||||
}
|
||||
}
|
||||
fn path(&self) -> RemotePath {
|
||||
RemotePath::new(format!(
|
||||
"{}/settings.json",
|
||||
self.app_data_dir.trim_end_matches(['/', '\\'])
|
||||
))
|
||||
}
|
||||
}
|
||||
#[async_trait]
|
||||
impl UserSettingsStore for FsUserSettingsStore {
|
||||
async fn load(&self) -> Result<IdeaUserSettings, StoreError> {
|
||||
match self.fs.read(&self.path()).await {
|
||||
Ok(bytes) => {
|
||||
serde_json::from_slice(&bytes).map_err(|e| StoreError::Serialization(e.to_string()))
|
||||
}
|
||||
Err(FsError::NotFound(_)) => Ok(IdeaUserSettings::default()),
|
||||
Err(error) => Err(StoreError::Io(error.to_string())),
|
||||
}
|
||||
}
|
||||
async fn save(&self, settings: &IdeaUserSettings) -> Result<(), StoreError> {
|
||||
self.fs
|
||||
.create_dir_all(&RemotePath::new(self.app_data_dir.clone()))
|
||||
.await
|
||||
.map_err(|e| StoreError::Io(e.to_string()))?;
|
||||
let mut bytes = serde_json::to_vec_pretty(settings)
|
||||
.map_err(|e| StoreError::Serialization(e.to_string()))?;
|
||||
bytes.push(b'\n');
|
||||
self.fs
|
||||
.write(&self.path(), &bytes)
|
||||
.await
|
||||
.map_err(|e| StoreError::Io(e.to_string()))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
/// File-backed project-settings adapter.
|
||||
pub struct FsProjectSettingsStore {
|
||||
fs: Arc<dyn FileSystem>,
|
||||
}
|
||||
impl FsProjectSettingsStore {
|
||||
/// Builds an adapter over the location-neutral filesystem port.
|
||||
#[must_use]
|
||||
pub fn new(fs: Arc<dyn FileSystem>) -> Self {
|
||||
Self { fs }
|
||||
}
|
||||
fn path(root: &ProjectPath) -> RemotePath {
|
||||
RemotePath::new(format!(
|
||||
"{}/.ideai/project-settings.json",
|
||||
root.as_str().trim_end_matches(['/', '\\'])
|
||||
))
|
||||
}
|
||||
}
|
||||
#[async_trait]
|
||||
impl ProjectSettingsStore for FsProjectSettingsStore {
|
||||
async fn load(&self, root: &ProjectPath) -> Result<ProjectSettings, StoreError> {
|
||||
match self.fs.read(&Self::path(root)).await {
|
||||
Ok(bytes) => {
|
||||
serde_json::from_slice(&bytes).map_err(|e| StoreError::Serialization(e.to_string()))
|
||||
}
|
||||
Err(FsError::NotFound(_)) => Ok(ProjectSettings::default()),
|
||||
Err(error) => Err(StoreError::Io(error.to_string())),
|
||||
}
|
||||
}
|
||||
async fn save(&self, root: &ProjectPath, settings: &ProjectSettings) -> Result<(), StoreError> {
|
||||
let dir = RemotePath::new(format!(
|
||||
"{}/.ideai",
|
||||
root.as_str().trim_end_matches(['/', '\\'])
|
||||
));
|
||||
self.fs
|
||||
.create_dir_all(&dir)
|
||||
.await
|
||||
.map_err(|e| StoreError::Io(e.to_string()))?;
|
||||
let mut bytes = serde_json::to_vec_pretty(settings)
|
||||
.map_err(|e| StoreError::Serialization(e.to_string()))?;
|
||||
bytes.push(b'\n');
|
||||
self.fs
|
||||
.write(&Self::path(root), &bytes)
|
||||
.await
|
||||
.map_err(|e| StoreError::Io(e.to_string()))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user