Skip to content

Improve object property panel tab selection behavior #271

@PierreRaybaut

Description

@PierreRaybaut

GitHub Issue: Improve object property panel tab selection behavior

Issue Type

🐛 Bug Fix / Enhancement

Title

Improve object property panel tab selection behavior

Description

Problem

The tab selection behavior in the object properties panel was confusing and unpredictable. When switching between objects, the selected tab would persist or change based on previous interactions, making it difficult to predict which tab would be shown.

Solution

Implemented a clearer, more predictable tab selection behavior:

  • Properties tab: Always shown by default when switching between objects
  • Creation tab: Appears automatically once after object creation, then reverts to Properties
  • Processing tab: Appears automatically once after 1-to-1 processing operations, then reverts to Properties
  • Analysis tab: Appears automatically once after analysis computation, then reverts to Properties

This provides consistent navigation while still highlighting relevant information when new data is generated.

Technical Details

Changes made:

  1. Added three public methods to ObjectProp class for marking objects:

    • mark_as_newly_created(obj) - for Creation tab
    • mark_as_freshly_processed(obj) - for Processing tab
    • mark_as_fresh_analysis(obj) - for Analysis tab
  2. Updated add_object() to prevent overwriting Processing/Analysis flags with Creation flag

  3. Modified selection_changed() to check flags in priority order and clear them after use

  4. Updated BaseProcessor to use new public methods instead of accessing private attributes

Benefits:

  • Cleaner API with proper encapsulation
  • Self-documenting method names
  • Better separation of concerns between panel and processor
  • Improved user experience with predictable tab behavior

Files Modified

  • datalab/gui/panel/base.py - Added marking methods, updated tab selection logic
  • datalab/gui/processor/base.py - Updated to use new marking API

Testing

Tested with:

  • Creating new signals/images → Creation tab shows once
  • Applying 1-to-1 processing (e.g., filters) → Processing tab shows once
  • Computing analysis results → Analysis tab shows once
  • Switching between objects → Properties tab shows consistently

Labels

  • bug
  • enhancement
  • gui
  • user-experience

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions