Skip to content

Conversation

@bstolinski
Copy link
Contributor

@bstolinski bstolinski commented Dec 2, 2025

Description

This Pull Request implements the Collaborators feature in the Proposal Builder, allowing users to invite and manage co-proposers.

Related Issue(s)

Closes #3683
Part of #3677

Description of Changes

  • Added the ability to add and manage collaborators within the proposal builder flow.
  • This requires adding a new section collaborators to the schema:
"setup": {
    "$ref": "#/definitions/segment",
    "title": "Proposal setup",
    "description": "Proposal title",
    "x-icon": "view-grid",
    "properties": {
      "title": {...},
      "proposer": {...},
      "collaborators": {
        "$ref": "#/definitions/section",
        "title": "Co-Proposers",
        "x-guidance": "Co-Proposers will be notified via email upon proposal publishing. If they accept the invitation to join your proposal they will be shown as named co-proposer(s) on the published proposal. Co-proposers will not be able to edit any part of the proposal.\n\nIt's like a multi sig for your proposal, but not everyone needs to sign right away. You'll publish your new version right away, and your collaborators will be added to the proposal once they accept.\n\nBe sure to give your collaborators time to sign any final drafts before the proposal submission deadline!"
      }
    },
    "required": [
      "title",
      "proposer"
    ],
    "x-order": [
      "title",
      "proposer"
    ]
  }

Demo

Adding the same CatalystId with a changed username is not allowed, and there is a task for that.

collaborators_builder.mov

Please confirm the following checks

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream module

@damian-molinski damian-molinski added squad: face Frontend Catalyst Experience Team a: proposal editor Work related to proposal builder labels Dec 2, 2025
@damian-molinski damian-molinski moved this from New to 🏗 In progress in Catalyst Dec 2, 2025
@bstolinski bstolinski marked this pull request as ready for review December 2, 2025 13:50
@bstolinski bstolinski moved this from 🏗 In progress to 👀 In review in Catalyst Dec 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

📚 Docs Preview

The docs for this PR can be previewed at the following URL:

https://docs.dev.projectcatalyst.io/voices/feat/proposal-builder-collaborators

@bstolinski bstolinski added the review me PR is ready for review label Dec 2, 2025
damian-molinski

This comment was marked as resolved.

@bstolinski

This comment was marked as resolved.

Comment on lines 130 to 137
void _onCollaboratorsChanged(BuildContext context) {
final tileController = DocumentBuilderSectionTileControllerScope.of(context);
final dataNodeId = _CollaboratorsDetails.getDataNodeId(property.nodeId);
final collaborators = tileController.getData<List<CatalystId>>(dataNodeId) ?? [];
final event = UpdateCollaboratorsEvent(collaborators: collaborators);
context.read<ProposalBuilderBloc>().add(event);
tileController.removeData(dataNodeId);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

In general we don't want to look inside other class to extract data that somebody else wrote, you should only read what you yourself wrote. Instead we should get the data we are interested in directly and explicitly in the callback. Here you're overriding the onChanged which only works with document changes so you cannot pass the data you're really interested in.

I do not have yet any ready solution thought through but I'd see if it's possible to avoid above and just communicate with callbacks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The source of this problem is how _CollaboratorsDetailsSelector is built and that it is wrapped in DocumentBuilderSectionTile->EditableTile->DocumentPropertyBuilder, which gives us certain benefits but also the onChanged methods are not adapted to custom behaviors.

I tried to disable the save button for EditableTile and create my own inside _CollaboratorsDetailsSelector, but then there was a problem with refreshing the state of widgets outside (DocumentBuilderSectionTile and EditableTile).

Copy link
Contributor

Choose a reason for hiding this comment

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

What if next to onChanged we had onCollaboratorsChanged and to propagate this callback through all these layers? I'm afraid that with current solution it's too easy to change what we write in one place but forget to update the code that reads these values in somewhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I think it looks much better now. Pulling out and editing collaborators data is more centralized.

Copy link
Contributor

@damian-molinski damian-molinski left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: proposal editor Work related to proposal builder review me PR is ready for review squad: face Frontend Catalyst Experience Team

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

5 participants