Skip to content

Conversation

@myabc
Copy link
Contributor

@myabc myabc commented Nov 3, 2025

Ticket

https://community.openproject.org/wp/64474

What are you trying to accomplish?

Screenshots

What approach did you choose and why?

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@myabc myabc requested a review from Copilot November 3, 2025 21:10
Copy link

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 adds comprehensive documentation for the Attribute Help Texts feature in OpenProject. The documentation explains how administrators can provide additional contextual information for work package and project attributes, and how these help texts are automatically rendered in Primer forms.

Key Changes:

  • Documents the automatic rendering of attribute help texts in Primer forms
  • Lists all supported input field types
  • Provides examples for standard forms, custom fields, and customization options

@myabc myabc force-pushed the code-maintenance/64474-attribute-help-texts branch from 52162e7 to ae3daef Compare November 4, 2025 16:08
@myabc myabc requested a review from Copilot November 4, 2025 16:08
@myabc myabc marked this pull request as ready for review November 4, 2025 16:08
Copy link

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 1 out of 1 changed files in this pull request and generated 4 comments.

@myabc
Copy link
Contributor Author

myabc commented Nov 4, 2025

@HDinger I think this is OK as a start. I've implemented this as a page (under Patterns) rather than component docs.

Things that could be added:

  • adding previews for the components themselves (and including via embeds).
  • adding screenshots (?)
  • documenting the modals themselves (AttributeHelpTexts::ShowDialog) - these docs treat Attribute help texts as a bit of a black box.

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

Comment on lines +19 to +39
- `action_menu(**, &)`
- `auto_complete(**, &)`
- `autocompleter(**, &)`
- `block_note_editor(**, &)`
- `button(**, &)`
- `check_box_group(**, &)`
- `check_box(**, &)`
- `color_select_list(**, &)`
- `multi(**, &)`
- `pattern_input(**, &)`
- `project_autocompleter(**, &)`
- `radio_button_group(**, &)`
- `range_date_picker(**)`
- `rich_text_area(**)`
- `select_list(**, &)`
- `single_date_picker(**)`
- `storage_manual_project_folder_selection(**)`
- `submit(**, &)`
- `text_area(**, &)`
- `text_field(**, &)`
- `work_package_autocompleter(**, &)`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it worth including this list - or will it just be an issue keeping it up-to-date. Can we include this list from elsewhere?

### For Component authors

If you create a new input method (by extending
`Primer::Forms::Dsl::Input` and adding an accompanying method to
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should publish API docs somewhere and link.

@myabc myabc force-pushed the code-maintenance/64474-attribute-help-texts branch from e37150b to 52d3f80 Compare November 4, 2025 16:16
@myabc myabc force-pushed the code-maintenance/64474-attribute-help-texts branch from 52d3f80 to c72d1a9 Compare November 4, 2025 16:16
@myabc myabc changed the base branch from dev to release/16.6 November 4, 2025 16:17
@myabc myabc added this to the 16.6.x milestone Nov 4, 2025

You may also wish to show help texts when displaying attributes to the user. You
can use `AttributeLabelComponent` as shown above, passing the model and
applicable attribute. This takes care of finding an instantiating the Attribute
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This takes care of finding and instantiating the Attribute

Copy link
Contributor

@HDinger HDinger left a comment

Choose a reason for hiding this comment

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

I understand that this is a first draft, but imho, the previews are crutial to understand all of it. You and I know what it is about, how it was implemented and how the result looks like, however I fear that outstanders will not get it without some visual help.

Further, I am missing somehow the explanation how the attribute help texts are automatically added. You mentioned it shortly with decorate_options for component authors, but I think it worth explaining it a little bit more in detail

additional information for attributes of certain entities in OpenProject.
Currently, work packages and projects are supported.

Our [System admin guide][system_admin_guide] provides guidance for
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a valid link

Suggested change
Our [System admin guide][system_admin_guide] provides guidance for
Our [System admin guide](https://www.openproject.org/docs/system-admin-guide/attribute-help-texts/) provides guidance for

`additional_label` slot). It renders without a wrapper and the caller is
responsible for finding and passing an instance of `AttributeHelpText`.

```erb
Copy link
Contributor

Choose a reason for hiding this comment

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

Here at the latest a preview should be shown instead of a normal code block

}
)
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, this would also be a preview, so that you see the code as well as the result. Otherwise nobody will get where the attributehelpText is rendered

There is also an Angular `attribute-help-text` component available. It renders
identically to its Rails `AttributeHelpTextComponent` counterpart. Set the
attribute name using the `attribute` property and model name using
`attributeScope` (in `PascalCase`).
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, we should mark that part somehow as deprected otherwise people will use again..

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.

3 participants