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

Fix transaction view/table #662

Closed
wants to merge 4 commits into from

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Sep 6, 2022

#204 reverted a necessary bugfix, and #205 introduced regressions since setModel resets column widths. Note that you need to delete your saved GUI config to see the fix, otherwise the prior widths are restored.

Before regressions:

Screenshot_20220905_232835 branch-21

After regressions / current master:

Screenshot_20220905_233054 branch-22

With this PR:

Screenshot_20220906_134210

@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 6, 2022

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #684 (Improve 'Requested Payments History' Multiselect by john-moffett)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we revert the PR's aren't we still left with a buggy transaction table? Additionally, it's possible that the class mentioned can lead to a segfault when loading in a very large wallet:

@luke-jr
Copy link
Member Author

luke-jr commented Sep 19, 2022

if we revert the PR's aren't we still left with a buggy transaction table?

I'm not aware of any documented bugs. With the PRs reverted, it works perfect for me.

Additionally, it's possible that the class mentioned can lead to a segfault when loading in a very large wallet:

These bugs seem outside the scope of this PR, but if you can explain, I can try to take a shot at fixing them?

@hebasto hebasto added the UI All about "look and feel" label Oct 26, 2022
@bitcoin-core bitcoin-core deleted a comment from DrahtBot Nov 7, 2022
@hebasto
Copy link
Member

hebasto commented Dec 6, 2022

From PR description it is not clear what actual bug this PR is supposed to fix.

#204 reverted a necessary bugfix,

Wrong. See #204 PR description.

and #205 introduced regressions since setModel resets column widths.

Wrong. Column widths belong to a "View" layer. A "Model" layer should do nothing with a visual representation. It is up to user to set the "View" layer, including column widths.

@luke-jr
Copy link
Member Author

luke-jr commented Dec 6, 2022

Not wrong. See screenshots.

@hebasto
Copy link
Member

hebasto commented May 31, 2023

Closing due to a long period of inactivity here. Feel free to reopen.

@hebasto hebasto closed this May 31, 2023
@achow101
Copy link
Member

Reopening was requested.

@luke-jr
Copy link
Member Author

luke-jr commented Jun 29, 2023

Re-confirmed bug still exists, and rebased this fix.

@hebasto
Copy link
Member

hebasto commented Jul 3, 2023

Tested 8e428cc on Ubuntu 23.04.

Application window resizing leads to:

image

when the content of the last column "Amount" goes out of the scope.

@maflcko
Copy link
Contributor

maflcko commented Sep 6, 2023

From CI:

./qt/receivecoinsdialog.h:54:48: error: use default member initializer for 'columnResizingFixer' [modernize-use-default-member-init,-warnings-as-errors]
    GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
                                               ^
                                                                  {nullptr}

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 8e428cc on Ubuntu 22.04.

Deleted TransactionViewHeaderState row manually from qt config file as requested in the description by the author (.config/Bitcoin/Bitcoin-Qt-regtest.conf), instead of using -resetguisettings as I didn't want to lose the rest.

As @hebasto posted above, "Amount" column goes out of scope when I resize to the right and then to the left (and the same happens with the "Requested payments history" in the receivecoinsdialog).
Peek 2023-09-16 14-39

Something I noticed when I resize the Label column enough to fit the most of the address (when are not labeled) is that with this PR changes, when the "Amount" column is correctly resized and gets fit in the table view, it's changing the Label column size that I set manually, so that's a bit contradictory, we let the user change something and then we correct the user:
Peek 2023-09-16 15-31

So, in terms of the 2 issues detected and explained above I prefer the current state of the table view, in master we also have the horizontal scrollbar at the bottom which has disappear with the changes of this PR.

Going thru all the PRs and beyond, is the actual issue that the "last column itself cannot be resized" (in the case of the transaction view/ table would be the "Amount" column)? In this case I see the issue is still in master (user can make it wider but not shrink it - this is because of setStretchLastSection(true)) and this PR doesn't fix it, the PR deals more with the resizing of the table but user can't make the last column shorter or larger (last column is set as "interactive" but it's fixed for the user perspective). I see where this is achieved is on the Peers table (setStretchLastSection is not called so it's false by default), user can set the last column "User Agent" width freely.

I can verify that there's another issue in master, and this PR solves, which is the fact that the default widths are not set properly the first time qt runs on a machine (or settings of the transaction view are missing from the qt config file) and user can see the 2nd. screenshot from the top description. As it's mentioned in the description as well "setModel resets column widths", can't we not move the settings state restore/ set column widths defaults at the very end of it?.

Perhaps the description of the PR could be clearer in terms of what the proper issue is and just mention the history of tries as a reference. This is original issue in the bitcoin repo: #2862.

}
}

// When the table's geometry is ready, we manually perform the stretch of the "Message" column,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the "Message" column would be? Sounds like something dynamic but it's fixed to the secondToLastColumIndex (which is the Label column in the transactions table).

secondToLastColumnIndex = columnCount - 2;
tableView->horizontalHeader()->setMinimumSectionSize(allColumnsMinimumWidth);
setViewHeaderResizeMode(secondToLastColumnIndex, QHeaderView::Interactive);
setViewHeaderResizeMode(lastColumnIndex, QHeaderView::Interactive);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line doesn't make any difference, user still can't change the last column size manually.

Suggested change
setViewHeaderResizeMode(lastColumnIndex, QHeaderView::Interactive);

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 5, 2024

🤔 There hasn't been much activity lately and the CI seems to be failing.

If no one reviewed the current pull request by commit hash, a rebase can be considered. While the CI failure may be a false positive, the CI hasn't been running for some time, so there may be a real issue hiding as well. A rebase triggers the latest CI and makes sure that no silent merge conflicts have snuck in.

@hebasto
Copy link
Member

hebasto commented Feb 11, 2024

Closing due to lack of support from the PR author (unaddressed comments, the failed CI).

@hebasto hebasto closed this Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI failed UI All about "look and feel"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants