Skip to content

Enhance image browser, UI controls, and localization support - #30

Merged
swu4bnl merged 14 commits into
mainfrom
UI-tweak
Oct 19, 2026
Merged

swu4bnl merged 14 commits into
mainfrom
UI-tweak

Conversation

@swu4bnl

@swu4bnl swu4bnl commented Oct 19, 2026

Copy link
Copy Markdown
Owner

This pull request improves SciView’s image-browsing controls, adds shared appearance controls, and introduces context-rich interface message catalogs for language review and future translation. It also updates contributor guidance, streamlines test coverage, and improves Windows launcher reliability. The most important changes are grouped below.

Viewer layout and browsing:

  • Reorganized the image-viewer toolbar into navigation, overlays, output, and display controls using native grid layout and shared sizing tokens. Preserved visible toggle states and aligned the color controls with the toolbar. [1]
  • Improved folder browsing and playback, added compact speed indicators, and simplified tooltips without removing scientifically meaningful information. Updated the Reduction tab icon and fixed unwanted Tiled connection attempts when no saved session exists. [2]

Appearance and accessibility:

  • Added upper-right A− / A+ buttons with Ctrl− / Ctrl+ shortcuts and a separate high-contrast toggle. These reuse the existing typography scale and shared theme refresh rather than introducing a parallel styling system. High contrast supports light/dark switching and restores the preceding theme when disabled.
  • Updated plot annotation fonts and colors, corrected Qt font-weight mapping, and prevented stylesheet accumulation during repeated scaling. Enabled the Style Inspector through the I button or Ctrl+Shift+I by default; automatic file hot-reload remains opt-in. [3]

Localization and typography:

  • Centralized owned interface text in 14 English YAML catalogs with stable message IDs, neutral translator context, and named-placeholder metadata. Added catalog validation and Qt Linguist TS export while keeping machine values and scientific identifiers separate from translated text.
  • Added matching Simplified Chinese preview catalogs and developer-only locale selection. Configured shared Qt and Matplotlib font preferences, including scientific-symbol fallback and filtering of unavailable fonts. No user-facing language selector is introduced. [4]

Project guidance and testing:

  • Clarified backend/UI boundaries, beamline neutrality, shared styling ownership, and concise product language. Updated UI guidance to prioritize native layout contracts, existing components, visible interaction states, and proportionate changes.
  • Refocused retained tests on scientific correctness and stable workflows, removing redundant or temporary checks. Documented localization contracts and the shared UI architecture. [5]

Installation and validation:

  • Improved Windows launcher fallback handling and extended installation CI to exercise those paths. [6]
  • Validated the UI changes with 38 focused tests and native Windows checks across all eight tabs, including keyboard shortcuts, English/Chinese rendering, and theme restoration. Appearance settings remain session-only; Chinese remains a developer preview, and very large text sizes can crowd existing layouts.

- Added playback rates and default playback rate settings in app settings.
- Improved folder browser to keep track of previously added images in batch.
- Enhanced playback controls with speed cycling and updated UI elements.
- Refactored folder browsing logic to handle subfolders and recent folder paths.
- Updated tests to cover new functionality and ensure proper behavior of image browser and session manager.
Enhance image controls, installation checks, and fix launcher issues
- Updated project priorities and core rules in copilot instructions for maintainability and clarity.
- Revised testing instructions to emphasize coverage for scientific correctness and major workflows.
- Streamlined UI instructions to focus on compact, accessible controls and clear user guidance.
- Enhanced documentation on UI control architecture to prioritize user decisions and scientific precision.
- Consolidated AI collaboration guidelines to clarify working methods, design principles, and verification processes.
- Added new SVG assets for tool speeds and number indicators to improve UI representation.
- Removed redundant or low-value test cases from image browser tests to maintain lean test coverage.
- Introduced viewer toolbar groups for better organization of actions.
- Updated toolbar button creation to use a dictionary for cleaner code.
- Implemented a grid layout for the image viewer toolbar to align controls.
- Moved display controls for colormap and intensity scale to enhance visibility.
- Implemented a text handling module to manage message catalogs and translations.
- Introduced new translation files for the transform and viewer interfaces in English(United States) and Simplified Chinese (under development).
- Added unit tests to ensure the integrity of the localization and translation functionality.
- Enhanced error handling for missing or invalid message IDs and placeholders.
- Implement buttons for increasing and decreasing text size with shortcuts (Ctrl+- / Ctrl++).
- Add a high-contrast toggle button that integrates with the existing theme system.
- Update the AppStyle class to manage high-contrast colors and text scaling options.
- Enhance the style inspector and related documentation for clarity.
- Update localization files for new UI elements and actions.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T16:25:16.427140Z 5c77eaf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c77eaf920

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Colormap restoration and font-test portability remain unresolved.

2 open issues
What changed in this PR

Improves SciView’s shared image-viewer controls and establishes a localization layer for its scientific desktop interface.

Changes:

  • Groups viewer tools, adds playback defaults, and updates icons.
  • Adds validated message catalogs, Chinese previews, and Qt translation export.
  • Updates workflow tests and contributor guidance.
File Description
tests/​test_ui_messages.py Adds localization and font contract tests.
tests/​test_image_viewer.py Updates browser workflow coverage.
src/​sciview/​settings/​viewer_config.py Defines toolbar groups and message IDs.
src/​sciview/​settings/​app_settings.py Adds playback-rate defaults.
src/​sciview/​interfaces/​theme/​assets/​tool_speed_3.svg Adds fast-speed icon.
src/​sciview/​interfaces/​theme/​assets/​tool_speed_2.svg Adds medium-speed icon.
src/​sciview/​interfaces/​theme/​assets/​tool_speed_1.svg Adds slow-speed icon.
src/​sciview/​interfaces/​theme/​assets/​tool_contrast.svg Adds contrast icon.
src/​sciview/​interfaces/​theme/​assets/​tab_reduction.svg Updates Reduction tab icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-9.svg Adds candidate numeral icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-8.svg Adds candidate numeral icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-7.svg Adds candidate numeral icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-6.svg Adds candidate numeral icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-5.svg Adds candidate numeral icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-4.svg Adds candidate numeral icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-3.svg Adds candidate numeral icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-2.svg Adds candidate numeral icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-100-small.svg Adds compact numeric icon candidate.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-10.svg Adds candidate numeric icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-1.svg Adds candidate numeral icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​number-0.svg Adds candidate numeral icon.
src/​sciview/​interfaces/​theme/​assets/​Candidates/​graph.svg Adds candidate graph icon.
src/​sciview/​interfaces/​text.py Loads, validates, and translates messages.
src/​sciview/​interfaces/​stable_qt/​widgets/​image_viewer.py Groups tools and updates display handling.
src/​sciview/​interfaces/​stable_qt/​utils/​resource_monitor.py Localizes resource readouts.
src/​sciview/​interfaces/​stable_qt/​utils/​reduction_overlay.py Localizes angle-convention text.
src/​sciview/​interfaces/​stable_qt/​utils/​image_utils.py Localizes validation and removes forced collection.
src/​sciview/​interfaces/​locales/​zh-CN/​viewer.yaml Adds Chinese viewer messages.
src/​sciview/​interfaces/​locales/​zh-CN/​style_inspector.yaml Adds Chinese inspector messages.
src/​sciview/​interfaces/​locales/​zh-CN/​shell.yaml Adds Chinese application messages.
src/​sciview/​interfaces/​locales/​zh-CN/​resource_monitor.yaml Adds Chinese resource messages.
src/​sciview/​interfaces/​locales/​zh-CN/​reduction.yaml Adds Chinese reduction messages.
src/​sciview/​interfaces/​locales/​zh-CN/​image_utils.yaml Adds Chinese validation messages.
src/​sciview/​interfaces/​locales/​zh-CN/​image_browser.yaml Adds Chinese browsing messages.
src/​sciview/​interfaces/​locales/​zh-CN/​calibration.yaml Adds Chinese calibration messages.
src/​sciview/​interfaces/​locales/​zh-CN/​batch.yaml Adds Chinese batch messages.
src/​sciview/​interfaces/​locales/​zh-CN/​base_image.yaml Adds Chinese shared-image messages.
src/​sciview/​interfaces/​locales/​en-US/​viewer.yaml Defines English viewer messages.
src/​sciview/​interfaces/​locales/​en-US/​style_inspector.yaml Defines English inspector messages.
src/​sciview/​interfaces/​locales/​en-US/​shell.yaml Defines English application messages.
src/​sciview/​interfaces/​locales/​en-US/​resource_monitor.yaml Defines English resource messages.
src/​sciview/​interfaces/​locales/​en-US/​reduction.yaml Defines English reduction messages.
src/​sciview/​interfaces/​locales/​en-US/​image_utils.yaml Defines English validation messages.
src/​sciview/​interfaces/​locales/​en-US/​image_browser.yaml Defines English browsing messages.
src/​sciview/​interfaces/​locales/​en-US/​calibration.yaml Defines English calibration messages.
src/​sciview/​interfaces/​locales/​en-US/​batch.yaml Defines English batch messages.
src/​sciview/​interfaces/​locales/​en-US/​base_image.yaml Defines English shared-image messages.
src/​sciview/​interfaces/​export_translations.py Exports catalogs for Qt Linguist.
src/​sciview/​dev/​style_inspector.py Localizes inspector controls and messages.
pyproject.toml Includes catalogs in package data.
docs/​UI_CONTROL_ARCHITECTURE.md Documents shared controls and styling ownership.
docs/​simplified-technical-english.optional.md Clarifies concise scientific wording.
docs/​LOCALIZATION.md Documents translation workflows and boundaries.
docs/​ai-collaboration-guidelines.md Streamlines collaboration guidance.
.github/​skills/​sciview-ui-tweaks/​SKILL.md Updates layout and verification guidance.
.github/​instructions/​sciview-ui.instructions.md Clarifies interface conventions and scope.
.github/​instructions/​sciview-tests.instructions.md Refines test-retention guidance.
.github/​copilot-instructions.md Consolidates project development boundaries.

Review effort: Balanced

Comment thread tests/test_ui_messages.py Resolved
- Bundle Source Sans 3 and Noto Sans CJK SC regular/bold fonts with licenses
- Register bundled fonts with Qt and Matplotlib independently of host fonts
- Rebase default typography so the former 150% size becomes 100%
- Replace intermediate numeric weights with native regular/bold styling
- Restore heading-sized tab text and reduce calibration panel headings
- Fix colormap restoration after RGB/RGBA-to-scalar image transitions
- Update font documentation and regression coverage
- Add benchmarking tool and tests

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The broad Qt, typography, and localization changes require human confirmation of cross-platform rendering and integration behavior.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@swu4bnl
swu4bnl merged commit da7b433 into main Oct 19, 2026
3 checks passed
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