Skip to content

file-viewer: overlapping buttons and duplicate download in unsupported fallback #4070

Description

@ha2818an

After enabling allowDownload={true} on <limel-file-viewer> (BB PR #1432), two visual problems surfaced:

Problem 1: Toolbar buttons overlap with consumer-positioned UI

.buttons in file-viewer/partial-styles/ui-controls.scss is position: absolute; top: 0.25rem; right: 0.25rem. Any consumer that places its own controls in the top-right (e.g. limebb-summary-popover puts its close button at top: 0.125rem; right: 0.125rem) will collide. With more allow* flags enabled, more buttons stack down and the collision area grows.

Image

There's no CSS ::part exposed on .buttons and no CSS variable for offset, so consumers can't reposition the toolbar.

Problem 2: Duplicate download button in renderText / renderEmail fallback

renderText (file-viewer.tsx:265-274) and renderEmail (file-viewer.tsx:276-291) render renderButtons() (the toolbar) AND wrap their <object> / <limel-email-viewer> with renderNoFileSupportMessage() as fallback. That message has its own inline download button (file-viewer.tsx:343). When the embedded view fails to render natively (observed for .json blob URLs in Chrome), both render → two download buttons.

Image

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions