Skip to content

Draggable resize handles for left-column select panels #3

Description

@jBugman

Summary

Add draggable resize handles between the three left-column select panels (recipe / food / potion) so the user can manually adjust how the available vertical space is split, on top of the ratio-based default already in place.

Background

PR #362 makes the left column stretch to fill the window and distributes the surplus vertical space between the recipe/food/potion search tables using a fixed default ratio (currently 50 : 25 : 25, see MacroSolverApp::LEFT_COLUMN_TABLE_WEIGHTS in src/app.rs). The ratio is only configurable in code.

In review, the maintainer noted that a more general, user-customisable/resizable layout would be preferable, and pointed at upstream issue KonaeAkira#305 (resizable/customisable panels, no concrete plans yet). This issue tracks the manual-resize half of that, scoped to the left column.

Proposed behaviour

  • A thin draggable separator between adjacent expanded panels (and between the recipe panel and the food panel, etc.). Hovering shows CursorIcon::ResizeVertical; dragging moves space from one panel's table to its neighbour's.
  • Default sizing stays the ratio split. Once the user drags, switch to user-controlled heights and stop reapplying the default ratio for that session.
  • Handles only appear in the side-by-side layout (columns_fit_side_by_side); wrapped/mobile layouts keep natural heights, same gating as the current stretch.

Implementation notes

  • egui has no built-in stacked splitter; the docked egui::Panel/TopBottomPanel resizables don't nest cleanly inside the wrapping column inside ScrollArea::both. So this needs a small custom widget: ui.interact(rect, id, Sense::drag()) on a separator strip, accumulate drag_delta().y into stored per-panel table heights, clamp each to its minimum (recipe_table_min_height / consumable_table_min_height), and keep the totals summing to the fill budget.
  • Persist the user's chosen heights (egui persisted data, like the dev panel) so they survive a reload, plus a "user has manually resized" flag to suppress the default ratio.
  • Handle the budget changing on window resize: scale stored heights proportionally and re-clamp to minimums.
  • Reuse the single-frame measurement that PR Allow recipe list to stretch to use all vertical space available KonaeAkira/raphael-rs#362 added (request_discard on a fixed-height change) so manual resizes don't reintroduce multi-frame settling.
  • Optional: double-click a handle to reset that boundary back to the default ratio.

Out of scope

Full per-section customisation of the right column / general layout editor — that's the broader upstream KonaeAkira#305 effort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions