Skip to content

GTK: remove SidebarPanel enum — read panel state from engine AppShell in #[watch] bindings #408

Description

@JDonaghy

Problem

The GTK backend keeps a SidebarPanel enum and active_panel/sidebar_visible cache fields that mirror engine.app_shell state. These exist solely because Relm4 #[watch] expressions reference model.sidebar_visible and model.active_panel == SidebarPanel::Explorer directly.

Proposed fix

Replace #[watch] expressions with engine reads:

  • model.sidebar_visiblemodel.engine.borrow().app_shell.sidebar_visible()
  • model.active_panel == SidebarPanel::Explorermodel.engine.borrow().active_panel_is("panel:explorer")

Then remove SidebarPanel enum, sidebar_visible, active_panel fields, and SidebarPanel::from_panel_id()/to_panel_id() helpers.

Context

Left as thin cache during #385 GTK migration (Session 375). The #[watch] expressions re-evaluate after every update() call, so borrowing the engine RefCell should be safe (no concurrent borrows at that point).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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