Add multi-window support for Network Inspector#99
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c9c4e1bca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| val initialPosition = parentState | ||
| ?.position | ||
| ?.takeIf { it.isSpecified && it.x.isSpecified && it.y.isSpecified } | ||
| ?.let { WindowPosition(it.x + NewWindowOffset, it.y + NewWindowOffset) } | ||
| windows.add(createInspectorWindow(initialPosition = initialPosition)) |
There was a problem hiding this comment.
Avoid persisting offset positions for new windows
Because every window still writes to the same preferences node, creating a new window with an offset initialPosition causes that offset to be persisted even if the user never moves the new window. Opening a new window a few times will overwrite the stored default position and make subsequent launches (and other windows) drift by 100dp per open, potentially ending up off-screen. Consider skipping persistence for secondary windows or storing per-window prefs so the offset is only a launch-time hint.
Useful? React with 👍 / 👎.
Summary
Testing