Wrap Text 2/2: 列ごとの折り返し、保存、リボン

Open
#1,287 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
43/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
java

Research direction

Read the referenced #1286 and #1283 issues first, then inspect SpreadSheetFieldArray.java, MpoSidecarJson, SpreadSheetRenderer, the ribbon command catalog, and the listed tests. Implement per-column wrapping, sidecar persistence, visible-row height recalculation, ribbon and dialog controls, and the specified tests; follow the issue’s Gradle commands and GUI quality gate. Done means all five tabs toggle wrapping, settings survive MPO round trips, row heights align with Gantt bars, and the required checks pass.

Written by the indexing model from the issue text.

Description

area: msp-compat area: ui enhancement priority: medium status: blocked

概要

#1286 の行ごとの高さを使って、列ごとの「文字列の折り返し」(Wrap Text) を作る。折り返しが on の列では、セルの文字を列幅で折り返して表示し、行の高さをその行で一番高いセルに合わせる。
前提: #1286 と #1283 がマージ済み(#1283 でセルの書式の当て方が変わるため、その後に行う)。親 issue: #1180。行番号は master 442494033 時点。

根拠にする Microsoft の公開文書: support.microsoft.com の「Wrap text in a column」相当の記事。URL は PR に書く。

作業手順

  1. 列の設定:SpreadSheetFieldArray(modules/microproject_core/.../graphic/configuration/SpreadSheetFieldArray.java)の headerWraps(:59、コピー :76、整列 :157、挿入 :175、削除 :186、移動 :195、取得 :445)と全く同じ作りで cellWraps を足す。transient で POD には含めない。既定は false。
  2. 保存:MpoSidecarJson の headerWraps と同じ書き方で cellWraps を書く・読む。値が無い既存ファイルは全列 false。
  3. 描画:折り返しが on の列のセルは、複数行で描く(SpreadSheetRenderer)。行の高さは、その行の折り返し列のうち最も行数が多いセルに合わせ、#1286 の RowHeights に設定する。列幅、フォント、列の折り返し設定が変わったら高さを計算し直す。計算は表示中の行だけにし、10,000 行で列幅を変えても固まらないようにする。
  4. 操作:リボンの「文字列の折り返し」ボタンは、選んでいる列の cellWraps を切り替える(トグル)。列が選ばれていないときは、カーソルのある列を対象にする。列の設定の変更は、既存の列の変更(列幅など)と同じく Undo の対象かどうかを既存の扱いに合わせ、PR に書く。「フィールドの設定」ダイアログにもチェック ボックスを足す。
  5. リボン:対象は Gantt Chart、Task Sheet、Task Usage、Resource Sheet、Resource Usage の書式タブ。
  • リボンの台帳 modules/microproject_ui/src/test/java/com/microproject/ui/ribbon/MspRibbonOrderDiffTest.java の MISSING_CONTROLS から、この issue で実装したエントリだけを削除する。理由の定数がどこからも参照されなくなったら定数も削除する。
  • ボタンの文言は modules/microproject_ui/src/main/resources/com/microproject/menu/menu.properties(英語)と menu_ja.properties(日本語)の両方に足す。
  • コマンドは RibbonCommandCatalog に登録し、RibbonButtonBehaviorTest の表に 1 行足す。
  1. テスト:SpreadSheetFieldArray の挿入・削除・移動で cellWraps が列に付いて動くテスト、MPO 往復テスト、長い名前の行が 2 行分の高さになり Gantt のバーの位置が合うテスト、GUI acceptance に Task Sheet で名前の列を折り返すジャーニーを 1 件(@GuiJourney)。

検証

.\gradlew.bat :microproject_core:test --tests "*SpreadSheetFieldArray*" --console=plain
.\gradlew.bat :microproject_exchange:test --tests "*MpoFileImporterTest*" --console=plain
.\gradlew.bat :microproject_ui:test --tests "*MspRibbonOrderDiffTest*" --tests "*RibbonButtonBehaviorTest*" --tests "*WrapText*" --console=plain
.\gradlew.bat :microproject_ui:guiTest --tests "*WrapText*" --console=plain
python scripts/test_source_inventory.py --check --output build/audit/test-source-inventory.json
git diff --check

画面の確認は docs/gui-quality-gate.md に従い、日本語と英語の両方で行う。

完了条件

  • 5 つの書式タブに「文字列の折り返し」があり、選んだ列の折り返しを切り替える
  • 折り返しの列で長い文字列の行が高くなり、Gantt のバーがその行に合う(テストあり)
  • 列の挿入・削除・移動で折り返しの設定が列に付いて動く(テストあり)
  • MPO で保存して開き直すと設定が残り、設定の無い既存ファイルは全列 false(テストあり)
  • POD の読み書きに変更が無い
  • MISSING_CONTROLS から */WrapText の 5 エントリと WRAP_TEXT 定数が消え、MspRibbonOrderDiffTest が通る
  • 必須チェック build と GUI acceptance が成功する

範囲外

  • 行ごとの高さの仕組み(#1286)
  • MSPDI / MPP への列の折り返しの保存
  • 行の高さの手動変更
Dominant language
Java
Stars
2
Forks
1
Avg merge
4h 52m
Merged PRs (30d)
349

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tetsuji16/microProject

All issues in tetsuji16/microProject

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.