Skip to content

Conversation

@AgostonSzepessy
Copy link
Contributor

@AgostonSzepessy AgostonSzepessy commented Dec 29, 2025

Summary

Adds an option to exclude groups from showing up in database reports. I refactored the reports code because the menu code (and other parts of the report widget classes) was duplicated across multiple files and was getting pretty complicated. Now there's a base class that implements most of the functionality shared across the 4 classes.

I added the number of excluded groups to the database stats so users know how many groups are excluded. Groups that are excluded show their entries with (Group Excluded) when excluded entries are shown. This helps differentiate them from entries that are excluded.

Group exclusion is stored using CustomData. The kdbx file format doesn't seem to support group exclusions (and entries previously used to use CustomData too), so I put it in CustomData.

The context menu in the database reports displays an option to exclude groups now too. If the user clicks them, the group is excluded. If a user wants to include an entry from an excluded group, a popup appears, and they are asked if they'd like to include all entries from that group. If they choose No, the group exclusion is removed and all the group entries except for the selected ones are marked as excluded.

Fixes #12241.

Screenshots

edit-group-checkbox keepassxc-healthcheck-show-excludes keepassxc-include-entry keepassxc-healthcheck-include-excluded-group-entry

Testing strategy

I added GUI tests in TestGui.cpp to test the healthcheck report and group exclusions and entry inclusion. It walks through the workflow a user would have. The other pages were tested manually. I had to add a new signal to ReportsWidgetHealthcheck in order for the test to be able to wait on the table to be populated; otherwise the test executes too fast and has the incorrect result.

Type of change

  • ✅ New feature (change that adds functionality)
  • ✅ Refactor (significant modification to existing code)

When I tried adding a checkbox, the label for it was too big and it
pushed everything to the right. Adding a vertical layout, moving the
grid into it, and putting the checkbox into the horizontal layout fixes
this issue.
This isn't part of the kdbx format so we can't write it there directly.
Adds utility functions to create groups and entries for them.

Add test to make sure the right amount of entries show up in the
database report for password health.

Add signal when password health calculation is done so the test harness
can wait on it; otherwise the test finishes too soon and doesn't get the
right result from the application.
Adds 2 groups, excludes one and makes sure it doesn't show up in the
health check.
Entries in the group get marked as excluded. Entry that was selected is
marked for inclusion.
Copilot AI review requested due to automatic review settings December 29, 2025 06:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the ability to exclude entire groups from database reports, complementing the existing entry-level exclusion feature. The implementation stores group exclusion status in CustomData using the same "KnownBad" key as legacy entry exclusions, maintains consistency across all report widgets (Healthcheck, HIBP, and Browser Statistics), and includes comprehensive GUI tests.

Key Changes

  • Added group-level exclusion API in Group class with methods to set/get exclusion status and bulk-mark entries
  • Updated all three report widgets to handle group exclusions with consistent UI labeling and context menu options
  • Restructured EditGroupWidgetMain.ui from a grid layout to a vertical container with a grid layout to accommodate the new exclusion checkbox
  • Added database statistics tracking for excluded groups count

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 20 comments.

Show a summary per file
File Description
src/core/Group.h/cpp Added excludeFromReports(), setExcludeFromReports(), and markAllEntriesExcludedFromReports() methods
src/core/DatabaseStats.h/cpp Added excludedGroups counter and logic to track group exclusions
src/gui/group/EditGroupWidgetMain.ui Restructured layout to add excludeReportsCheckBox for group exclusion
src/gui/group/EditGroupWidget.cpp Wired up the new checkbox to load/save group exclusion state
src/gui/reports/ReportsWidgetHealthcheck.h/cpp Added tablePopulated signal and context menu options for group exclusion
src/gui/reports/ReportsWidgetHibp.cpp Updated to handle group exclusions with proper UI labels and context menu
src/gui/reports/ReportsWidgetBrowserStatistics.cpp Updated to handle group exclusions with proper UI labels and context menu
src/gui/reports/ReportsWidgetStatistics.cpp Added row displaying count of excluded groups
tests/gui/TestGui.h/cpp Added comprehensive GUI tests for group exclusion workflow

Copilot AI review requested due to automatic review settings December 29, 2025 06:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 17 comments.

@droidmonkey
Copy link
Member

You dont need to redo the layout you can place the checkbox in the grid

@AgostonSzepessy
Copy link
Contributor Author

@droidmonkey if I put it in the grid layout it pushes everything to the right. Is that OK? I personally think it looks better if it's below the grid but I can leave it as a grid layout. Here are two screenshots (one with the checkbox added and one with the "Expired" checkbox aligned to the right.

grid-layout-1 grid-layout-2

@droidmonkey
Copy link
Member

Put it in the second column

Had to delay initialization of these classes in `ReportsWidgetBase`
because they caused crashes in the constructor initialization list. This
is because the base class hasn't been initialized enough yet.
@AgostonSzepessy
Copy link
Contributor Author

@droidmonkey I changed the ui to add the checkbox on the right and also refactored the report widget classes. I extracted common functionality into a base class. Could you please review it? I also updated the original PR comment.

edit-group-checkbox

Copilot AI review requested due to automatic review settings December 31, 2025 00:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.

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.

Add option to exclude entire group from database reports

2 participants