Skip to content

Comments

Add ProgressScope/ProgressPercentage helpers and QFuture migration roadmap#542

Draft
Copilot wants to merge 5 commits intodevfrom
copilot/improve-progress-info-system
Draft

Add ProgressScope/ProgressPercentage helpers and QFuture migration roadmap#542
Copilot wants to merge 5 commits intodevfrom
copilot/improve-progress-info-system

Conversation

Copy link

Copilot AI commented Dec 27, 2025

The progress info system lacked modern convenience APIs and guidance for QFuture integration.

Changes

New Helper Classes

ProgressScope - RAII-based progress tracking:

// Before: manual progress management
caf::ProgressInfo progress(100, "Processing");
for (int i = 0; i < 100; i++) {
    progress.setProgress(i);
    doWork();
}

// After: automatic lifecycle management
caf::ProgressScope progress(100, "Processing");
for (const auto& item : items) {
    if (progress.isCancelled()) break;
    doWork();
    progress.increment();
}

ProgressPercentage - Natural percentage-based API:

caf::ProgressPercentage progress("Loading");
progress.setPercentage(50.0);  // Direct percentage instead of arbitrary max values

Documentation

  • Comprehensive Doxygen documentation for all classes with usage examples
  • doc/ProgressInfoDesign.md: Architecture analysis and phased QFuture migration strategy
  • doc/ProgressInfoExamples.md: 370+ lines of practical patterns for common scenarios
  • Thread safety constraints and workarounds documented inline

Testing

  • 16 unit tests covering existing functionality, new helpers, and edge cases
  • Added to cafUserInterface_UnitTests build target

QFuture Integration

Design document provides phased approach:

  • Phase 1 (this PR): Usability improvements and documentation
  • Phase 2 (future): Thread-safe wrapper using signals/slots
  • Phase 3 (future): Optional QFuture-based parallel API with gradual migration

Rationale: Existing API is widely used across codebase. Parallel API approach maintains stability while enabling future modernization.

Backward Compatibility

Zero breaking changes. All existing code continues to work unchanged.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • community.opengroup.org
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin REDACTED -fasynchronous-unwind-tables clon�� in.so /lto-wrapper u/13/cc1 --depth 2 REDACTED u/13/cc1 conf�� get --local s credential.userngit (dns block)
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin REDACTED git conf�� get o /home/REDACTED/.local/bin/git nctionExists.c.oas (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Improve progress info</issue_title>
<issue_description>Progress is managed by https://github.com/magnesj/ResInsight/blob/dev/Fwk/AppFwk/cafUserInterface/cafProgressInfo.h

Suggest improvements to the progress info system.

Consider moving to QFuture.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits December 27, 2025 08:45
…nd helper classes

Co-authored-by: magnesj <1793152+magnesj@users.noreply.github.com>
Co-authored-by: magnesj <1793152+magnesj@users.noreply.github.com>
Co-authored-by: magnesj <1793152+magnesj@users.noreply.github.com>
Co-authored-by: magnesj <1793152+magnesj@users.noreply.github.com>
Copilot AI changed the title [WIP] Suggest improvements to progress info system Add ProgressScope/ProgressPercentage helpers and QFuture migration roadmap Dec 27, 2025
Copilot AI requested a review from magnesj December 27, 2025 08:49
@magnesj
Copy link
Owner

magnesj commented Dec 27, 2025

test this

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.

Improve progress info

2 participants