Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof tree filters not applied correctly #3367

Closed
WolframPfeifer opened this issue Dec 1, 2023 · 8 comments · Fixed by #3368
Closed

Proof tree filters not applied correctly #3367

WolframPfeifer opened this issue Dec 1, 2023 · 8 comments · Fixed by #3368
Assignees

Comments

@WolframPfeifer
Copy link
Member

Description

The filters in the proof tree ("Hide Intermediate Proofsteps" etc.) are not applied correctly, at least in the case of a freshly started proof.

Reproducible

always

Steps to reproduce

  1. Start any proof and apply some rules or macros to it.
  2. Select "Hide Intermediate Proofsteps" in the proof tree settings (gear wheel).

I would expect that the intermediate proof steps are filtered out. However, the proof tree stays as it is (no filters applied).
Furthermore, if the menu is opened again, the checkbox is not ticked.

Additional information

  • By bisecting, I found the first bad commit: 3ab8750.
  • The problem seems to have something to do with the focus: At least in my testing, it only happened in freshly started proofs. If multiple proofs are present, after switching between them, the filters work fine.
@WolframPfeifer
Copy link
Member Author

@mi-ki I think this is the issue you mentioned to me yesterday, right?

@WolframPfeifer
Copy link
Member Author

@unp1 The commit that introduced this problem is 3ab8750. It seems that you tried to do some refactoring here ...

@unp1 unp1 self-assigned this Dec 1, 2023
@unp1
Copy link
Member

unp1 commented Dec 1, 2023

Will look into it (but first next week)

@unp1
Copy link
Member

unp1 commented Dec 1, 2023

See PR #3368.

The root cause was not the commit itself, but it unearthed an inconsistency between two places where node selections are stored.

@unp1
Copy link
Member

unp1 commented Dec 1, 2023

We might think about removing the additional selection storage from the model and instead have a wrapper record like

ProofTreeViewState(GUIProofTreeModel model, TreePath selectionPath, Filter[] activeFilters)

and then storing this record in the hashmap when switching proofs.

This change would avoid accidental usage of the selection stored in the model and it would allow us to have proof local filter settings. But that would change current behavior and we would need to be fine with it. The current PR just restores previous behavior.

@unp1
Copy link
Member

unp1 commented Dec 1, 2023

See PR #3369 for an implementation of the suggestion. It builds on top of PR #3368

@mi-ki
Copy link
Member

mi-ki commented Dec 1, 2023

@mi-ki I think this is the issue you mentioned to me yesterday, right?

@WolframPfeifer Yes, you are right, thanks for looking into it!

@unp1
Copy link
Member

unp1 commented Dec 2, 2023

Brief report on status of PR #3368 and #3369.

Both PRs contain the same refactorings as well as the (unrelated) bugfixes

  • for updating the sequentview when pretty printing options are modified
  • for a NullPointerException that occurred when closing the Proof Obligation Browser via Cancel when no proof (at all) was loaded in the GUI.
  • reduce updates of sequent view when changing view settings: changing a view setting propagated a PropertyChangeEvent causing unrelated properties to trigger their own redraw update just in case

#3369 changes proof tree filters to proof local filters and #3368 does not

Both are finished from my side (of course, feedback from code reviews will be incorporated). The semantics to be used is up for discussion, but as @WolframPfeifer prefers and has actual use cases for #3368, we might want to stay with that semantics and not too optimize for some imaginery unknown user :-)

@unp1 unp1 changed the title ProofTree filters not applied correctly Proof tree filters not applied correctly Dec 3, 2023
wadoon added a commit to wadoon/key that referenced this issue Dec 28, 2023
* origin/main: (25 commits)
  bug fix
  applying spotless
  Configurable enabled keys for JML condition evaluation
  Spotless cleanups
  Fix selection highlight for OSS node child
  Remove unnecessary checks for correct change as listener is now registered correctly only for changes of interest
  Make usage of PropertyChangeListeners working (addendum to previous commit)
  Reduce number of sequentview updates
  Remove duplicate update of sequentview
  USe refactorings from KeYProject#3369 but preserve non-local filter semantics for proof tree view
  MainWindow updates sequent view after settings change for pretty printing
  Minor clean up to slightly simplify complexity of path selection in ProofTreeView
  Fix problem with closed subtree filter
  Fix node filter selection display in popup dialoh and some refactoring
  Restore correct node selection and remove unused fields from GUIProofTreeModel
  Store ProofTreeViewSettings per proof outside model and restore all settings upon switching
  Fix update of proof tree in case of filter changes (fixes KeYProject#3367)
  applying spotless
  Bump com.miglayout:miglayout-swing from 11.2 to 11.3
  Configurable enabled keys for JML condition evaluation
  ...
wadoon added a commit that referenced this issue Dec 29, 2023
* origin/main: (25 commits)
  bug fix
  applying spotless
  Configurable enabled keys for JML condition evaluation
  Spotless cleanups
  Fix selection highlight for OSS node child
  Remove unnecessary checks for correct change as listener is now registered correctly only for changes of interest
  Make usage of PropertyChangeListeners working (addendum to previous commit)
  Reduce number of sequentview updates
  Remove duplicate update of sequentview
  USe refactorings from #3369 but preserve non-local filter semantics for proof tree view
  MainWindow updates sequent view after settings change for pretty printing
  Minor clean up to slightly simplify complexity of path selection in ProofTreeView
  Fix problem with closed subtree filter
  Fix node filter selection display in popup dialoh and some refactoring
  Restore correct node selection and remove unused fields from GUIProofTreeModel
  Store ProofTreeViewSettings per proof outside model and restore all settings upon switching
  Fix update of proof tree in case of filter changes (fixes #3367)
  applying spotless
  Bump com.miglayout:miglayout-swing from 11.2 to 11.3
  Configurable enabled keys for JML condition evaluation
  ...

# Conflicts:
#	key.ui/build.gradle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants