-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
base: main
Are you sure you want to change the base?
Conversation
horizontal scrollers were unnecessarily activated and data was not fitting textarea width
To address the DCO requirement you'll need to sign-off the commit(s): |
centreDialog(); | ||
this.getRootPane().setDefaultButton(btnApply); | ||
this.setMinimumSize(new Dimension(1000, 600)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
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; | ||
} | ||
|
There was a problem hiding this comment.
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.
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)$" |
There was a problem hiding this comment.
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
@skomak ping |
1 similar comment
@skomak ping |
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:
After: