Skip to content

キャンバス/コードの切り替えが「Canv…」と切れないようにする - #135

Merged
temoki merged 1 commit into
mainfrom
fix/canvas-toggle-width
Sep 26, 2026
Merged

temoki merged 1 commit into
mainfrom
fix/canvas-toggle-width

Conversation

@temoki

@temoki temoki commented Sep 26, 2026

Copy link
Copy Markdown
Owner

キャンバス側のツールバーにある「キャンバス / コード」の切り替えが、iPad で文字が切れていたのを直します。文字が入るときは文字、入らないときはアイコンで出します。

何が起きていたか

11 インチの iPad シミュレータで確かめました。#119 で直したあとも、まだ切れていました。

横向き 縦向き
英語 書類を開いた直後は切れない。描画のあとは「Canv…」(ティーザーに映っていました) 「Ca… Co…」
日本語 切れない 「キ… コ…」

原因は、ツールバーの右側に置けるボタンの幅に上限があることです。その中で、縮められる切り替えが押し縮められていました。

試したこと

  • 切り替えを自分の幅に固定する(.fixedSize()):文字は切れなくなりますが、縦向きでは ⟳ と書き出しが「•••」の中に隠れました。日本語では切り替えまで隠れ、今より悪くなります。
  • ツールバーの余白(ToolbarSpacer)を外す:伸び縮みする方・固定の方のどちらを外しても、変わりませんでした。
  • 文字が入らなければアイコンにする(ViewThatFits):切れず、ボタンも隠れません → これを採用しました(メンテナが比較画像を見て選択)。

変更後

  • アイコンは、キャンバスが「なぐり書き」(scribble.variable)、コードが「</>」です。VoiceOver では、これまでどおり「Canvas」「Code」と読まれます。
  • 文字版もアイコン版も自分の幅に固定しているので、「…」に縮められることはありません。
表示
iPad 13 インチ・横向き 文字(英語・日本語)
iPad 11 インチ・横向き 英語は文字、日本語はアイコン
iPad 縦向き(11・13 インチとも) アイコン
Mac 文字(日本語で確認)
iPhone のキャンバスのシート 文字(英語で確認)

11 インチでは、描画のあとも同じ表示のまま(切れない)ことを確かめました。

そのほか

確認したこと

  • iPad 11 インチ・13 インチのシミュレータで、横・縦 × 英語・日本語のツールバーを撮影し、修正前と見比べた
  • Mac(書類を開いてウィンドウを撮影)、iPhone(プレビュー動画のキャンバスのシート)
  • iOS・macOS・visionOS のビルド、swift format lint --strict

リリース前に

  • iPad 13 インチの横向きでは、切り替えが少し細くなりました(文字に合わせた幅になったため)。App Store のスクリーンショットとプレビューを撮り直しておくと、新しい画面と一致します

On the 11-inch iPad the canvas/code toggle still truncated after #119:
- portrait: "Ca… Co…" and 「キ… コ…」 in the canvas column;
- landscape: "Canv…" once a drawing had run.

The toolbar caps how wide its trailing items may be. A segmented control
allowed to shrink truncates. Pinning it at its own width instead pushed ⟳
and export into a "•••" overflow, and in Japanese took the toggle with them.
Removing either toolbar spacer made no difference.

The toggle now offers the words, then icons (a scribble and </>), through
ViewThatFits. Each form is fixedSize, so neither can be squeezed into an
ellipsis. Measured on the simulators and this Mac:
- words on the 13-inch landscape in both languages, on the Mac and in the
  phone's sheet, and in English on the 11-inch landscape;
- icons in portrait on both iPads, and for Japanese on the 11-inch
  landscape.
VoiceOver still reads "Canvas" and "Code".

Also corrects a claim the film tools made: the transport's step button is
"Step Forward", not "Forward". The second "Forward" the first teaser run met
was never identified, and the comments and the README now say so.
@temoki
temoki merged commit 6af9cdd into main Sep 26, 2026
7 checks passed
@temoki
temoki deleted the fix/canvas-toggle-width branch September 26, 2026 23:39
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.

1 participant