Skip to content

document: status を TTY 向けにテーブル/リスト表示へ刷新#37

Merged
buty4649 merged 2 commits intomainfrom
worktree-issue-30-statusview
Apr 17, 2026
Merged

document: status を TTY 向けにテーブル/リスト表示へ刷新#37
buty4649 merged 2 commits intomainfrom
worktree-issue-30-statusview

Conversation

@buty4649
Copy link
Copy Markdown
Contributor

Summary

  • xp document status が TTY でも生 JSON を出力して読みづらかった問題を解消
  • 他サブコマンドと同じ --output table|json / --jq 規約に合わせ、TTY では書類メタ情報 (DOCID/TITLE/FORM/ROUTE/STATUS/STEP/WRITER/LASTAPRV) を newList で、承認フローを newTable で整形表示
  • 承認フロー表示の工夫:
    • 現在ステップは *2、その他は 2 と空白パディングで列幅を揃える
    • STEP/TITLE が直前行と同じ場合は両セルを空欄にして承認者行をグルーピング
    • 末尾に 承認完了 行 (STEP = 最終+1) を追加。status.code == 6 のとき LASTAPRV を表示し * を付与
  • サーバが整数フィールドを文字列で返すケース (status.code など) に対応する flexInt 型でデコード
  • --output json もしくは非 TTY 時は従来通りサーバ応答 JSON をそのまま出力

Test plan

  • go test ./...
  • go vet ./... / gofmt -l ./cmd
  • 実環境で xp document status <docid> の見た目を確認済み (承認完了・承認中の両ケース)
  • --history 付き実行の見た目を確認

Closes #30

🤖 Generated with Claude Code

tty環境でも生 JSON が出力されて読みづらかったため、
他サブコマンドと同じ --output / --jq 規約に合わせ、
TTY では書類メタ情報 (DOCID/TITLE/FORM/ROUTE/STATUS/STEP/
WRITER/LASTAPRV) を newList で、承認フローを newTable で
整形表示するよう変更。--output json または非 TTY 時は従来
通りサーバ応答 JSON をそのまま出力する。

承認フロー表示は次の工夫を含む:
- 現在ステップは "*2"、その他は " 2" と空白パディングで
  列幅を揃え、カレント位置を視認しやすくする
- STEP/TITLE が直前行と同じ場合は両セルを空欄にして
  承認者行をグルーピング表示する
- 最終行に "承認完了" 行 (STEP = 最終+1) を追加。status.code
  が 6 のときは LASTAPRV 情報を表示し "*" を付与する
- サーバが整数フィールドを文字列で返すケース (status.code
  など) に対応する flexInt 型でデコードする

Closes #30

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@buty4649 buty4649 self-assigned this Apr 17, 2026
@buty4649 buty4649 enabled auto-merge (squash) April 17, 2026 08:43
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@buty4649 buty4649 merged commit b0cbc83 into main Apr 17, 2026
2 checks passed
@buty4649 buty4649 deleted the worktree-issue-30-statusview branch April 17, 2026 08:47
@pepabo-pr-maker pepabo-pr-maker Bot mentioned this pull request Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

document statusがjson出力になってしまい人間にはみづらい

1 participant