Skip to content

Sensor page: Stop side-panels using vertical space when closed#2033

Draft
nhoening wants to merge 5 commits intomainfrom
feat/options-on-sensor-page-use-less-vertical-space-when-closed
Draft

Sensor page: Stop side-panels using vertical space when closed#2033
nhoening wants to merge 5 commits intomainfrom
feat/options-on-sensor-page-use-less-vertical-space-when-closed

Conversation

@nhoening
Copy link
Copy Markdown
Contributor

@nhoening nhoening commented Mar 17, 2026

  • TODO 1: Fix z-index, use one global stacking index (CSS variables)
  • TODO 2: Better class names: rename sidepanelssidepanel, left-sidepanel-labelsidepanel-label, sidepanel left-sidepanelsidepanel-content in all templates + CSS + JS
  • TODO 3: Accommodate chart dropdown and delete button in sensors/index.html — moved them outside the .sidepanel wrapper, below the sidepanel tabs
  • Remove old commented-out CSS block and clean up TODO list
  • Fix z-index stacking context: move z-index from .sidepanel-container to .sidepanel so open panel content is never covered by subsequent closed containers
  • Fix sliding animation regression: restore transform: translateX slide (height→auto cannot be animated)
  • Fix button fade lingers: remove opacity transition from panel (litepicker preset buttons' own transitions no longer layer over panel fade)

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening self-assigned this Mar 17, 2026
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community bot commented Mar 17, 2026

Documentation build overview

📚 flexmeasures | 🛠️ Build #32124296 | 📁 Comparing f3630cb against latest (1ce87c1)

  🔍 Preview build  

Show files changed (106 files in total): 📝 104 modified | ➕ 0 added | ➖ 2 deleted
File Status
changelog.html 📝 modified
configuration.html 📝 modified
genindex.html 📝 modified
get-in-touch.html 📝 modified
http-routingtable.html 📝 modified
index.html 📝 modified
py-modindex.html 📝 modified
_autosummary/flexmeasures.api.common.responses.html 📝 modified
_autosummary/flexmeasures.api.common.schemas.assets.html 📝 modified
_autosummary/flexmeasures.api.common.schemas.generic_schemas.html 📝 modified
_autosummary/flexmeasures.api.common.schemas.search.html 📝 modified
_autosummary/flexmeasures.api.common.schemas.sensor_data.html 📝 modified
_autosummary/flexmeasures.api.common.schemas.sensors.html 📝 modified
_autosummary/flexmeasures.api.common.schemas.users.html 📝 modified
_autosummary/flexmeasures.api.common.utils.args_parsing.html 📝 modified
_autosummary/flexmeasures.api.dev.sensors.html 📝 modified
_autosummary/flexmeasures.api.v3_0.accounts.html 📝 modified
_autosummary/flexmeasures.api.v3_0.assets.html 📝 modified
_autosummary/flexmeasures.api.v3_0.deprecated.html 📝 modified
_autosummary/flexmeasures.api.v3_0.health.html 📝 modified
_autosummary/flexmeasures.api.v3_0.public.html 📝 modified
_autosummary/flexmeasures.api.v3_0.sensors.html 📝 modified
_autosummary/flexmeasures.api.v3_0.users.html 📝 modified
_autosummary/flexmeasures.auth.policy.html 📝 modified
_autosummary/flexmeasures.cli.utils.html 📝 modified
_autosummary/flexmeasures.data.models.annotations.html 📝 modified
_autosummary/flexmeasures.data.models.audit_log.html 📝 modified
_autosummary/flexmeasures.data.models.charts.belief_charts.html 📝 modified
_autosummary/flexmeasures.data.models.data_sources.html 📝 modified
_autosummary/flexmeasures.data.models.forecasting.custom_models.base_model.html 📝 modified
_autosummary/flexmeasures.data.models.forecasting.custom_models.lgbm_model.html 📝 modified
_autosummary/flexmeasures.data.models.forecasting.exceptions.html 📝 modified
_autosummary/flexmeasures.data.models.forecasting.html 📝 modified
_autosummary/flexmeasures.data.models.forecasting.model_spec_factory.html 📝 modified
_autosummary/flexmeasures.data.models.forecasting.model_specs.naive.html 📝 modified
_autosummary/flexmeasures.data.models.forecasting.pipelines.base.html 📝 modified
_autosummary/flexmeasures.data.models.forecasting.pipelines.predict.html 📝 modified
_autosummary/flexmeasures.data.models.forecasting.pipelines.train.html 📝 modified
_autosummary/flexmeasures.data.models.forecasting.pipelines.train_predict.html 📝 modified
_autosummary/flexmeasures.data.models.generic_assets.html 📝 modified
_autosummary/flexmeasures.data.models.html 📝 modified
_autosummary/flexmeasures.data.models.legacy_migration_utils.html 📝 modified
_autosummary/flexmeasures.data.models.planning.exceptions.html 📝 modified
_autosummary/flexmeasures.data.models.planning.html 📝 modified
_autosummary/flexmeasures.data.models.planning.process.html 📝 modified
_autosummary/flexmeasures.data.models.planning.storage.html 📝 modified
_autosummary/flexmeasures.data.models.planning.utils.html 📝 modified
_autosummary/flexmeasures.data.models.reporting.aggregator.html 📝 modified
_autosummary/flexmeasures.data.models.reporting.html 📝 modified
_autosummary/flexmeasures.data.models.reporting.pandas_reporter.html 📝 modified
_autosummary/flexmeasures.data.models.reporting.profit.html 📝 modified
_autosummary/flexmeasures.data.models.task_runs.html 📝 modified
_autosummary/flexmeasures.data.models.time_series.html 📝 modified
_autosummary/flexmeasures.data.models.user.html 📝 modified
_autosummary/flexmeasures.data.models.validation_utils.html 📝 modified
_autosummary/flexmeasures.data.schemas.account.html 📝 modified
_autosummary/flexmeasures.data.schemas.annotations.html ➖ deleted
_autosummary/flexmeasures.data.schemas.attributes.html 📝 modified
_autosummary/flexmeasures.data.schemas.forecasting.html 📝 modified
_autosummary/flexmeasures.data.schemas.forecasting.pipeline.html 📝 modified
_autosummary/flexmeasures.data.schemas.generic_assets.html 📝 modified
_autosummary/flexmeasures.data.schemas.html 📝 modified
_autosummary/flexmeasures.data.schemas.io.html 📝 modified
_autosummary/flexmeasures.data.schemas.locations.html 📝 modified
_autosummary/flexmeasures.data.schemas.reporting.aggregation.html 📝 modified
_autosummary/flexmeasures.data.schemas.reporting.html 📝 modified
_autosummary/flexmeasures.data.schemas.reporting.pandas_reporter.html 📝 modified
_autosummary/flexmeasures.data.schemas.reporting.profit.html 📝 modified
_autosummary/flexmeasures.data.schemas.scheduling.html 📝 modified
_autosummary/flexmeasures.data.schemas.scheduling.metadata.html 📝 modified
_autosummary/flexmeasures.data.schemas.scheduling.process.html 📝 modified
_autosummary/flexmeasures.data.schemas.scheduling.storage.html 📝 modified
_autosummary/flexmeasures.data.schemas.sensors.html 📝 modified
_autosummary/flexmeasures.data.schemas.sources.html 📝 modified
_autosummary/flexmeasures.data.schemas.times.html 📝 modified
_autosummary/flexmeasures.data.schemas.units.html 📝 modified
_autosummary/flexmeasures.data.schemas.users.html 📝 modified
_autosummary/flexmeasures.data.schemas.utils.html 📝 modified
_autosummary/flexmeasures.data.services.asset_grouping.html 📝 modified
_autosummary/flexmeasures.data.services.forecasting.html 📝 modified
_autosummary/flexmeasures.data.services.generic_assets.html 📝 modified
_autosummary/flexmeasures.data.services.job_cache.html 📝 modified
_autosummary/flexmeasures.data.services.time_series.html 📝 modified
_autosummary/flexmeasures.data.services.users.html 📝 modified
_autosummary/flexmeasures.data.transactional.html 📝 modified
_autosummary/flexmeasures.ui.views.accounts.html 📝 modified
_autosummary/flexmeasures.ui.views.assets.forms.html 📝 modified
_autosummary/flexmeasures.ui.views.assets.views.html 📝 modified
_autosummary/flexmeasures.ui.views.sensors.html 📝 modified
_autosummary/flexmeasures.ui.views.users.views.html 📝 modified
_autosummary/flexmeasures.utils.coding_utils.html 📝 modified
_autosummary/flexmeasures.utils.config_defaults.html 📝 modified
_autosummary/flexmeasures.utils.doc_utils.html 📝 modified
_autosummary/flexmeasures.utils.entity_address_utils.html 📝 modified
_autosummary/flexmeasures.utils.error_utils.html 📝 modified
_autosummary/flexmeasures.utils.grid_cells.html 📝 modified
_autosummary/flexmeasures.utils.html 📝 modified
_autosummary/flexmeasures.utils.unit_utils.html 📝 modified
api/change_log.html 📝 modified
api/introduction.html 📝 modified
api/v3_0.html 📝 modified
concepts/annotations.html ➖ deleted
concepts/data-model.html 📝 modified
dev/docker-compose.html 📝 modified
dev/setup-and-guidelines.html 📝 modified
views/asset-data.html 📝 modified

@nhoening nhoening changed the title first work on letting side-panels take no vertical space when closed Sensor page: Stop side-panels using vertical space when closed Mar 21, 2026
@nhoening
Copy link
Copy Markdown
Contributor Author

nhoening commented Apr 3, 2026

@copilot pleease continue work in this PR and work on the first three TODO items in feat/options-on-sensor-page-use-less-vertical-space-when-closed.

- TODO 1: Add CSS variables for z-index (--z-index-sidepanel, --z-index-sidepanel-label, --z-index-sidepanel-content) for a single global stacking index
- TODO 2: Rename classes throughout: sidepanels→sidepanel (wrapper), left-sidepanel-label→sidepanel-label, sidepanel+left-sidepanel→sidepanel-content in all HTML templates (sensors, accounts, assets) and base.html JS
- TODO 3: Move chart-type-picker and delete button outside the .sidepanel wrapper in sensors/index.html so they appear below the sidepanel tabs rather than interleaved
- Remove old commented-out CSS block and clean up CSS (fix // comments to /* */, remove nth-child hacks, use height:60px per container instead)

Agent-Logs-Url: https://github.com/FlexMeasures/flexmeasures/sessions/484168a2-b80f-49f1-99a2-016408ad5c2a

Co-authored-by: nhoening <1042336+nhoening@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

@copilot pleease continue work in this PR and work on the first three TODO items in feat/options-on-sensor-page-use-less-vertical-space-when-closed.

Done in commit 2899726. Here's what was addressed:

TODO 1 – Fix z-index, use one global stacking index: Added CSS custom properties (--z-index-sidepanel: 20, --z-index-sidepanel-label: 21, --z-index-sidepanel-content: 100) so z-index values are defined in one place and referenced consistently.

TODO 2 – Better class names: Renamed throughout all templates, CSS, and the JS in base.html:

  • sidepanels (outer wrapper) → sidepanel
  • left-sidepanel-labelsidepanel-label
  • sidepanel left-sidepanel (content) → sidepanel-content

TODO 3 – Accommodate chart dropdown and delete button: In sensors/index.html, wrapped only the sidepanel-container elements inside the .sidepanel div, and moved the chart-type picker and delete button outside/below that wrapper so they appear in normal document flow beneath the sidepanel tabs.

Also cleaned up the CSS: removed the old commented-out block, replaced nth-child top-offset hacks with a simple height: 60px per container, and restored the @media (hover: hover/none) rules for touch device support.

@nhoening
Copy link
Copy Markdown
Contributor Author

nhoening commented Apr 3, 2026

@copilot the z-index issue is still not working well in practice. .sidepanel-content is above its own .sidepanel-label and .sidepanel-container, but not above the other .sidepanel-containers.

Here is a possible explanantion:

This behavior usually happens when stacking contexts are created unintentionally, or when z-index values are scoped to different containers. Here’s why it might be happening and how to fix it:

Why This Happens:

Stacking Contexts: If a parent element (e.g., .sidepanel-container) has properties like opacity, transform, filter, or position: fixed/sticky, it creates a new stacking context. This means z-index values inside it are relative to that container, not the entire page.
If multiple .sidepanel-container elements exist, their z-index values are compared only within their own container, not globally.

z-index Scoping: Even if .sidepanel has a higher z-index than .left-sidepanel-label, if the label belongs to a different container with a higher z-index, it will appear on top.

One possible solution: If possible, place all elements inside a single parent container with position: relative. This ensures their z-index values are compared within the same stacking context.

Move z-index from .sidepanel-container to .sidepanel so all containers
share a single stacking context. Previously each .sidepanel-container
had position+z-index which created its own isolated stacking context,
causing .sidepanel-content (z-index:100) inside container N to be
covered by later containers whose z-index was evaluated in the same
parent context. Now .sidepanel is the stacking context, containers have
no z-index (so they don't isolate their children), and the open
sidepanel-content (z-index:100) correctly paints above all other
containers in the shared context.

Agent-Logs-Url: https://github.com/FlexMeasures/flexmeasures/sessions/4f095d33-daeb-4c8b-8d5e-dd641de3aa4c

Co-authored-by: nhoening <1042336+nhoening@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

@copilot the z-index issue is still not working well in practice. .sidepanel-content is above its own .sidepanel-label and .sidepanel-container, but not above the other .sidepanel-containers.

Here ...

Fixed in commit a6042c0. The root cause was exactly as described: .sidepanel-container had both position: relative and z-index: 20, which created an isolated stacking context per container. That meant .sidepanel-content's z-index: 100 was only compared within its own container's context — containers later in the DOM (with the same z-index: 20 in the parent context) still painted on top.

The fix moves the z-index from .sidepanel-container to .sidepanel:

  • .sidepanel now has position: relative; z-index: var(--z-index-sidepanel) — a single shared stacking context
  • .sidepanel-container keeps position: relative (so .sidepanel-label/.sidepanel-content still anchor to it) but has no z-index, so it doesn't isolate its children
  • .sidepanel-content at z-index: 100 within .sidepanel's shared context now correctly paints above all the z-index: auto containers, regardless of DOM order

Signed-off-by: F.N. Claessen <claessen@seita.nl>
Copy link
Copy Markdown
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot seems to be still lacking a way to reliably check the UX quality of its own work.

A few regressions I saw:

  • Gap between panel items [I fixed this]
  • Sliding animanition has now become a hard appear/disappear
  • "Last 7 days" and "Today and tomorrow" buttons fade lingers

@nhoening
Copy link
Copy Markdown
Contributor Author

nhoening commented Apr 5, 2026

Well, the UI specialist is being added in #1985, but I don't know how much that guy will add.

@nhoening
Copy link
Copy Markdown
Contributor Author

nhoening commented Apr 5, 2026

Copilot seems to be still lacking a way to reliably check the UX quality of its own work.

A few regressions I saw:

  • Gap between panel items [I fixed this]
  • Sliding animanition has now become a hard appear/disappear
  • "Last 7 days" and "Today and tomorrow" buttons fade lingers

@copilot can you look into the two open items here?

@Flix6x I also saw there were still some layout issues. I just wasn't in a hurry with it.

Replaces height+opacity approach with transform: translateX which:
1. Fixes the hard appear/disappear regression - height:0→auto cannot be
   animated by CSS; transform IS animatable, giving smooth slide
2. Fixes button fade lingers - removing opacity transition means litepicker
   preset buttons no longer have their hover-state CSS transitions layered
   over a parent opacity fade

Hidden state: transform: translateX(-106%) with visibility: hidden delayed
by 0.3s (waits for slide-out animation to complete before hiding from a11y)
Shown state: visibility flips visible immediately, then transform slides in

Agent-Logs-Url: https://github.com/FlexMeasures/flexmeasures/sessions/8ef4d9f6-dc4a-4ef2-bf72-46bba0b79a8b

Co-authored-by: nhoening <1042336+nhoening@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

Copilot seems to be still lacking a way to reliably check the UX quality of its own work.

A few regressions I saw:
...

Fixed in commit f3630cb. Both issues had the same root cause — the height+opacity animation approach I introduced:

Sliding animation → hard appear/disappear: CSS cannot animate height: 0 → height: auto (it snaps instantly). Restored the original transform: translateX(-106%)translateX(-30px) approach, which IS animatable and produces the smooth slide. The closing transition is transform 0.3s, visibility 0s 0.3s (visibility stays visible during the 0.3s slide-out, then hides). The opening transition is transform 0.3s, visibility 0s (visibility flips visible immediately, then slides in).

Button fade lingers: Removing opacity: 0 → 1 from the panel means litepicker preset buttons ("Last 7 days", "Today and tomorrow") no longer have their own hover-state CSS transitions layered on top of a parent opacity fade. The panel simply slides away, taking the buttons with it — no fade at all.

@Flix6x
Copy link
Copy Markdown
Contributor

Flix6x commented Apr 5, 2026

@Flix6x I also saw there were still some layout issues. I just wasn't in a hurry with it.

I know, but this kind of UI stuff is what I consider a fun activity when I have some time off. 🤭

@Flix6x
Copy link
Copy Markdown
Contributor

Flix6x commented Apr 5, 2026

My main issues are resolved now. I really like that the sensor page no longer scrolls vertically anymore on a desktop screen. My remaining list can be considered off scope:

  • The swipe action on touchscreens doesn't work (tested using ngrok), but the touch action still works, so no critical loss of functionality there.

  • The "Select chart" and "Delete this sensor" buttons should probably be styled like the other items, but this was a pre-existing condition and it also doesn't affect vertical spacing.

  • I think the ordering can be more logically grouped as:

    • First the two selection actions
    • Then the data action (soon two data actions, with forecasting)
    • Finally the two sensor actions

    But this will only make sense after these actions are all styled the same.

@Flix6x Flix6x added the UI label Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants