-
Notifications
You must be signed in to change notification settings - Fork 1
feat(cli/tui): P4 9 golden 파일 (SPEC-GOOSE-CLI-TUI-003) #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| // Package tui provides i18n snapshot tests for 4 TUI surfaces in en and ko. | ||
| // AC-CLITUI3-009 (ko), AC-CLITUI3-010 (en) | ||
| package tui | ||
|
|
||
| import ( | ||
| "testing" | ||
| "time" | ||
|
|
||
| tea "github.com/charmbracelet/bubbletea" | ||
| "github.com/modu-ai/goose/internal/cli/tui/i18n" | ||
| "github.com/modu-ai/goose/internal/cli/tui/permission" | ||
| "github.com/modu-ai/goose/internal/cli/tui/sessionmenu" | ||
| "github.com/modu-ai/goose/internal/cli/tui/snapshots" | ||
| ) | ||
|
|
||
| // newI18NModel creates a model pre-configured for i18n snapshot tests. | ||
| // noColor=true ensures ASCII-only output for deterministic snapshots. | ||
| func newI18NModel(lang string) *Model { | ||
| m := NewModel(nil, "test", true /* noColor */) | ||
| m.width = 80 | ||
| m.height = 24 | ||
| m.viewport.Width = 80 | ||
| m.viewport.Height = 21 | ||
| m.clock = snapshots.FixedClock(time.Date(2026, 5, 5, 12, 0, 0, 0, time.UTC)) | ||
| m.catalog = i18n.Catalogs[lang] | ||
| return m | ||
| } | ||
|
|
||
| // --- Surface 1: Statusbar idle --- | ||
|
|
||
| // TestSnapshot_I18N_StatusbarIdle_Ko verifies the statusbar idle string in Korean. | ||
| // AC-CLITUI3-009 | ||
| func TestSnapshot_I18N_StatusbarIdle_Ko(t *testing.T) { | ||
| snapshots.SetupAsciiTermenv() | ||
| m := newI18NModel("ko") | ||
| snapshots.RequireSnapshot(t, "statusbar_idle_ko", []byte(m.View())) | ||
| } | ||
|
|
||
| // TestSnapshot_I18N_StatusbarIdle_En verifies the statusbar idle string in English. | ||
| // AC-CLITUI3-010 | ||
| func TestSnapshot_I18N_StatusbarIdle_En(t *testing.T) { | ||
| snapshots.SetupAsciiTermenv() | ||
| m := newI18NModel("en") | ||
| snapshots.RequireSnapshot(t, "statusbar_idle_en", []byte(m.View())) | ||
| } | ||
|
|
||
| // --- Surface 2: /help response --- | ||
|
|
||
| // TestSnapshot_I18N_SlashHelp_Ko verifies the /help output header in Korean. | ||
| // AC-CLITUI3-009 | ||
| func TestSnapshot_I18N_SlashHelp_Ko(t *testing.T) { | ||
| snapshots.SetupAsciiTermenv() | ||
| m := newI18NModel("ko") | ||
|
|
||
| // Execute /help via Update so slash handling uses the Korean catalog. | ||
| m.input.SetValue("/help") | ||
| updated, _ := m.Update(tea.KeyMsg{Type: tea.KeyEnter}) | ||
| m = updated.(*Model) | ||
|
|
||
| snapshots.RequireSnapshot(t, "slash_help_ko", []byte(m.View())) | ||
| } | ||
|
|
||
| // TestSnapshot_I18N_SlashHelp_En verifies the /help output header in English. | ||
| // AC-CLITUI3-010 | ||
| func TestSnapshot_I18N_SlashHelp_En(t *testing.T) { | ||
| snapshots.SetupAsciiTermenv() | ||
| m := newI18NModel("en") | ||
|
|
||
| // Execute /help via Update so slash handling uses the English catalog. | ||
| m.input.SetValue("/help") | ||
| updated, _ := m.Update(tea.KeyMsg{Type: tea.KeyEnter}) | ||
| m = updated.(*Model) | ||
|
|
||
| snapshots.RequireSnapshot(t, "slash_help_en", []byte(m.View())) | ||
| } | ||
|
|
||
| // --- Surface 3: Permission modal --- | ||
|
|
||
| // TestSnapshot_I18N_PermissionModal_Ko verifies the permission modal in Korean. | ||
| // AC-CLITUI3-009 | ||
| func TestSnapshot_I18N_PermissionModal_Ko(t *testing.T) { | ||
| snapshots.SetupAsciiTermenv() | ||
| m := newI18NModel("ko") | ||
| m.permissionState = permission.PermissionModel{ | ||
| Active: true, | ||
| ToolName: "Bash", | ||
| ToolUseID: "t1", | ||
| } | ||
| snapshots.RequireSnapshot(t, "permission_modal_ko", []byte(m.View())) | ||
| } | ||
|
|
||
| // TestSnapshot_I18N_PermissionModal_En verifies the permission modal in English. | ||
| // AC-CLITUI3-010 | ||
| func TestSnapshot_I18N_PermissionModal_En(t *testing.T) { | ||
| snapshots.SetupAsciiTermenv() | ||
| m := newI18NModel("en") | ||
| m.permissionState = permission.PermissionModel{ | ||
| Active: true, | ||
| ToolName: "Bash", | ||
| ToolUseID: "t1", | ||
| } | ||
| snapshots.RequireSnapshot(t, "permission_modal_en", []byte(m.View())) | ||
| } | ||
|
|
||
| // --- Surface 4: Session menu open --- | ||
|
|
||
| // TestSnapshot_I18N_SessionMenuOpen_Ko verifies the sessionmenu overlay header in Korean. | ||
| // AC-CLITUI3-009 | ||
| func TestSnapshot_I18N_SessionMenuOpen_Ko(t *testing.T) { | ||
| snapshots.SetupAsciiTermenv() | ||
| m := newI18NModel("ko") | ||
| m.sessionMenuState = sessionmenu.Open([]sessionmenu.Entry{ | ||
| {Name: "session-c"}, | ||
| {Name: "session-b"}, | ||
| {Name: "session-a"}, | ||
| }) | ||
| snapshots.RequireSnapshot(t, "session_menu_open_ko", []byte(m.View())) | ||
| } | ||
|
|
||
| // TestSnapshot_I18N_SessionMenuOpen_En verifies the sessionmenu overlay header in English. | ||
| // AC-CLITUI3-010 | ||
| func TestSnapshot_I18N_SessionMenuOpen_En(t *testing.T) { | ||
| snapshots.SetupAsciiTermenv() | ||
| m := newI18NModel("en") | ||
| m.sessionMenuState = sessionmenu.Open([]sessionmenu.Entry{ | ||
| {Name: "session-c"}, | ||
| {Name: "session-b"}, | ||
| {Name: "session-a"}, | ||
| }) | ||
| snapshots.RequireSnapshot(t, "session_menu_open_en", []byte(m.View())) | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // Package tui provides snapshot tests for the sessionmenu overlay. | ||
| // AC-CLITUI3-004 | ||
| package tui | ||
|
|
||
| import ( | ||
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/modu-ai/goose/internal/cli/tui/sessionmenu" | ||
| "github.com/modu-ai/goose/internal/cli/tui/snapshots" | ||
| ) | ||
|
|
||
| // TestSnapshot_SessionMenuOpen verifies that the session menu overlay renders | ||
| // correctly with 3 mock entries in mtime desc order. | ||
| // AC-CLITUI3-004 | ||
| func TestSnapshot_SessionMenuOpen(t *testing.T) { | ||
| // Force ASCII profile for deterministic snapshot output. | ||
| snapshots.SetupAsciiTermenv() | ||
|
|
||
| m := NewModel(nil, "test-session", true /* noColor */) | ||
| m.clock = snapshots.FixedClock(time.Date(2026, 5, 5, 12, 0, 0, 0, time.UTC)) | ||
| m.width = 80 | ||
| m.height = 24 | ||
| m.viewport.Width = 80 | ||
| m.viewport.Height = 21 | ||
|
|
||
| // Open sessionmenu with 3 mock entries already in mtime desc order. | ||
| entries := []sessionmenu.Entry{ | ||
| {Name: "session-c"}, | ||
| {Name: "session-b"}, | ||
| {Name: "session-a"}, | ||
| } | ||
| m.sessionMenuState = sessionmenu.Open(entries) | ||
|
|
||
| output := []byte(m.View()) | ||
| snapshots.RequireSnapshot(t, "session_menu_open", output) | ||
| } |
36 changes: 36 additions & 0 deletions
36
internal/cli/tui/testdata/snapshots/permission_modal_en.golden
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| Session: test | Daemon: | Messages: 0 | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| > > Type a message... | ||
| +----------------------------------+ | ||
| | Permission Request: Bash | | ||
| +----------------------------------+ | ||
| | | | ||
| | Allow this tool call? | | ||
| | > Allow once | | ||
| | Allow always (this tool) | | ||
| | Deny once | | ||
| | Deny always (this tool) | | ||
| | | | ||
| | [Up/Down] navigate [Enter] select| | ||
| | [Esc] deny once | | ||
| +----------------------------------+ |
36 changes: 36 additions & 0 deletions
36
internal/cli/tui/testdata/snapshots/permission_modal_ko.golden
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| 세션: test | 데몬: | 메시지: 0 | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| > > Type a message... | ||
| +----------------------------------+ | ||
| | Permission Request: Bash | | ||
| +----------------------------------+ | ||
| | | | ||
| | 이 도구 호출을 허용... | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. KO/EN 권한 모달 질문 문장 부호 불일치 Line 28: KO 골든은 🤖 Prompt for AI Agents |
||
| | > 이번만 허용 | | ||
| | 항상 허용 (이 도구) | | ||
| | 이번만 거부 | | ||
| | 항상 거부 (이 도구) | | ||
| | | | ||
| | [Up/Down] navigate [Enter] select| | ||
| | [Esc] deny once | | ||
| +----------------------------------+ | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KO 권한 모달에 미번역 영어 문자열 존재 (AC-009 i18n 커버리지 불완전)
Line 25의
Permission Request: Bash헤더와 Lines 34~35의[Up/Down] navigate [Enter] select/[Esc] deny once내비게이션 힌트가 KO 골든에서 영어 그대로 노출됩니다. SPEC-GOOSE-CLI-TUI-003 AC-009가 이 표면의 완전한 한국어 번역을 요구한다면, i18n 카탈로그에 해당 키가 누락된 것입니다.의도적으로 일부만 번역한 것이라면 SPEC/AC를 업데이트해서 범위를 명시해 주세요.
Also applies to: 34-35
🤖 Prompt for AI Agents
🧩 Analysis chain
🏁 Script executed:
Repository: modu-ai/goose
Length of output: 300
Permission Request: Bash헤더 라인 너비 불일치 확인됨 — 수정 권장경계선
+----------------------------------+은 내부 너비 34 컬럼(총 36자)을 정의하지만,| Permission Request: Bash |콘텐츠 라인은 35자입니다. 양쪽 끝|를 포함한 실제 측정 결과이므로, 오른쪽에 스페이스 1개를 추가하여 36자로 맞추는 것이 좋습니다. 이 문제는permission_modal_en.goldenLine 25에도 동일하게 존재합니다.🤖 Prompt for AI Agents