Conversation
Deploying space-simulator with
|
| Latest commit: |
3f5cc98
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ac4d79a1.space-simulator.pages.dev |
| Branch Preview URL: | https://feature-planetarrange.space-simulator.pages.dev |
3f5cc98 to
0c505a8
Compare
tknkaa
reviewed
Feb 19, 2026
| import type { Planet } from "@/types/planet"; | ||
| import { earth } from "@/data/planets"; | ||
|
|
||
| interface PlanetMeshProps { |
Contributor
There was a problem hiding this comment.
interface と type のどっちを使うかっていう論争があって、まあ正直どっちでもいいんですけど、園部くんの PR の方で type の方が直感的でいいんじゃないかっていう話をしたので、type に統一してほしいです。
| ); | ||
| } | ||
|
|
||
| interface PlacementSurfaceProps { |
| <pointLight position={[10, 10, 10]} intensity={3} /> | ||
|
|
||
| {planets.map((planet, index) => ( | ||
| <PlanetMesh key={`planet-${index}`} planet={planet} /> |
Contributor
There was a problem hiding this comment.
map の key に配列のインデックスを使うのはよくあるアンチパターンなので、planet の型定義に name プロパティを追加してあげて、それをユニークな識別子に使うのがいいと思います。ただ、この話は園部くんの PR の方でもしていてコンフリクトすると思うので、園部くんの PR がマージされてから pull して直すようにしてください。
| <ul className="mb-0 mt-2.5 list-none p-0"> | ||
| {planets.map((planet, index) => ( | ||
| <li | ||
| key={`planet-item-${index}`} |
Contributor
There was a problem hiding this comment.
ここでも key に配列のインデックスを使ってますね。このまま惑星を削除したり追加したりしたらバグの原因になります。
| const [placementMode, setPlacementMode] = useState(false); | ||
| const [placementPanelOpen, setPlacementPanelOpen] = useState(true); | ||
|
|
||
| const [planetControls, setPlanetControls, getPlanetControl] = useControls("New Planet", () => ({ |
Contributor
There was a problem hiding this comment.
可能ならここの useControls を一つにまとめてほしいです。
| ); | ||
| } | ||
|
|
||
| interface PreviewPlanetProps { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
惑星(地球)の配置機能を一旦追加
・levaで座標、大きさ、回転速度を指定して地球を配置できるようにした。
・プレビューを実装。
・クリック配置の機能を実装。
・ついでに一覧表示と削除も追加。
Simulation/index.tsxに全部書いたが、配置機能は別で管理すべきかもしれない。