Skip to content

Adding preview_layout - #1139

Open
arpadav wants to merge 1 commit into
Canop:mainfrom
arpadav:feat-preview-layout
Open

Adding preview_layout#1139
arpadav wants to merge 1 commit into
Canop:mainfrom
arpadav:feat-preview-layout

Conversation

@arpadav

@arpadav arpadav commented Mar 5, 2026

Copy link
Copy Markdown

I had a similar problem as @j-xella in #1059, where I used broot in a narrow-fashion

This was my attempted at adding a vertical-stacking mode as opposed to the only horizontal-tiling.

PREFACE

  • There is still a visual bug with the areas.input rendering (see video below)
  • There is still a visual bug with the folder / entry-count and the filename / line count rendering (see video below)
  • move_panel_divider / set_panel_width is not yet implemented

Main changes

  • Add preview_layout to config. Options include right (default) and bottom
  • Renamed has_preview: bool -> preview_layout: Option<PreviewLayout>, where None is analogous to false
  • Added BrowserState::effective_page_height
  • Modified Areas::compute_areas to change the preview area to be vertically stacked, with an early return

Help requested

In Areas::compute_areas is where the majority of the logic is for how the vertical stacking is implemented.

I can't seem to wrap my head around how the areas.input is being rendered, since I tried many configurations and doesn't seem to work. In addition, this single conditional with early return is just my somewhat hacky attempt at this problem, but unsure if there are better alternative ways to structure the code.

In addition, it is also in Areas::compute_areas where the layout_instructions are passed in and modified. However, I did not want to change the logic before getting any guidance on

  1. Is this feature something worth pursuing?
  2. Rename set_panel_width to something else, or keep the term as "width"?

Showcase

You can see that:

  1. Without preview, the input line renders properly
  2. With preview only, the input line does not render properly
  3. With preview and "entering" the preview, the input line renders properly
Screencast.from.2026-03-05.17-20-16.webm

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant