Skip to content

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

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

Conversation

mark-pitblado
Copy link

@mark-pitblado mark-pitblado commented Jul 11, 2025

Fixes #6863

This PR aims to meet acceptance criteria 2

Allow users to completely enable or disable subview outlines in User Preferences

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests

Testing instructions

  • 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.

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.

Copy link
Contributor

@melton-jason melton-jason left a 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.
Image
  • 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.

https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/using-secrets-in-github-actions#using-secrets-in-a-workflow

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!

Copy link
Member

@grantfitzsimmons grantfitzsimmons left a 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

@grantfitzsimmons grantfitzsimmons requested review from a team July 17, 2025 04:04
@grantfitzsimmons grantfitzsimmons added this to the 7.11.2 milestone Jul 17, 2025
@melton-jason
Copy link
Contributor

melton-jason commented Jul 17, 2025

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">

https://github.com/specify/specify6/blob/3edca4fdb26a630e1be19724cf9d78b5d95ef371/config/bird/bird.views.xml#L210C33-L210C171

Looks like Specify 6 supported 5 different types of borders, with the line type additionally supporting specifying a color in a RGB format:

    /**
     * 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));
                }
            }
        }
    }

https://github.com/specify/specify6/blob/3edca4fdb26a630e1be19724cf9d78b5d95ef371/src/edu/ku/brc/af/ui/forms/ViewFactory.java#L2399-L2446


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)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋Back Log
Development

Successfully merging this pull request may close these issues.

Make subview borders configurable
4 participants