Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

Feature/chore dev setting - #25

Merged
kirikirisu merged 2 commits into
mainfrom
feature/chore-dev-setting
Mar 3, 2026
Merged

Feature/chore dev setting#25
kirikirisu merged 2 commits into
mainfrom
feature/chore-dev-setting

Conversation

@kirikirisu

@kirikirisu kirikirisu commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

リリースノート

  • ドキュメント

    • READMEを日本語で改訂し、技術スタック、開発セットアップ、コマンドガイドを追加
  • チューニング

    • コード整形ツール(oxfmt)と整形スクリプトを追加
    • 開発環境の設定ファイルを統一
  • スタイル

    • コード全体の整形とフォーマットを標準化

@coderabbitai

coderabbitai Bot commented Mar 3, 2026

Copy link
Copy Markdown

Walkthrough

フォーマッティングツール oxfmt の設定とスクリプトを追加し、プロジェクト全体の code formatting を統一。README を日本語化し、ソースコードの引用符とセミコロンを正規化。

Changes

コホート / ファイル サマリー
フォーマッティング設定
webapp/frontend/react/.oxfmtrc.json, webapp/frontend/react/package.json
oxfmt の新しい設定ファイルと npm スクリプト (fmtfmt:check) を追加。devDependencies に oxfmt@^0.36.0 を追加。
コード形式の正規化
webapp/frontend/react/eslint.config.js, webapp/frontend/react/src/App.tsx, webapp/frontend/react/src/main.tsx, webapp/frontend/react/vite.config.ts
引用符をシングルからダブルに統一し、セミコロン配置を正規化。機能・制御フローの変更なし。
設定ファイル形式整理
webapp/frontend/react/tsconfig.json
tsconfig の references 配列をマルチラインから単一ラインに整形。パス内容に変更なし。
ドキュメント更新
webapp/frontend/react/README.md
README を日本語化し、技術スタック・開発環境セットアップ・プロジェクト構成に関する説明を再構成。詳細な設定コードブロックから実行コマンドベースのガイドに変更。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは「Feature/chore dev setting」で、oxfmtフォーマッティングツールの追加とREADMEの更新など、開発環境設定関連の複数の変更を含む変更セットを適切に反映しています。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/chore-dev-setting

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
webapp/frontend/react/README.md (1)

78-87: コードブロックに言語指定を追加してください。

ディレクトリ構造のコードブロックに言語指定がありません。text または plaintext を指定することで、マークダウンリンターの警告を解消できます。

📝 修正案
-```
+```text
 react/
 ├── src/             # ソースコード
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@webapp/frontend/react/README.md` around lines 78 - 87, Update the fenced code
block in the README.md that shows the react/ directory tree by adding a language
identifier (e.g., text or plaintext) to the opening triple backticks so the
block becomes ```text (or ```plaintext) instead of just ```, addressing the
markdown linter warning; locate the directory tree block in the react/ README
and change only the opening fence language specifier for the existing code
block.
webapp/frontend/react/src/App.tsx (1)

60-63: 型定義と実際の使用方法に不整合があります。

PressRelease 型では contentstring ですが、Line 57 で JSON.parse(data.content) の結果を渡しています。実際にはパース済みのオブジェクトを受け取るため、型定義を修正することを検討してください。

♻️ 修正案
 type PressRelease = {
   title: string;
-  content: string;
+  content: Record<string, unknown>;
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@webapp/frontend/react/src/App.tsx` around lines 60 - 63, PressRelease
型と実際の使用が不整合なので、型定義を修正してください: 現在の type PressRelease の content を string
のままにせず、JSON.parse(data.content) の戻り値を受け取れる型(例えば content: unknown または content:
Record<string, any> / a specific interface matching the parsed
shape)に変更し、必要に応じて該当箇所で型アサーションやバリデーション(JSON.parse を呼んでいる箇所の変数名 data
と呼ばれる値の検証)を追加して型安全を保ってください。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@webapp/frontend/react/src/App.tsx`:
- Line 77: editor が null の可能性を考慮していないため content に直接 editor.getJSON()
を使うとクラッシュします。content を設定する箇所で editor を先にチェックし(editor !== null または if (!editor)
return / 空オブジェクトをセットなど)、editor が存在する場合のみ editor.getJSON() を呼び出すように修正してください(参照:
editor 変数、getJSON メソッド、useEditor フック)。

---

Nitpick comments:
In `@webapp/frontend/react/README.md`:
- Around line 78-87: Update the fenced code block in the README.md that shows
the react/ directory tree by adding a language identifier (e.g., text or
plaintext) to the opening triple backticks so the block becomes ```text (or
```plaintext) instead of just ```, addressing the markdown linter warning;
locate the directory tree block in the react/ README and change only the opening
fence language specifier for the existing code block.

In `@webapp/frontend/react/src/App.tsx`:
- Around line 60-63: PressRelease 型と実際の使用が不整合なので、型定義を修正してください: 現在の type
PressRelease の content を string のままにせず、JSON.parse(data.content) の戻り値を受け取れる型(例えば
content: unknown または content: Record<string, any> / a specific interface
matching the parsed shape)に変更し、必要に応じて該当箇所で型アサーションやバリデーション(JSON.parse
を呼んでいる箇所の変数名 data と呼ばれる値の検証)を追加して型安全を保ってください。

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6c284d2 and 3df1f15.

⛔ Files ignored due to path filters (1)
  • webapp/frontend/react/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • webapp/frontend/react/.oxfmtrc.json
  • webapp/frontend/react/README.md
  • webapp/frontend/react/eslint.config.js
  • webapp/frontend/react/package.json
  • webapp/frontend/react/src/App.tsx
  • webapp/frontend/react/src/main.tsx
  • webapp/frontend/react/tsconfig.json
  • webapp/frontend/react/vite.config.ts

content: JSON.stringify(editor.getJSON())
})
}
content: JSON.stringify(editor.getJSON()),

@coderabbitai coderabbitai Bot Mar 3, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

editor の null チェックが必要です。

useEditornull を返す可能性があります。editor.getJSON() を呼び出す前に null チェックを追加してください。

🛡️ 修正案
 const handleSave = () => {
+   if (!editor) return;
    mutate({
      title,
      content: JSON.stringify(editor.getJSON()),
    });
  };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
content: JSON.stringify(editor.getJSON()),
const handleSave = () => {
if (!editor) return;
mutate({
title,
content: JSON.stringify(editor.getJSON()),
});
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@webapp/frontend/react/src/App.tsx` at line 77, editor が null の可能性を考慮していないため
content に直接 editor.getJSON() を使うとクラッシュします。content を設定する箇所で editor
を先にチェックし(editor !== null または if (!editor) return / 空オブジェクトをセットなど)、editor
が存在する場合のみ editor.getJSON() を呼び出すように修正してください(参照: editor 変数、getJSON メソッド、useEditor
フック)。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

useEditor の immediatelyRender オプションが false だと null を返す可能性がありますが、デフォルトで true でnull を返さないためnull チェックは不要です

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧩 Analysis chain

🌐 Web query:

TipTap useEditor immediatelyRender option default behavior

💡 Result:

In Tiptap’s React useEditor, immediatelyRender defaults to true (the editor is created/rendered on the first render on the client). If you set immediatelyRender: false, it defers initialization until after mount (e.g., via useEffect), which is the recommended setting for SSR to avoid hydration issues. [1], [2], [3]

Practical rule:

  • CSR-only app: leave default (true)
  • Next.js / SSR: set immediatelyRender: false [2], [3]

Sources:
[1] @tiptap/react useEditor.ts (UNPKG)
[2] Tiptap React install/SSR docs
[3] @tiptap/[email protected] release notes summary (new immediatelyRender behavior)


🌐 Web query:

TipTap useEditor return type null immediatelyRender true

💡 Result:

In Tiptap React, useEditor can be Editor | null—and you should treat it as nullable even if you set immediatelyRender: true.

Why it can be null

  • The hook’s implementation returns Editor | null, and its “server snapshot” is always null (so in SSR/Next it will be null during server render). [1]
  • In the source, the initial editor is only created immediately when immediatelyRender is truthy and you’re not in SSR; otherwise it returns null. [1]
  • Tiptap’s docs recommend immediatelyRender: false for SSR and rendering a placeholder until the editor is ready. [2]

What to do in your code

Guard for null on initial render:

const editor = useEditor({ extensions: [...], content: '...', immediatelyRender: true })

if (!editor) return null // or a loading UI
return <EditorContent editor={editor} />

If you’re in Next.js / SSR, set:

immediatelyRender: false

and show a loading state until it initializes on the client. [2]

Sources:
[1] @tiptap/react useEditor.ts (implementation + overloads, SSR snapshot is null, initial editor creation logic) https://app.unpkg.com/@tiptap/[email protected]/files/src/useEditor.ts
[2] Tiptap React composable API guide (SSR + immediatelyRender) https://tiptap.dev/docs/guides/react-composable-api


@kirikirisu さん、ご説明ありがとうございます。

immediatelyRender のデフォルトが true である点については仰る通りです。ただし、TipTap の useEditor フックの型定義は Editor | null となっており、immediatelyRender: true の場合でも初回レンダリング時に null になる可能性があります。

特に、Tiptap のドキュメントでは初回レンダリング時の null チェックを推奨しています。このプロジェクトは CSR のみの環境のようですので、実際には問題が起きない可能性が高いですが、TypeScript の型安全性の観点からは null チェックを追加しておく方が安全です。

ただし、実装の判断はプロジェクトの方針次第ですので、現状のままで問題ないとお考えであれば、そのままで構いません。


🧠 Learnings used
Learnt from: EC-9624
Repo: PRTIMES/prtimes-frontend PR: 11148
File: apps/prtimes/src/features/analytics/pages/release-report-detail/components/heat-map-report-tab-content/index.tsx:118-125
Timestamp: 2025-10-23T07:55:11.614Z
Learning: In apps/prtimes/src/features/analytics/pages/release-report-detail/components/heat-map-report-tab-content/index.tsx, the HTML content retrieved from pressReleaseEditorApi.getPressRelease (contentData?.head and contentData?.text) is already sanitized on the server side, so additional client-side sanitization with DOMPurify is not required when using dangerouslySetInnerHTML.

Learnt from: EC-9624
Repo: PRTIMES/prtimes-frontend PR: 12271
File: apps/prtimes/src/features/press-release-editor-v3/states/jotai/reservation.ts:0-0
Timestamp: 2026-01-27T01:47:35.636Z
Learning: Repo: PRTIMES/prtimes-frontend - Jotaiの`createStore`を`import {atom, type createStore, useSetAtom} from 'jotai'`のようにtype修飾子付きでインポートし、`ReturnType<typeof createStore>`で使用するパターンは問題なく動作する。TypeScriptのタイプチェックをパスする。

Learnt from: miyabin4113
Repo: PRTIMES/prtimes-frontend PR: 12112
File: apps/prtimes/src/features/press-release-editor-v3/tiptap/extensions/heading/index.ts:27-33
Timestamp: 2026-01-20T02:01:09.618Z
Learning: PRTIMES/prtimes-frontend リポジトリの apps/prtimes/src/features/press-release-editor-v3/tiptap/extensions/heading/index.ts において、`addOptions()` および `addCommands()` 内の `this.parent!()` の非null assertionは、TipTapの型のバグにより必要な記述である。`this.parent?.()` への変更は不要。

Learnt from: miyabin4113
Repo: PRTIMES/prtimes-frontend PR: 12406
File: apps/prtimes/src/features/press-release-editor-v3/hooks/api/use-auto-save.tsx:171-206
Timestamp: 2026-02-05T07:04:31.299Z
Learning: PRTIMES/prtimes-frontend の apps/prtimes/src/features/press-release-editor-v3/hooks/api/use-auto-save.tsx では、PressReleaseImageAtomIdListState の重複画像削除処理は API 呼び出し前に実行される。これは保存時に毎回UI状態の不整合を即座に修正するためで、画像が上書き保存されるためサーバー側との一時的な不整合は許容される設計となっている。

Learnt from: lll-lll-lll-lll
Repo: PRTIMES/prtimes-frontend PR: 12734
File: apps/prtimes/src/features/press-release-editor-v3/layouts/pc/edit-template.tsx:0-0
Timestamp: 2026-02-25T03:43:27.914Z
Learning: PRTIMES/prtimes-frontend の apps/prtimes/src/features/press-release-editor-v3/layouts/pc/edit-template.tsx において、編集画面オープン時のブロックリストドメイン判定API (verifyBlocklistDomains) で例外が発生した場合は、エラーを握りつぶして編集作業を継続可能な状態にする。これは補助的な警告機能であるため、検証失敗時もユーザーの編集作業を妨げないフェイルセーフ設計が採用されている。

Learnt from: lll-lll-lll-lll
Repo: PRTIMES/prtimes-frontend PR: 12734
File: apps/prtimes/src/features/press-release-editor-v3/hooks/use-press-release-editor-step/index.ts:0-0
Timestamp: 2026-02-26T04:25:39.126Z
Learning: PRTIMES/prtimes-frontend の apps/prtimes/src/features/press-release-editor-v3/hooks/use-press-release-editor-step において、システム管理者モード (isSystemAdminMode && releaseId > 0) の場合、ドメインブロックリスト検証 (verifyOnSave と checkCanToGoStep2) を意図的にスキップする。これはシステム管理者が補助的な警告機能をバイパスできる特別な権限を持つための設計。

Learnt from: lll-lll-lll-lll
Repo: PRTIMES/prtimes-frontend PR: 12733
File: apps/prtimes/src/features/press-release-editor-v3/hooks/use-verify-blocklist-domains/index.ts:0-0
Timestamp: 2026-02-25T04:33:11.959Z
Learning: PRTIMES/prtimes-frontend の apps/prtimes/src/features/press-release-editor-v3/hooks/use-verify-blocklist-domains において、現在のエラーハンドリング実装は暫定的なもので、将来的にTanStack Queryのエラーハンドリング機構に統合される予定。そのため、catch ブロック内の error シリアライズ処理の改善は不要。
<!-- [add_learning]

Learnt from: miyabin4113
Repo: PRTIMES/prtimes-frontend PR: 12406
File: apps/prtimes/src/features/press-release-editor-v3/pages/step2/PressReleaseFile/ImageInserter/index.tsx:49-67
Timestamp: 2026-02-05T05:01:32.353Z
Learning: PRTIMES/prtimes-frontend リポジトリの apps/prtimes/src/features/press-release-editor-v3 配下では、img.src に署名付き URL や認証トークンなどのセンシティブな情報は含まれていないため、noticeError などのログ出力に img.src をそのまま使用しても問題ない。

Learnt from: codyzard
Repo: PRTIMES/prtimes-frontend PR: 12051
File: common/prtimes-company-admin-components/src/const/index.ts:1-6
Timestamp: 2026-01-06T02:19:36.935Z
Learning: Repo: PRTIMES/prtimes-frontend
prtimes-source側ではsnake_case形式を使用しているため、localStorageから読み込むexperimentsオブジェクトのプロパティもsnake_case形式となる。そのため、typescript-eslint/no-unsafe-assignmentルールを無効化することは妥当である。

Learnt from: miyabin4113
Repo: PRTIMES/prtimes-frontend PR: 12381
File: apps/prtimes/src/features/press-release-editor-v3/components/AnnouncementBanner/announcement-banner.stories.tsx:1-88
Timestamp: 2026-02-06T02:36:44.258Z
Learning: PRTIMES/prtimes-frontend リポジトリでは、人間のレビュアーがPRを確認する前に、CodeRabbitのレビューコメントを全てクローズ(解決)しておくことが好ましい。これは、CodeRabbitの指摘が正しかった場合だけでなく、指摘が誤りであった場合も含む。

Learnt from: shogogg
Repo: PRTIMES/prtimes PR: 13578
File: .coderabbit.yaml:1-40
Timestamp: 2025-12-03T04:43:28.405Z
Learning: In the PR `#13578` for PRTIMES-6211, the user shogogg is taking a two-step approach: first organizing and tidying the .coderabbit.yaml configuration file (current PR), then implementing the actual feature change to disable label suggestions (next PR).

@kirikirisu
kirikirisu merged commit 237d5c6 into main Mar 3, 2026
3 checks passed
@sucalul
sucalul deleted the feature/chore-dev-setting branch March 6, 2026 12:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant