Skip to content

Conversation

@mkh-user
Copy link
Member

@mkh-user mkh-user commented Oct 11, 2025

Type of Change

  • Bug fix

Description

Move _apply_split() call after panel loading

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings
  • Changes were added to CHANGELOG

Summary by CodeRabbit

  • Bug Fixes

    • Panel status and layout now correctly restore after startup. Previous sessions’ open/closed states and split configurations are reapplied, preventing panels from appearing collapsed, missing, or in the wrong arrangement on launch. This improves reliability and continuity when reopening the app.
  • Documentation

    • Updated the changelog to include the fix for panel status restoration after startup.

Move _apply_split() call after panel loading
@mkh-user mkh-user added this to the Text Forge 0.2 milestone Oct 11, 2025
@mkh-user mkh-user self-assigned this Oct 11, 2025
@mkh-user mkh-user added the bug A confirmed issue causing incorrect behavior or unexpected results label Oct 11, 2025
@mkh-user mkh-user linked an issue Oct 11, 2025 that may be closed by this pull request
@mkh-user mkh-user moved this from Needs Review to In Progress in Release: Text Forge 1.0 Oct 11, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Walkthrough

Updates CHANGELOG to note a fix. Adjusts panel layout application timing in panel_manager.gd by removing _apply_split() from _ready after _load_layout(), and invoking _apply_split() during _complete_loading immediately after panels are added.

Changes

Cohort / File(s) Summary
Documentation: Changelog
CHANGELOG.md
Adds a “Fixed” entry under Unreleased: panel status not restored after startup, referencing PR #119.
Panel layout timing adjustments
core/scripts/panel_manager.gd
Moves _apply_split() from _ready to _complete_loading; now applies layout right after each panel is added during loading, instead of earlier.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant App
  participant PanelManager
  participant Panels

  App->>PanelManager: _ready()
  Note over PanelManager: Load saved layout (_load_layout)

  rect rgba(230,245,255,0.5)
  Note right of PanelManager: New flow
  loop For each loaded panel
    PanelManager->>Panels: add_panel(panel)
    PanelManager->>PanelManager: _apply_split()
  end
  end
Loading
sequenceDiagram
  autonumber
  participant App
  participant PanelManager

  Note over PanelManager: Old flow (before change)
  App->>PanelManager: _ready()
  PanelManager->>PanelManager: _load_layout()
  PanelManager->>PanelManager: _apply_split()  %% Applied before panels fully loaded
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Restore panel open state #103 — Alters panel_manager.gd to adjust when layout application occurs relative to panel loading, similar to this timing change.

Poem

A bunny taps the panels in a row,
Split now waits until the widgets show.
Startup yawns, then clicks into place—
Layout restored, a tidy space.
Thump-thump feet, PR complete,
Carrots for code that’s crisp and neat. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title succinctly states the primary change of restoring the panel split state after startup and directly reflects the bug fix described in the PR objectives.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 118-panel-status-is-not-restored-after-startup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@mkh-user mkh-user changed the title Fix #118 Restore panel split state after startup Oct 11, 2025
@mkh-user mkh-user merged commit a427efb into Main Oct 11, 2025
2 checks passed
@mkh-user mkh-user deleted the 118-panel-status-is-not-restored-after-startup branch October 11, 2025 13:51
@github-project-automation github-project-automation bot moved this from In Progress to Completed in Release: Text Forge 1.0 Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A confirmed issue causing incorrect behavior or unexpected results

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

Panel status is not restored after startup

2 participants