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

History filters enhancements #7690

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

skomak
Copy link

@skomak skomak commented Jan 12, 2023

Hi,

I set minimum filters window size as by default it was too packed and horizontal scrollers were unnecessarily activated and data was not fitting textarea width.
Also, I added sample predefined regexps.

Previously it looked like this:
obraz

After:
obraz

skomak added 2 commits January 11, 2023 18:39
horizontal scrollers were unnecessarily activated and data was not
fitting textarea width
@kingthorin
Copy link
Member

centreDialog();
this.getRootPane().setDefaultButton(btnApply);
this.setMinimumSize(new Dimension(1000, 600));
Copy link
Member

Choose a reason for hiding this comment

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

The minimum size should not be set as a rule (e.g. VM with 800x600 resolution would have problems). Maybe you meant the size and even then, better if packed and let the layout manager size the components to their preferred size.

Copy link
Author

Choose a reason for hiding this comment

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

Default packing looks terrible, you need to expand the window every single time you run ZAP to see all values. It is not convenient. Also, using tools like ZAP with resolution 800x600 is not something you would find convenient. I can redesign window but I believe we need field values visible without need of expanding the window.

Copy link
Member

Choose a reason for hiding this comment

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

If the packing looks terrible then preferred sizes could/should be specified for sub-components, or other mechanisms leveraged to make it work nicely (note: I am not and do not claim to be a java UI expert, far from it). Setting the minimum completely takes control away from the user, and potentially makes things unusable if they happen to be on underspeced systems/VMs.

@@ -423,26 +467,28 @@ private JPanel getJPanel2() {
jPanel2.add(
new JLabel(Constant.messages.getString("history.filter.label.urlincregex")),
gbc04);
jPanel2.add(new JLabel("Sample regexps:"), gbc06);
Copy link
Member

Choose a reason for hiding this comment

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

The strings should be i18n'ed.

Comment on lines +543 to +558
private JScrollPane getUrlRegxSamples() {
if (urlRegxSamples == null) {
// TODO save the list in better place
final String[] URL_REGX_INC_LIST = {
".*\\.(js|css|woff2|png|jpeg|jpg|gif|svg)$", ".*\\.(html|asp|jsp|php)$"
};

regexSamples = new JList<>(URL_REGX_INC_LIST);
regexSamples.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
regexSamples.setLayoutOrientation(JList.VERTICAL);
regexSamples.setVisibleRowCount(URL_REGX_INC_LIST.length);
urlRegxSamples = new JScrollPane(regexSamples);
}
return urlRegxSamples;
}

Copy link
Member

Choose a reason for hiding this comment

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

Not quite sure of usefulness of this without being persisted.

@psiinon
Copy link
Member

psiinon commented Jan 13, 2023

The Sample Regexes take up a lot of space, and are one of the least important parts IMO.
How about changing to something like:
Screenshot 2023-01-13 at 09 56 56
(just the right hand side).
The bottom control is a pulldown - the copy button copies the selected regex and then the usual OS Control-V can be used to paste it..
And yes! Found a good excuse to include an HTML button in a github comment 😛

@kingthorin
Copy link
Member

kingthorin commented Jan 24, 2023

The Notes label/control seems to be missing in the "After" screenshot?

if (urlRegxSamples == null) {
// TODO save the list in better place
final String[] URL_REGX_INC_LIST = {
".*\\.(js|css|woff2|png|jpeg|jpg|gif|svg)$", ".*\\.(html|asp|jsp|php)$"
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why I didn't notice this earlier. But doing extensions with an ending anchor will mean that URLs with params are not matched by the filter. ex: https://example.com/foo/bar.php?baz=lmnop

@thc202
Copy link
Member

thc202 commented Mar 22, 2023

@skomak ping

1 similar comment
@kingthorin
Copy link
Member

@skomak ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants