Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .claude/hooks/session-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ python -m pip install --upgrade --ignore-installed setuptools wheel || true
# Editable install with the same extras CI uses. Editable + plain `install`
# (not `ci`-style clean installs) so the resolved deps are cached in the
# container image for later sessions.
pip install -e ".[pyscf,ase,dev,xtb]"
#
# `python -m pip`, not bare `pip`: in the cloud image `pip` is /usr/bin/pip
# (the distro Python) while `python` is /usr/local/bin/python. The setuptools
# upgrade above targets `python`, so a bare `pip` install used the distro
# setuptools and failed to build pyscf-properties, which left the session
# with nothing installed.
python -m pip install -e ".[pyscf,ase,dev,xtb]"

echo "QuantUI cloud env ready: package + [pyscf,ase,dev,xtb] installed." >&2

Expand Down
12 changes: 10 additions & 2 deletions quantui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3564,8 +3564,16 @@ def _apply_plotly_theme(self, fig) -> None:
plot_bgcolor="rgba(0,0,0,0)",
paper_bgcolor="rgba(0,0,0,0)",
font=dict(color=tc["font_color"]),
xaxis=dict(gridcolor=tc["grid_color"]),
yaxis=dict(gridcolor=tc["grid_color"]),
xaxis=dict(
gridcolor=tc["grid_color"],
linecolor=tc["axis_line_color"],
zerolinecolor=tc["axis_line_color"],
),
yaxis=dict(
gridcolor=tc["grid_color"],
linecolor=tc["axis_line_color"],
zerolinecolor=tc["axis_line_color"],
),
)

def _set_html_output(self, out: widgets.Output, html: str) -> None:
Expand Down
4 changes: 4 additions & 0 deletions quantui/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,10 @@ def plotly_colors(palette_id: str) -> dict:
"paper_bgcolor": palette.page_bg,
"font_color": palette.text_strong,
"grid_color": palette.border,
# Axis and zero lines: one step stronger than the grid, so they stay
# visible on dark palettes (the plotly_white default is a pale
# blue-gray meant for white backgrounds).
"axis_line_color": palette.border_strong,
"scene_bgcolor": "#000000" if palette.is_dark else "#ffffff",
}

Expand Down
3 changes: 3 additions & 0 deletions tests/test_theme_contrast.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ def test_plotly_colours_track_palette(self, palette_id):
palette = theme.get_palette(palette_id)
assert colours["plot_bgcolor"] == palette.bg_panel
assert colours["paper_bgcolor"] == palette.page_bg
# Axis/zero lines follow the palette too (M-THEME), not the
# plotly_white template's pale default.
assert colours["axis_line_color"] == palette.border_strong


class TestBordersMeetContrastBar:
Expand Down
Loading