-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
epic:project-explorerSidebar, project list, navigationSidebar, project list, navigationepic:rust-migrationRust + Iced migration infrastructureRust + Iced migration infrastructurephase:2Phase 2 — EditingPhase 2 — Editingpriority:highMust-have for MVPMust-have for MVPtype:migrationDirect port of existing Swift functionalityDirect port of existing Swift functionality
Description
Context
Models for project discovery results and sidebar grouping. DiscoveredProject represents a found project with metadata. ProjectGroup groups projects by parent directory for sidebar display.
Ported from: Fig/Sources/Models/DiscoveredProject.swift, Fig/Sources/Models/ProjectGroup.swift
What to implement
File paths
fig-core/src/models/discovered_project.rsfig-core/src/models/project_group.rs
Rust definitions
// discovered_project.rs
use chrono::{DateTime, Utc};
#[derive(Debug, Clone, PartialEq)]
pub struct DiscoveredProject {
pub path: String,
pub display_name: String,
pub exists: bool,
pub has_settings: bool,
pub has_local_settings: bool,
pub has_mcp_config: bool,
pub last_modified: Option<DateTime<Utc>>,
}
impl DiscoveredProject {
pub fn has_any_config(&self) -> bool {
self.has_settings || self.has_local_settings || self.has_mcp_config
}
}
// project_group.rs
use super::project_entry::ProjectEntry;
#[derive(Debug, Clone)]
pub struct ProjectGroup {
pub parent_path: String,
pub display_name: String,
pub projects: Vec<ProjectEntry>,
}
impl ProjectGroup {
/// Creates display name by abbreviating home directory with ~
pub fn abbreviated_path(path: &str) -> String {
if let Some(home) = dirs::home_dir() {
if let Some(home_str) = home.to_str() {
if path.starts_with(home_str) {
return format!("~{}", &path[home_str.len()..]);
}
}
}
path.to_string()
}
}Acceptance criteria
-
has_any_config()returns true when any config file exists -
abbreviated_pathreplaces home directory with ~ - Both types implement Debug and Clone
Test requirements
test_has_any_config_true— at least one config filetest_has_any_config_false— no config filestest_abbreviated_path— home dir replaced with ~test_project_group_construction
Dependencies
Blocks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
epic:project-explorerSidebar, project list, navigationSidebar, project list, navigationepic:rust-migrationRust + Iced migration infrastructureRust + Iced migration infrastructurephase:2Phase 2 — EditingPhase 2 — Editingpriority:highMust-have for MVPMust-have for MVPtype:migrationDirect port of existing Swift functionalityDirect port of existing Swift functionality