Skip to content

Conversation

@MelkorBalrog
Copy link
Owner

Summary

  • rebuild detached tabs by cloning widgets rather than reparenting across toplevel windows
  • update regression test to verify tab cloning behaviour
  • document the change in HISTORY

Testing

  • radon cc -j gui/utils/widget_transfer_manager.py
  • pytest tests/detachment/window/test_reparent_across_toplevel.py
  • pytest (failed: Segmentation fault)

https://chatgpt.com/codex/tasks/task_b_68bba11ff6c08327b511e5b78c9ab667

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

Comment on lines +81 to +85
# Copy configuration options
try:
config = widget.configure()
except tk.TclError:
config = {}

Choose a reason for hiding this comment

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

[P1] Cloned tabs discard widget runtime state

The new _clone_widget instantiates fresh widgets and only replays configuration options and event bindings. Stateful content (text inserted into a Text/Entry without a textvariable, listbox items, canvas drawings, etc.) is stored inside the widget rather than in configure() data, so these values are dropped when the original tab is destroyed and the clone is added. The previous implementation reparented the existing widget and preserved this state. Detaching a tab that users have already interacted with will now silently lose their data.

Useful? React with 👍 / 👎.

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.

1 participant