From 9bde494e1ce6ec3157de81536e300b9440eed1d4 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Mon, 3 Aug 2026 10:04:58 -0700 Subject: [PATCH 1/3] Keep Show3D export playback cache silent --- js/show3d/index.tsx | 14 +++++++++++++- src/quantem/widget/show3d.py | 2 ++ tests/test_show3d_pages.py | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/js/show3d/index.tsx b/js/show3d/index.tsx index 6fc4d5f8..b74f82cd 100644 --- a/js/show3d/index.tsx +++ b/js/show3d/index.tsx @@ -3129,7 +3129,19 @@ function Show3D() { u8: Uint8Array; } | null>(null); const [sidecarRamReady, setSidecarRamReady] = React.useState(false); - const [offlineStackFetchStatus, setOfflineStackFetchStatus] = React.useState(""); + const [offlineStackFetchStatus, setOfflineStackFetchStatusVisible] = React.useState(""); + // A display cache is an internal playback optimization, not report UI. In + // particular, updating a visible cache counter during its build causes extra + // React work precisely while the browser is preparing a smooth scrub/play + // path. Keep genuine sidecar-load messages and errors, but make all cache + // work silent and clear any preceding load message as it begins. + const setOfflineStackFetchStatus = React.useCallback((status: string) => { + if (/(?:display|playback) cache/i.test(status)) { + setOfflineStackFetchStatusVisible(""); + return; + } + setOfflineStackFetchStatusVisible(status); + }, []); const sidecarMode = Boolean( (offlineStackUrl || "").trim() && !(offlineStackTrait && offlineStackTrait.byteLength > 0), diff --git a/src/quantem/widget/show3d.py b/src/quantem/widget/show3d.py index 2625ae22..7ea4e749 100644 --- a/src/quantem/widget/show3d.py +++ b/src/quantem/widget/show3d.py @@ -4167,6 +4167,8 @@ def state_dict(self) -> dict: "debug": self.debug, "show_controls": self.show_controls, "controls_collapsed": self.controls_collapsed, + "hideable": self.hideable, + "hidden_indices": list(self.hidden_indices), "max_cols": self.max_cols, "panel_gap": self.panel_gap, "inter_panel_gap_px": int(self.inter_panel_gap_px), diff --git a/tests/test_show3d_pages.py b/tests/test_show3d_pages.py index cda7ad81..440f5a65 100644 --- a/tests/test_show3d_pages.py +++ b/tests/test_show3d_pages.py @@ -134,6 +134,22 @@ def test_show3d_paged_state_and_html_roundtrip(tmp_path: pathlib.Path) -> None: assert "data-show3d-tool-controls" in html +def test_show3d_html_export_preserves_frame_hide_actions(tmp_path: pathlib.Path) -> None: + """A portable report keeps the scrubber's hide-frame affordance.""" + widget = Show3D( + np.zeros((4, 8, 8), dtype=np.float32), + hideable=True, + verbose=False, + ) + widget.hide(2) + + out = widget.export_html(tmp_path / "hideable.html", encoding="uint8") + html = out.read_text().replace(" ", "").replace("\n", "") + + assert '"hideable":true' in html + assert '"hidden_indices":[2]' in html + + def test_show3d_paged_to_show2d_uses_current_visible_page() -> None: widget = Show3D( _paged_stack(), From 539efe3d32703c6d53c58b2f5e5f870ac4d56b33 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sat, 8 Aug 2026 12:17:59 -0700 Subject: [PATCH 2/3] docs: add framework citation guidance --- README.md | 9 +++++++++ docs/intro.md | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index d76d7e1e..1c8b7e10 100644 --- a/README.md +++ b/README.md @@ -276,6 +276,15 @@ The source tutorial notebooks live in [`docs/tutorials`](docs/tutorials). They can be opened directly in Colab. To make a GitHub-readable preview copy, see [`docs/github-preview.md`](docs/github-preview.md). +## Citing quantem.widget + +If the quantEM interactive framework—including `quantem.widget`, GPU-accelerated +I/O, analysis, or reconstruction workflows on MPS or CUDA—contributed to your +research, please consider citing Lee et al., *Interactive Framework for +Real-Time 4DSTEM Analysis and Reconstruction*, *Microscopy and Microanalysis* +32 (Supplement 1), ozag053.941 (2026), +https://doi.org/10.1093/mam/ozag053.941. + ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, checks, widget export diff --git a/docs/intro.md b/docs/intro.md index c3b550bb..db32494f 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -92,6 +92,15 @@ full-resolution data would be too large for public sharing. See [Installation](install) to get started. +## Citing quantem.widget + +If the quantEM interactive framework—including `quantem.widget`, GPU-accelerated +I/O, analysis, or reconstruction workflows on MPS or CUDA—contributed to your +research, please consider citing Lee et al., *Interactive Framework for +Real-Time 4DSTEM Analysis and Reconstruction*, *Microscopy and Microanalysis* +32 (Supplement 1), ozag053.941 (2026), +https://doi.org/10.1093/mam/ozag053.941. + ## Getting help - **Questions or bugs:** open an issue at From f89989425c7973a8896d5b102cf6ac6c6a4646f7 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sat, 8 Aug 2026 12:21:17 -0700 Subject: [PATCH 3/3] docs: simplify PR workflow attribution --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1c8b7e10..25d03cd0 100644 --- a/README.md +++ b/README.md @@ -290,8 +290,8 @@ https://doi.org/10.1093/mam/ozag053.941. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, checks, widget export expectations, agent signoff, and release-candidate guidance. -This repository follows the -[scikit-package](https://scikit-package.github.io/scikit-package/) standards +Pull request workflows follow the +[scikit-package](https://scikit-package.github.io/scikit-package/) procedures for reproducible scientific software: issue-first development (a PR closes a GitHub issue that states the problem), one small themed PR per issue, Conventional Commit-style messages, NumPy-style docstrings, self-reviewed @@ -302,11 +302,7 @@ we squash-merge, so branch tidiness costs nothing). Human contributors and coding agents/LLMs alike should apply these standards when writing code, commits, issues, and PRs. This README is the canonical policy source; the [pull request template](.github/PULL_REQUEST_TEMPLATE.md) turns the policy -into an operational checklist. Reference: S. Lee, C. Myers, A. Yang, -T. Zhang, Y. Xiao, and -S. J. L. Billinge, *Digital Discovery*, 2026, -[doi:10.1039/d6dd00121a](https://doi.org/10.1039/d6dd00121a). For Git/GitHub -tutorials and workflow onboarding, see +into an operational checklist. For Git/GitHub tutorials and workflow onboarding, see [ophusgroup/dev](https://github.com/ophusgroup/dev). ### Policy map