Skip to content

fix: mobile editor page title display#10712

Merged
mergify[bot] merged 11 commits intomasterfrom
fix/176753-fix-mobile-editor-page-title-display
Mar 9, 2026
Merged

fix: mobile editor page title display#10712
mergify[bot] merged 11 commits intomasterfrom
fix/176753-fix-mobile-editor-page-title-display

Conversation

@satof3
Copy link
Contributor

@satof3 satof3 commented Jan 13, 2026

Task

https://redmine.weseek.co.jp/issues/176753

Summary

  • SPサイズ以下では画面幅いっぱいにタイトルが表示されるように調整
image

@satof3 satof3 requested a review from yuki-takei January 13, 2026 07:43
@satof3 satof3 self-assigned this Jan 13, 2026
@satof3 satof3 changed the title Fix mobile editor page title display fix: mobile editor page title display Jan 14, 2026
window.addEventListener('resize', calcMaxWidth);
return () => {
window.removeEventListener('resize', calcMaxWidth);
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この addEventListener はパフォーマンス悪化の原因になるので消してください

useDeviceLargerThanSm を使えば re-rendering されるはず

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useDeviceLagerThanSm を作り適用させました

calcMaxWidth();
}, [calcMaxWidth]);
// Update the style directly if needed, or use state management
// setMaxWidth(maxWidth);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これでは calcMaxWidth が役割を失っている

元の useEffect による calcMaxWidth 実行方式から変えた理由はなに?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useEffect に戻しました。
calcMaxWidth は PageHeader の x 座標はリネーム・移動後も変化しないため、 onRenameTerminated / onMoveTerminatedに渡す必要がなく、外部から呼ぶ機会がなくなったため削除し、 useEffect 内に直接計算を書く形に整理しました。

maxWidth={maxWidth}
onRenameTerminated={calcMaxWidth}
/>
<PagePathHeader currentPage={currentPage} maxWidth={maxWidth} />
Copy link
Contributor

@yuki-takei yuki-takei Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

デグレの可能性を排除できないので、onRenameTerminated と onMoveTerminated による再計算は残してほしい

なぜか?

rename, move によって PageControls.x 位置が変わらないという保証がない
別コンポーネントの挙動だから、PageHeader が変わる or 変わらないを知っているはずがない

別の問題 (かもしれないもの)

サイドバー開閉で pageHeaderX が変わった場合に再計算されないかもしれない
PagePathNavSticky が sidebarWidth を依存配列に入れているように、このコンポーネントでもサイドバー開閉時の pageHeaderX 変化への対応が必要かもしれない

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認したところ現状では実質no-opのようですが将来を含めた保証という観点からuseCallbackの削除を元通りにしました

別の問題 (かもしれないもの)

についてはEditorではサイドバーの開閉によってwidth は再計算されないはずなので対応は不要だと考えています

@yuki-takei
Copy link
Contributor

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Mar 9, 2026

Merge Queue Status

This pull request spent 13 minutes 34 seconds in the queue, including 13 minutes 20 seconds running CI.

Required conditions to merge
  • -check-failure ~= ci-app-
  • -check-failure ~= ci-slackbot-
  • -check-failure ~= test-prod-node20 /
  • check-success = test-prod-node20 / build-prod
  • check-success ~= ci-app-launch-dev
  • check-success ~= ci-app-lint
  • check-success ~= ci-app-test
  • check-success ~= test-prod-node20 / launch-prod
  • check-success ~= test-prod-node20 / run-playwright

@mergify mergify bot added the queued label Mar 9, 2026
mergify bot added a commit that referenced this pull request Mar 9, 2026
@mergify mergify bot merged commit 88bc92e into master Mar 9, 2026
33 checks passed
@mergify mergify bot deleted the fix/176753-fix-mobile-editor-page-title-display branch March 9, 2026 09:47
@mergify mergify bot removed the queued label Mar 9, 2026
This was referenced Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants