fix(ui): position highlight button inside reader pane

- Move HighlightButton from fixed viewport positioning to absolute positioning within main pane
- Add position: relative to .pane.main for both desktop and mobile layouts
- Button now stays within the article/reader view instead of floating outside on desktop
- Maintains proper z-index and responsive behavior
This commit is contained in:
Gigi
2025-10-15 21:47:28 +02:00
parent 40b43532e8
commit f5e9e5bf61
3 changed files with 40 additions and 36 deletions

View File

@@ -44,10 +44,10 @@ export const HighlightButton = React.forwardRef<HighlightButtonRef, HighlightBut
<button
className="highlight-fab"
style={{
position: 'fixed',
position: 'absolute',
bottom: '32px',
right: '32px',
zIndex: 1000,
zIndex: 10,
width: '56px',
height: '56px',
borderRadius: '50%',

View File

@@ -359,33 +359,42 @@ const ThreePaneLayout: React.FC<ThreePaneLayoutProps> = (props) => {
{props.support}
</>
) : (
<ContentPanel
loading={props.readerLoading}
title={props.readerContent?.title}
html={props.readerContent?.html}
markdown={props.readerContent?.markdown}
image={props.readerContent?.image}
summary={props.readerContent?.summary}
published={props.readerContent?.published}
selectedUrl={props.selectedUrl}
highlights={props.classifiedHighlights}
showHighlights={props.showHighlights}
highlightStyle={props.settings.highlightStyle || 'marker'}
highlightColor={props.settings.highlightColor || '#ffff00'}
onHighlightClick={props.onHighlightClick}
selectedHighlightId={props.selectedHighlightId}
highlightVisibility={props.highlightVisibility}
onTextSelection={props.onTextSelection}
onClearSelection={props.onClearSelection}
currentUserPubkey={props.currentUserPubkey}
followedPubkeys={props.followedPubkeys}
settings={props.settings}
relayPool={props.relayPool}
activeAccount={props.activeAccount}
currentArticle={props.currentArticle}
isSidebarCollapsed={props.isCollapsed}
isHighlightsCollapsed={props.isHighlightsCollapsed}
/>
<>
<ContentPanel
loading={props.readerLoading}
title={props.readerContent?.title}
html={props.readerContent?.html}
markdown={props.readerContent?.markdown}
image={props.readerContent?.image}
summary={props.readerContent?.summary}
published={props.readerContent?.published}
selectedUrl={props.selectedUrl}
highlights={props.classifiedHighlights}
showHighlights={props.showHighlights}
highlightStyle={props.settings.highlightStyle || 'marker'}
highlightColor={props.settings.highlightColor || '#ffff00'}
onHighlightClick={props.onHighlightClick}
selectedHighlightId={props.selectedHighlightId}
highlightVisibility={props.highlightVisibility}
onTextSelection={props.onTextSelection}
onClearSelection={props.onClearSelection}
currentUserPubkey={props.currentUserPubkey}
followedPubkeys={props.followedPubkeys}
settings={props.settings}
relayPool={props.relayPool}
activeAccount={props.activeAccount}
currentArticle={props.currentArticle}
isSidebarCollapsed={props.isCollapsed}
isHighlightsCollapsed={props.isHighlightsCollapsed}
/>
{props.hasActiveAccount && (
<HighlightButton
ref={props.highlightButtonRef}
onHighlight={props.onCreateHighlight}
highlightColor={props.settings.highlightColorMine || '#ffff00'}
/>
)}
</>
)}
</div>
<div
@@ -414,13 +423,6 @@ const ThreePaneLayout: React.FC<ThreePaneLayoutProps> = (props) => {
/>
</div>
</div>
{props.hasActiveAccount && (
<HighlightButton
ref={props.highlightButtonRef}
onHighlight={props.onCreateHighlight}
highlightColor={props.settings.highlightColorMine || '#ffff00'}
/>
)}
<RelayStatusIndicator
relayPool={props.relayPool}
showOnMobile={showBookmarkButton}

View File

@@ -55,6 +55,7 @@
min-height: 100vh;
overflow: visible !important;
height: auto !important;
position: relative;
}
.pane.highlights {
@@ -137,6 +138,7 @@
max-width: 100%;
width: 100%;
transition: opacity 0.2s ease;
position: relative;
}
/* Hide main content when sidepanes are open on mobile */
.three-pane .pane.main.mobile-hidden { opacity: 0; pointer-events: none; }