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

Show what was modified between entry history items #6789

Conversation

shemeshg
Copy link
Contributor

@shemeshg shemeshg commented Jul 31, 2021

Allow user understand what has changed in the history view
NOTE: # ( Explain large or complex code modifications. )
Simple change,

Fixes #2621

Screenshots

Screen Shot 2021-08-02 at 14 00 02

Testing strategy

Perform all types of changes, and preview each of them in the History View.
TIP: # ( We expect new code to be covered by unit tests and documented with doc blocks! )

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)
  • ✅ New feature (change that adds functionality)
  • ✅ Refactor (significant modification to existing code)
    Only,
-    m_historyModel->setEntries(m_entry->historyItems());
+    m_historyModel->setEntries(m_entry->historyItems(), m_entry);

@droidmonkey
Copy link
Member

Why show the notes? You have that as a change test already. I think showing the size of the history entry, number of attachments, and a calculated age (days, months, years depending on value) would be nice fields to have.

@droidmonkey droidmonkey changed the title feature/historyPreviousModifiedFields Show what was modified between entry history items Aug 1, 2021
@shemeshg
Copy link
Contributor Author

shemeshg commented Aug 1, 2021

Why show the notes? You have that as a change test already. I think showing the size of the history entry, number of attachments, and a calculated age (days, months, years depending on value) would be nice fields to have.

All Corrected

@shemeshg shemeshg force-pushed the feature/historyPreviousModifiedFields branch 3 times, most recently from cd095ee to d6dbd87 Compare August 2, 2021 11:01
@droidmonkey droidmonkey added this to the v2.7.0 milestone Aug 16, 2021
@droidmonkey droidmonkey self-requested a review August 16, 2021 02:59
@droidmonkey droidmonkey force-pushed the feature/historyPreviousModifiedFields branch from d6dbd87 to e5c2021 Compare November 23, 2021 14:34
@michaelk83
Copy link

michaelk83 commented Nov 26, 2021

The Size and Age columns are unclear. The column header should clarify what is being measured (size of what? age of what?), and either the header or rows should show units: Is the age in days? hours? weeks? Is the size in bytes? number of entries? something else?

Also it would be nice to see a diff between two history rows when selected - how was the data modified? (Or on a simpler level, at least show the old and new values next to each other.) But that's better left to a separate PR.

@droidmonkey
Copy link
Member

Yah I tested this and it was not clear to me what a lot of the info meant. This needs a polish.

@droidmonkey droidmonkey force-pushed the feature/historyPreviousModifiedFields branch 2 times, most recently from 7c99d8d to f2d997a Compare November 27, 2021 16:50
@droidmonkey droidmonkey force-pushed the feature/historyPreviousModifiedFields branch from f2d997a to d4ae5a2 Compare December 20, 2021 12:11
@droidmonkey
Copy link
Member

Major overhaul! This is now ready for prime time. @michaelk83 @phoerious @hifi

image

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2021

Codecov Report

Merging #6789 (4fffb22) into develop (12990e5) will increase coverage by 0.06%.
The diff coverage is 80.88%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6789      +/-   ##
===========================================
+ Coverage    64.58%   64.64%   +0.06%     
===========================================
  Files          335      335              
  Lines        42066    42172     +106     
===========================================
+ Hits         27166    27258      +92     
- Misses       14900    14914      +14     
Impacted Files Coverage Δ
src/core/Tools.h 0.00% <ø> (ø)
src/gui/entry/EditEntryWidget.cpp 72.16% <40.00%> (-0.18%) ⬇️
src/core/Tools.cpp 71.33% <77.78%> (+0.69%) ⬆️
src/gui/entry/EntryHistoryModel.cpp 82.17% <85.86%> (+4.39%) ⬆️
src/core/Entry.cpp 84.12% <0.00%> (+0.10%) ⬆️
src/core/FileWatcher.cpp 86.75% <0.00%> (+1.20%) ⬆️
src/core/Base32.cpp 98.07% <0.00%> (+1.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12990e5...4fffb22. Read the comment docs.

@droidmonkey
Copy link
Member

Kind of funny that the gui tests pass 🤣 I didn't touch them and made major changes to the way history works under the hood. Might need to address that some day.

@michaelk83
Copy link

Looks good. I can see from the code that "Size" is how much the entry takes up in the DB. It's still not entirely clear to me from the UI alone, but I can't think of any other interpretations, so I guess it's good enough.

The date and age don't add up in the first two rows. Different age, but same timestamp. Was the timestamp not updated (a bug)?

Also, rounding down 10 days to 1 week seems like a bit much. Maybe change the cut-off for "X weeks" to 2 and up?

@droidmonkey
Copy link
Member

droidmonkey commented Dec 20, 2021

Current is meant to indicate (along with the bold) that it is the current version of the entry. To make the differences column make any sense it was necessary to show the current entry as a "history item" so you can see the true lineage. This also means the last line item will always contain no differences since it is the base item.

Size is consistent with the main entry view.

@michaelk83
Copy link

michaelk83 commented Dec 20, 2021

I don't have a problem with the "Current", but the 5 min old time is the same as the current one. That doesn't make sense. I'd expect to see that 5 min difference in the timestamp too.

Hmm, are you saying the "Current" version is also 5 min old? How about "5 minute(s) (Current)"?

@droidmonkey
Copy link
Member

droidmonkey commented Dec 20, 2021

Yes they are both 5 min old. I wanted to keep it short because anything longer tends to get cut off. The age column is just a relative human readable version of the modified time. It isn't meant to be gospel. Gospel is the modified time column.

@michaelk83
Copy link

michaelk83 commented Dec 20, 2021

Understandable. It's just confusing this way. I would just drop the "Current" label and stick to ages + bold. You can re-add the "Current" as a tooltip.

Btw, with the "Current" label as is, does sorting by the Age column still work as expected?

@droidmonkey
Copy link
Member

droidmonkey commented Dec 20, 2021

Yes sorting still works, sorting is based on the actual seconds from today value. I don't think it is confusing, will wait for other feedback. It distinguishes it from the other, actual, history items along with the bold.

@michaelk83
Copy link

The confusing part for me was not clearly seeing the age of the current version. But I guess that's because I don't know when that screenshot was taken, so can't tell the age from the timestamp (without some mental juggling based on the older versions).

@droidmonkey
Copy link
Member

I can support "Current (x days)"

@droidmonkey droidmonkey force-pushed the feature/historyPreviousModifiedFields branch from d4ae5a2 to be17d20 Compare December 21, 2021 03:58
@droidmonkey
Copy link
Member

Made the tweak mentioned above and also used rounding in the human readable time difference for weeks and months. 1.5 weeks -> 2 weeks. That should give a better feel for the near term timeframes.

image

Keep in mind the (s) at the end will end up being replaced with the singular and plural forms once translated.

* Also show what is changed on the current state
* Closes keepassxreboot#2621
@droidmonkey droidmonkey force-pushed the feature/historyPreviousModifiedFields branch from be17d20 to 4fffb22 Compare December 21, 2021 04:07
@droidmonkey droidmonkey merged commit 15d1b2f into keepassxreboot:develop Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show overall history of changes for entries
4 participants