Skip to content

feat(ui): SPEC-V0-3-0-STATUS-BAR-WIRE-002 MS-1 — StatusBar git label graduation (placeholder → moai-git real query) (AC-SBW-7~12)#111

Merged
GoosLab merged 1 commit into
mainfrom
feature/SPEC-V0-3-0-STATUS-BAR-WIRE-002
May 6, 2026
Merged

feat(ui): SPEC-V0-3-0-STATUS-BAR-WIRE-002 MS-1 — StatusBar git label graduation (placeholder → moai-git real query) (AC-SBW-7~12)#111
GoosLab merged 1 commit into
mainfrom
feature/SPEC-V0-3-0-STATUS-BAR-WIRE-002

Conversation

@GoosLab
Copy link
Copy Markdown
Collaborator

@GoosLab GoosLab commented May 6, 2026

Summary

Spec & Acceptance

  • SPEC: .moai/specs/SPEC-V0-3-0-STATUS-BAR-WIRE-002/spec.md (lightweight, 단일 MS, 6 AC)
  • AC-SBW-7..12 (6/6 PASS) — clean repo / dirty repo / non-git directory / detached HEAD / missing path / cargo gate
  • progress.md 에 spec 편차 1건 (Ok(\"HEAD\") vs Err(DetachedHead)) + 해소 방법 문서화

Test Plan

  • cargo build -p moai-studio-ui --tests
  • cargo test -p moai-studio-ui --lib → 1377 passed / 0 failed
  • cargo clippy -p moai-studio-ui --all-targets -- -D warnings → 0 warnings
  • cargo fmt --all -- --check → clean
  • FROZEN files (moai-git, moai-studio-workspace, status_bar.rs, palette/registry.rs) 무수정 확인

🗿 MoAI email@mo.ai.kr

…graduation (placeholder → moai-git real query) (AC-SBW-7~12)

#109 placeholder body 졸업: derive_status_git_label_from_workspace 의 입력을 workspace ID(&str)에서 실제 path(&Path)로 바꾸고, 본체를 moai_git::GitRepo 호출로 교체. workspace 전환 시 status bar 가 실제 branch 이름과 dirty marker 를 표시한다.

주요 변경:
- crates/moai-studio-ui/src/lib.rs:
  - derive_status_git_label_from_workspace: &str → &Path. GitRepo::open + current_branch + is_dirty 호출. non-git/IO 실패는 None, detached HEAD 는 "detached" 라벨 (REQ-SBW-008..012).
  - refresh_status_git_label: self.active_id 로 self.workspaces 에서 in-memory lookup → project_path 추출 → derive 호출. lookup miss 는 clear_git_branch + cx.notify (REQ-SBW-013).
  - 기존 placeholder unit test 2개 제거, fixture 기반 5개 신설 (clean / dirty / non-git / detached / missing path). 1374 → 1377 tests.
- crates/moai-studio-ui/Cargo.toml: git2 0.20 dev-dependency 추가 (Repository::init / set_head_detached fixture 용도). production 코드는 기존 moai-git wrapper 만 사용.

Spec 편차 (progress.md §"Spec Deviation" 참고):
moai_git::current_branch() 는 detached HEAD 에서 Ok("HEAD") 반환 (Err(DetachedHead) 가 아님). 양쪽 경로 모두 "detached" 라벨로 매핑하여 사용자 가시 동작은 spec REQ-SBW-010 과 일치.

테스트:
- cargo test -p moai-studio-ui --lib → 1377 passed / 0 failed
- cargo clippy -p moai-studio-ui --all-targets -- -D warnings → 0 warnings
- cargo fmt --all -- --check → clean

🗿 MoAI <email@mo.ai.kr>
@GoosLab GoosLab enabled auto-merge (squash) May 6, 2026 02:10
@GoosLab GoosLab merged commit 29d2e31 into main May 6, 2026
15 of 17 checks passed
@GoosLab GoosLab deleted the feature/SPEC-V0-3-0-STATUS-BAR-WIRE-002 branch May 6, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant