After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 616589 - Make display show entered number for currently selected tracker only
Make display show entered number for currently selected tracker only
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: gnome-sudoku
trunk
Other Linux
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-23 04:45 UTC by Robert Ancell
Modified: 2010-05-25 01:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Tracker Overhaul (63.41 KB, patch)
2010-05-08 18:27 UTC, Jim Ross
needs-work Details | Review
Tracker Tracker Tracker Tracker buttons (15.69 KB, image/jpeg)
2010-05-10 02:37 UTC, Jim Ross
  Details
Tracker Overhaul - with apply (76.44 KB, patch)
2010-05-14 01:02 UTC, Jim Ross
none Details | Review
Tracker Overhaul - better look for tracker ui (87.34 KB, patch)
2010-05-24 23:12 UTC, Jim Ross
committed Details | Review
Fix showing tracker to bold always (1.33 KB, patch)
2010-05-25 01:37 UTC, Jim Ross
committed Details | Review

Description Robert Ancell 2010-04-23 04:45:17 UTC
Currently the display shows the non-tracker numbers, the notes and the combination of all the trackers.

It would be better to show the non-tracker numbers and the number on the *currently selected* tracker.  This way you could compare two trackers by clicking between them.

The tracker buttons would just be add and remove then.
Comment 1 Jim Ross 2010-05-08 18:27:48 UTC
Created attachment 160601 [details] [review]
Tracker Overhaul

This patch is an overhaul of the trackers.  It seems like this is how trackers were intended to work in the first place but somehow didn't get implemented this way.  This patch also addresses the issues where notes aren't tied to trackers - Bug 616460.   The two issues so closely related that I thought it would be better to do them at the same time.

Untracked values and notes are always displayed.  When a tracker is selected, you can enter values and notes for that tracker and they'll be color coded for the tracker.  Adding or selecting another tracker hides all of the values of the currently viewed tracker and allows you to enter values/notes for the newly selected one.  Flipping back and forth between trackers lets you easily compare them.  A new button is added to the tracker ui - Hide Tracker.  This allows you to hide the currently viewed tracker and only show untracked values/notes.  The "Track Additions" toggle is hooked up to use this, so toggling it off will hide the currently viewed tracker and toggling it back on will show the last tracker view.

Selecting "No Tracker" keeps the last tracker visible and allows you to input untracked numbers.  I made it so that you can input the same value that is being tracked.  This allows a player to commit values from a tracker without having to delete the value first.  Entering an untracked value causes any trace for that cell to be removed from all trackers.  Basically, you can only track values on empty cells.

I created a new file tracker_info.py.  It implements the TrackerInfo class which is a singleton state machine for the tracker ui.  It stores the tracked values as well as the currently selected and currently viewed tracker id.  There are some utility functions for coloring as well.

Storage for notes has been changed from a text string to a list that ties each note to a tracker(NumberBox.top_note_list and bottom_note_list) This was done to allow for indiviual note tracking and coloring.  NumberBox.update_notelist() maintains the new lists and NumberBox.get_note_display() parses them for display.

The undo mechanism was causing a bit of grief while I was working on this.  It was the whole remove/add sequence when a something is modified that just wasn't working for me.  It has been changed so that modifying a value simply does an add.  No more double undoing just to get back to the last number.  When undo adds a tracked value - the tracker selection is changed automatically so the adds aren't hidden.

One quirk that popped up was the inability to tell if a value was being tracked when it is in conflict.  It was just painting the value red.  It was really confusing to not be able to tell if a conflicting number was tracked or untracked, so I highlight tracked conflicts a litle differently.  They're still painted red, but I added shadow that is colored for their tracker.

The new tracker data is saved under different keys.  The keys 'tracked_notes' and 'tracker_info' are used instead of 'notes', 'trackers', and 'tracking'.  saver.open_game() is backwards compatible with the old keys so old games can load into the new structures, but jar_game() only stores the new keys.

I've been playing around with this mod for a couple of weeks now and I think I have most of the bugs shaken out of it.  I solved this moster puzzle last night using 6 trackers and it was really just awesome, so I figured it was probably time to post the patch.  It makes the trackers much more useful to the player.  The only thing that I know is really missing is an update to the help file.
Comment 2 Robert Ancell 2010-05-09 10:05:05 UTC
Review of attachment 160601 [details] [review]:

I think the "hide tracker" behaviour needs some work.

There's an inconsistency between clicking "hide tracker" and "no tracker" - the both show the same state in the tracker panel but the behaviour is different (the first one shows coloured numbers where the second one does not).

The feature you've identified is to be able to enter black numbers while using trackers.
Suggested method:
- Set the number colour based on the tracker selected - "no tracker" enters black numbers.
- Add an "Apply tracker" button that takes the numbers in the currently selected tracker and converts them to black numbers (and deletes the tracker).

I also think we should replace "clear tracker" with "remove tracker" - it's just as easy to remove and add a new tracker and currently there is no way to remove obsolete trackers.
Comment 3 Jim Ross 2010-05-10 01:56:50 UTC
> I think the "hide tracker" behaviour needs some work.
> 
> There's an inconsistency between clicking "hide tracker" and "no tracker" - the
> both show the same state in the tracker panel but the behaviour is different
> (the first one shows coloured numbers where the second one does not).

I did it this way on purpose.  There are times when I need to enter untracked notes while referring to a tracker.  For example, when you narrow down that one value can only be in 2 cells in a box.  Switching to no tracker lets you do this.  Also, there are times where you get a clue that allows you to solve a large portion of cells(but not the whole grid).  When this happens, its useful to be able to hide that tracker and fill out what you can for the solution.  Afterwards - it is sometimes useful to take another look at that tracker.  I guess what I'm saying is I like being able to hide and come back to a tracker.  

How bout this.  It might be more clear if we change "No Tracker" to "Untracked".

Also, it wouldn't be a bad idea to make a distinction between the TrackerInfo variables selected_tracker and showing_tracker.  The selected_tracker is exactly that - whichever option in the list the player selects including "Untracked".  Whereas, showing_tracker holds the last actual tracker selected so that it can remain visible while entering untracked values.  This one gets set to "Untracked" when the Hide button is pressed.  If we highlight the showing_tracker on the list - would that be better?  Maybe with an arrow, underline or some other kind of marking.

> The feature you've identified is to be able to enter black numbers while using
> trackers.
> Suggested method:
> - Set the number colour based on the tracker selected - "no tracker" enters
> black numbers.

This is the way it works now.

> - Add an "Apply tracker" button that takes the numbers in the currently
> selected tracker and converts them to black numbers (and deletes the tracker).

I like this "Apply tracker" idea.  I was thinking of this while building it.  My idea was for a commit tracker button, but apply tracker sounds lessqlish  :)

> I also think we should replace "clear tracker" with "remove tracker" - it's
> just as easy to remove and add a new tracker and currently there is no way to
> remove obsolete trackers.

This sounds good to me too.
Comment 4 Jim Ross 2010-05-10 02:37:55 UTC
Created attachment 160678 [details]
Tracker Tracker Tracker Tracker buttons

hmm.  I just added the new button, and I don't know why this just struck me as odd, but there's a lot of tracker going on there.  Add Tracker, Remove Tracker...maybe its that last one that threw it over the edge but I swear all I see now is Tracker Tracker Tracker Tracker.  Should we change this to just be

Add
Remove
Hide
Apply
Comment 5 Robert Ancell 2010-05-13 15:53:45 UTC
Completely agree with dropping the duplicate "tracker"s :)

The behaviour still feels too complex to me.  Clicking on "Tracker 1" then "No tracker" shows no change in the grid which feels like the TreeView is broken.

The case you've indicated is "see the tracker but enter as non-tracked".  Perhaps this can be solved by:
- Adding a toggle button - "use tracker"?
- Clicking on a tracker toggles the writing mode, with the colour at half strength when numbers are entered non-tracked?

I'm not coming up with any good suggestions here.  How important is this feature?  Could you test playing without hide tracker and see how much of a difference it makes?
Comment 6 Jim Ross 2010-05-14 01:02:04 UTC
Created attachment 161017 [details] [review]
Tracker Overhaul - with apply

Here's a new version of the patch.

The Clear Tracker button has been changed to Remove.  An Apply button has been added.  I also modified the Tracker tree to say Untracked instead of No Tracker - and changed it so that the showing tracker is underlined when the player selects Untracked.  So Untracked will be selected and the Tracker will be underlined - kind of like a dual selection on the tree.  

On the suggestion for - Adding a toggle button - "use tracker"...there is a toggle that does this already - the "Track Additions" toggle.  When this one is toggled off - the tracker UI is hidden, any tracker the player is showing is hidden, and the player can enter Untracked values.

I also made some fixes to the note lists.

As far as how important this mod is?  Being able to switch views between trackers makes it a ton easier for players to find and compare alternate pairs, which is the basis for many advanced solving techniques.  What we have now really only supports a full view of one tracker.  Even though you can add more than one, the only feature it really brings is that the values are colored.  If we can get concurrent multiple tracker support, I think it would be awesome.
Comment 7 Jim Ross 2010-05-24 23:12:48 UTC
Created attachment 161901 [details] [review]
Tracker Overhaul - better look for tracker ui

This new patch changes the look of the tracker UI a little bit.  The buttons are now in 2 columns instead of 1.  Definately looks cleaner that way.  The tracker list is widened out to match the width of the buttons below it - so the widths match up.  And the "Tracker" label at the top has been removed.
Comment 8 Jim Ross 2010-05-25 01:37:51 UTC
Created attachment 161903 [details] [review]
Fix showing tracker to bold always

Minor change to how bold is set on showing tracker.
Comment 9 Robert Ancell 2010-05-25 01:41:39 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

Thanks for the great work Jim!