Skip to content

New Solution Tabs Inherit Code from Previous Solution Instead of Resetting #5402

@danish-parvez

Description

@danish-parvez

Description:
When using the coding editor, opening a new solution tab (e.g., Solution 2 or Solution 3) via the “+” button does not start with a clean/default editor state.

Instead, the newly opened solution tab initially contains the code from the previously active solution tab.

Steps to Reproduce:

  1. Open any problem in the NeetCode coding editor.
  2. Write code in Solution 1.
  3. Click the “+” button to create Solution 2 (or Solution 3).
  4. Observe the editor contents.

Actual Behavior:

  • The new solution tab initially shows the code from the previously active solution tab.
  • The editor only resets to the default template after navigating back to Solution 1 and then returning to Solution 2.

Expected Behavior:

  • Each new solution tab should open with a clean/default editor state immediately, without inheriting code from another solution.

Impact:

  • This behavior is confusing and interrupts workflow.
  • Requiring users to switch back and forth between tabs just to reset the editor is inconvenient and unintuitive, especially when working with multiple solutions.

Environment:

  • Browser: ChatGPT Atlas
  • OS: MacOS

Please let me know if a screen recording or additional details would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions