Skip to content

Conversation

myabc
Copy link
Contributor

@myabc myabc commented Sep 24, 2025

What are you trying to accomplish?

Defers assigning label for value to later in initialize method, ensuring the scope_id_false: false option is respected.

Integration

It may require updating calling code that relies on the incorrect behavior.

List the issues that this change affects.

Closes #3695

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.
  • Medium risk changes that are isolated, reduced in scope or could impact few users. The change will not impact library availability.
  • High risk changes are those that could impact customers and SLOs, low or no test coverage, low observability, or slow to rollback.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Lookbook)
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

@Copilot Copilot AI review requested due to automatic review settings September 24, 2025 18:14
@myabc myabc requested a review from a team as a code owner September 24, 2025 18:14
@myabc myabc requested a review from siddharthkp September 24, 2025 18:14
Copy link

changeset-bot bot commented Sep 24, 2025

🦋 Changeset detected

Latest commit: b6b4909

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@Copilot 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 fixes the label for attribute assignment when the scope_id_false: false option is used. The fix ensures that the label's for attribute is properly set to match the input's ID after the ID has been finalized during initialization.

Key changes:

  • Moved label for attribute assignment to later in the initialization process
  • Added test coverage for the fixed behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/lib/primer/forms/dsl/input.rb Moves the @label_arguments[:for] = id assignment from early initialization to after ID processing is complete
test/lib/primer/forms/input_test.rb Adds test assertions to verify label for attributes are correctly set in existing test cases

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Defers assigning label `for` value to later in `initialize` method,
ensuring the `scope_id_false: false` option is respected.

Closes primer#3695
@myabc myabc force-pushed the fix/label-for-not-scoped-to-model branch from 9130190 to 7b26e33 Compare September 24, 2025 18:18
myabc added a commit to opf/openproject that referenced this pull request Sep 24, 2025
This requires an upstream fix. However, given the potential to cause
accessibility problems and broken UX (e.g. focus), we should track the
current and desired/fixed behavior downstream.

See primer/view_components#3696
See primer/view_components#3695
@myabc myabc requested a review from Copilot September 24, 2025 19:37
Copy link
Contributor

@Copilot 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 3 out of 3 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@siddharthkp siddharthkp requested review from jonrohan and removed request for siddharthkp September 24, 2025 21:30
@siddharthkp
Copy link
Member

Passing over to @jonrohan who would know more about this than me

@myabc
Copy link
Contributor Author

myabc commented Sep 24, 2025

Just a quick note: I've kept this PR narrow in scope (forgive the pun) and tried to solve this in the "least invasive" way possible. However, there are other issues (such as namespacing - see #3698) for which I'm trying to find a more robust solution.

myabc added a commit to opf/openproject that referenced this pull request Sep 25, 2025
This requires an upstream fix. However, given the potential to cause
accessibility problems and broken UX (e.g. focus), we should track the
current and desired/fixed behavior downstream.

See primer/view_components#3696
See primer/view_components#3695
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.

Label for attribute incorrect when scope_id_false: false
2 participants