Skip to content

Tidy Learning Radar and keep scenery fixed when navigation closes - #70

Draft
TraSh9178 wants to merge 1 commit into
mainfrom
codex/radar-layout-stable-background
Draft

TraSh9178 wants to merge 1 commit into
mainfrom
codex/radar-layout-stable-background

Conversation

@TraSh9178

Copy link
Copy Markdown
Owner

Moves the topic flagging controls above the chart and shows four ranked topics by default, with the complete ranking and reasons one click away. The chart continues to track the selected topic. The sidebar is a transparent sliding layer, with both mountains painted only by the app canvas and stable desktop content spacing. CSS respects reduced-motion preferences.

Focused tests cover the compact ranking and the separate scenery layer. Browser visual acceptance is pending. Keep this draft unmerged until the owner approves.

@k086-cloud

Copy link
Copy Markdown
Collaborator

Checked this draft locally at a02789f (no database, no API key, 1280×800 window). Two things need fixing before it can go in.

1. Desktop layout: the page content is pushed 272px to the right and cut off (blocking)

Measured with the sidebar open: stMain has margin-left: 272px and spans x = 544 … 1552 in a 1280px window; the first card ends at x = 1497, so its right part is off screen. The sidebar still occupies x = 0 … 272 in the flex row.

Cause: Streamlit writes inline styles on the sidebar element (style="position: relative; user-select: auto; width: 300px; …", from its resizable wrapper). The inline position: relative beats position: fixed in assets/paper_shell.css, because that rule has no !important (the width rule has one, which is why the width does apply). So the sidebar never leaves the layout, and the new margin-inline-start on stMain is added on top of it. Collapsing does not help: the sidebar becomes invisible but keeps its 272px.

Fix: position: fixed !important; and inset: 0 auto 0 0 !important; on section[data-testid="stSidebar"]. Then check at 1280 and 1440 wide that stMain's right edge is inside the window and that the content's left edge is the same with the sidebar open and closed.

2. Learning Radar: the ranking and reasons are behind an expander

render_radar_panel(preview_limit=4) now shows four topics without their reasons and folds the full list into st.expander("All flagged topics and reasons"). The rule this round was built on (see #69) is that nothing analytical sits behind an expander: results are shown directly, and a block of secondary material gets a small edge button to a page of its own (components/page_links.open_page_button). This page is the Learning Radar page itself, so the simplest fix is to show the whole ranking with its reasons directly, as main does now. Moving the flag buttons above the chart is fine.

What still holds (checked)

  • The accessibility settings are still the last thing in the sidebar (16px above the bottom of an 800px window).
  • Both hills are painted on the app canvas, so they stay when the sidebar closes. They now sit behind the sidebar's status notice and the accessibility bar rather than in their own space above the bar; please look at that once in a browser and confirm it is what you want.

Tests and merge order

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.

2 participants