Skip to content

Portrait positioning: does not anchor to the window corner and leaves a gap above the status bar #38

@arcavenai

Description

@arcavenai

What happened

The portrait overlay does not anchor tightly to the terminal window edges in either supported position:

  • Top-right position: the portrait is not flush with the top-right corner of the window — there is visible padding on the top and/or right edges. It does not sit in the corner; it floats inside the viewport.
  • Bottom-right position: the portrait floats a full blank line above the status bar, leaving a visible gap between the bottom of the portrait image and the top of the status bar. It should rest directly on the status bar — either touching it, or offset by only one or two pixels (not a full text row) if the graphics protocol requires integer cell alignment.

The right edge in both positions also has a gap rather than sitting flush against the right margin.

Expected behavior

  • Top-right: portrait's top-right pixel sits at the top-right pixel of the viewport (modulo one cell if the graphics protocol requires cell-aligned placement). No padding above or to the right.
  • Bottom-right: portrait's bottom edge rests against the top of the status bar. If the graphics protocol forces integer-cell vertical alignment, the gap should be at most one cell — not a full blank line with visible empty terminal background.
  • In both cases, the right edge of the portrait sits at the right edge of the viewport, again modulo cell alignment if unavoidable.

The goal is "the character is in the corner of my window", not "the character is in a box inside my window".

Notes

Kitty graphics and Sixel protocols both allow sub-cell pixel offsets within a cell placement — placement is integer-cell, but the rendered image can be offset inside that cell. Check whether the current placement is computing the anchor position from the viewport dimensions including or excluding the status bar row, and whether an off-by-one row is being added somewhere for "padding" that shouldn't exist.

Reproduction

  1. forestage (launches TUI with the default portrait overlay)
  2. Observe portrait position in top-right default
  3. Press Ctrl+P to cycle to bottom-right
  4. Observe the one-line gap between the portrait bottom and the status bar
  5. Resize the terminal; confirm the gap is consistent (i.e. not a one-time calculation artifact)

References

  • src/tui/portrait_widget.rs — portrait widget rendering
  • src/tui/app.rs — portrait position state, Ctrl+P handler
  • src/portrait.rs — portrait loading and dimensions
  • src/terminal.rs — terminal cell size detection

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions