-
Notifications
You must be signed in to change notification settings - Fork 37
Add user preference for subview borders #7041
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
base: main
Are you sure you want to change the base?
Conversation
Adds the boolean option for subview borders to the frontend
Show borders around subviews based on the user preference.
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.
Thanks for the PR!
Very solid work: big win for customizability! 🥇
- Compared the disabled preference changes (i.e., disabling borders around subviews) against v7.9.6.2
- Ran all frontend tests (all passed)
- Ran prettier on all files (no changes to these files were made)
- Ran eslint with auto-fix on all changed files (no changes or errors reported related to these changes)
- Confirm that there is a new preference in the Forms User Interface section, "Show borders around subviews" that is checked by default.

- Confirm that when this preference is checked, borders will show around subviews (as they do/did in
7.11.0
)
subview_borders.mov
- Confirm that when this preference is unchecked, borders will not show around subviews.
subview_no_borders.mov
Looks like our GitHub Actions aren't a fan of running on forks:
https://github.com/specify/specify7/actions/runs/16229736559/job/46144407892?pr=7041
https://github.com/specify/specify7/actions/runs/16229736554/job/46145055795?pr=7041
Specifically, it appears the secrets are not being passed correctly to the Action, though a quick look at the GitHub docs explains the situation:
With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository.
We'll look into modifying the Workflows to fully support PRs from forked repositories, but for now it appears they will not be available 😬
Sorry for the inconvenience!
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.
Great execution! It's wonderful to have you contributing directly to the project. We can't thank you enough. Let me know if you want another t-shirt!
- Confirm that there is a new preference in the Forms User Interface section, "Show borders around subviews" that is checked by default.
- Confirm that when this preference is checked, borders will show around subviews (as they do/did in
7.11.0
) - Confirm that when this preference is unchecked, borders will not show around subviews.
subviewborders.mp4
Definitely does not have to be addressed within this PR, but regarding the first acceptance criteria if we ever wish to support further border customization via the Form Definition system, Specify 6 does apparently set a precedence. Looking through the defaults, here is such an example: <cell type="panel" id="CPInner" name="CPInner" coldef="p" rowdef="p" initialize="border=line;bordercolor=200,200,200;bgcolor=240,240,240"> Looks like Specify 6 supported 5 different types of borders, with the /**
* Sets a border on the component as defined in the properties.
* @param comp the component
* @param props the list of properties
*/
protected void setBorder(final JComponent comp, final Properties props)
{
if (props != null)
{
String borderType = props.getProperty("border");
if (StringUtils.isNotEmpty(borderType))
{
if (borderType.equals("etched"))
{
comp.setBorder(BorderFactory.createEtchedBorder());
} else if (borderType.equals("lowered"))
{
comp.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
} else if (borderType.equals("raised"))
{
comp.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
} else if (borderType.equals("empty"))
{
comp.setBorder(BorderFactory.createEmptyBorder());
} else if (borderType.equals("line"))
{
Color color = Color.LIGHT_GRAY;
String borderColor = props.getProperty("bordercolor");
if (StringUtils.isNotEmpty(borderColor))
{
try
{
color = UIHelper.parseRGB(borderColor);
} catch(ConfigurationException ex)
{
log.error(ex);
}
}
comp.setBorder(BorderFactory.createLineBorder(color));
}
}
}
} We likely don't have to have exact feature parity with Specify 6 in this regard, but it's nice to see what was done in the past and include it in discussions (both community and internal)! |
Fixes #6863
This PR aims to meet acceptance criteria 2
Checklist
self-explanatory (or properly documented)
Testing instructions
7.11.0
)I have run the frontend tests with
npm run test
and all have passed, and tested on fresh database and the changes function as expected. I have formatted the files with prettier.