Skip to content

Add double-click focus mode for image layers - #243

Open
cornhundred wants to merge 2 commits into
mainfrom
codex/add-double-click-functionality-for-image-focus
Open

Add double-click focus mode for image layers#243
cornhundred wants to merge 2 commits into
mainfrom
codex/add-double-click-functionality-for-image-focus

Conversation

@cornhundred

Copy link
Copy Markdown
Collaborator

Summary

  • add an observable for the currently focused image layer
  • handle double-clicking image layer buttons to focus or clear focus
  • update UI controls to disable non-focused image buttons and sliders and sync layer visibility

Testing

  • npm run test:js

https://chatgpt.com/codex/tasks/task_b_68f0f8a460f8832a89eb25bd95627ebf

@cornhundred

Copy link
Copy Markdown
Collaborator Author

Add double-click focus mode for image layers

Double-clicking an image-layer button now isolates that layer: it becomes
the only visible image layer and the only interactive button/slider.
Double-clicking the focused layer again exits focus mode and restores all
layers.

Changes

  • New focused_image_layer observable in the obs store
  • text_buttons.js: dblclick handler on image-layer buttons that toggles
    focus; single-click callback no-ops while focus is active
  • ui_containers.js: sync_image_layer_controls() centralizes button/slider/
    visibility state for both normal and focused modes; switches to
    toggle_visibility_single_image_layer for per-layer control
  • switch_dataset.js: clear focus mode when switching datasets, so a focused
    layer name from the previous dataset can't disable all image buttons

Notes

  • Merged latest main (image-layer refactor + dataset switching). The only
    conflict was an additive one in obs_store.js; resolved by keeping both
    sets of new observables.
  • Rebuilt the distributed docs/assets/js/celldega.js bundle.
  • Verified: ESLint clean, jest passes, node build.js succeeds.

Known follow-up (non-blocking)

  • A dblclick fires two click events first, so entering focus mode runs the
    single-click image callback twice (state nets out, but triggers redundant
    deck refreshes). Could be smoothed with a click-suppress timer.
  • No visual hint that double-click focuses a layer; a tooltip/title on the
    image buttons would aid discoverability.

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.

1 participant