Skip to content

Pr3 add join leave UI buttons#2795

Merged
peterschmidt85 merged 29 commits intodstackai:masterfrom
haydnli-shopify:PR3-add-join-leave-ui-buttons
Jun 26, 2025
Merged

Pr3 add join leave UI buttons#2795
peterschmidt85 merged 29 commits intodstackai:masterfrom
haydnli-shopify:PR3-add-join-leave-ui-buttons

Conversation

@haydnli-shopify
Copy link
Copy Markdown
Contributor

@haydnli-shopify haydnli-shopify commented Jun 12, 2025

Summary

Implements join/leave project functionality with an intuitive UI integrated directly into the project members table. This PR builds on the member management endpoints from PR2 to provide a seamless user experience for project collaboration.

Builds on PR2 (#2779) and Issue(#2742) - requires member management endpoints

Changes Made

Frontend Implementation

  • Integrated join/leave UI into existing ProjectMembers component
  • Added permission-based button states:
    • "Join Project" for non-members of public projects
    • "Leave Project" for regular members
    • "Owner Cannot Leave" (disabled) for project owners
  • Added navigation logic to redirect users to project list after leaving projects
  • Removed redundant "Public Access" section from project Settings page

Translation & Localization

  • Added translation keys for join/leave operations and success/error messages

User Experience

Join Project Flow

  1. User views a public project they're not a member of
  2. "Join Project" button appears in the members table
  3. Click triggers API call and user becomes project member

Leave Project Flow

  1. User views a project they're a member of (but not owner)
  2. "Leave Project" button appears in members table
  3. Click triggers API call and user is redirected to project list

Permission Handling

  • Project owners cannot leave (disabled button)
  • Regular members can leave projects
  • Non-members can join public projects only

@haydnli-shopify haydnli-shopify force-pushed the PR3-add-join-leave-ui-buttons branch from 821e634 to fba97cf Compare June 12, 2025 17:54
@r4victor r4victor mentioned this pull request Jun 13, 2025
@r4victor
Copy link
Copy Markdown
Collaborator

Please address #2759 (comment)

@haydnli-shopify haydnli-shopify force-pushed the PR3-add-join-leave-ui-buttons branch from fba97cf to 7ff0899 Compare June 13, 2025 14:54
@haydnli-shopify
Copy link
Copy Markdown
Contributor Author

Please address #2759 (comment)

Thanks for the feedback!
I’ve tested the UI as a non-member on public projects, and the page works as expected—member-only sections aren’t shown, and the UI doesn’t break.
Let me know if you spot any specific issues, but I believe the current logic in #2795 already handles this case well.

@r4victor
Copy link
Copy Markdown
Collaborator

@haydnli-shopify, great, we can test it once the PR is ready for review.

@haydnli-shopify
Copy link
Copy Markdown
Contributor Author

haydnli-shopify commented Jun 16, 2025

@haydnli-shopify, great, we can test it once the PR is ready for review.

Both ticket are ready for review
PR for backend APIs: #2779
PR for UI: #2795

@haydnli-shopify haydnli-shopify force-pushed the PR3-add-join-leave-ui-buttons branch from 8e0590c to 7ff0899 Compare June 17, 2025 14:21
@peterschmidt85 peterschmidt85 requested a review from olgenn June 18, 2025 08:11
@haydnli-shopify haydnli-shopify requested a review from olgenn June 18, 2025 15:48
@haydnli-shopify haydnli-shopify requested a review from olgenn June 18, 2025 18:27
@peterschmidt85
Copy link
Copy Markdown
Contributor

Running on the state of 0.19.15:

  File "/Users/cheptsov/dstack/.venv/lib/python3.13/site-packages/alembic/script/base.py", line 286, in _catch_revision_errors
    raise util.CommandError(resolution) from re
alembic.util.exc.CommandError: Can't locate revision identified by '35e90e1b0d3e'

I assume, the PR branch should merge the changes from the master

@peterschmidt85 peterschmidt85 self-requested a review June 20, 2025 08:49
@peterschmidt85
Copy link
Copy Markdown
Contributor

(Minor) I'd suggest to move the UI for managing project visibility to the Danger Zone

Copy link
Copy Markdown
Contributor

@peterschmidt85 peterschmidt85 left a comment

Choose a reason for hiding this comment

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

  • Ensure you merge the changes from the master (and do a quick test) before merging the PR
  • Replace /update_visibility with more generic /update
  • Move the UI for managing the project to Danger Zone. Ensure to use a ComboBox (Public|Private) and ask for a confirmation.
  • (Optional) Consider showing Visibility in the Projects table as a separate column

@peterschmidt85
Copy link
Copy Markdown
Contributor

Plus, showing Owners Cannot LEave doesn't make sense.
Screenshot 2025-06-20 at 11 19 35

@peterschmidt85
Copy link
Copy Markdown
Contributor

Also, the Make project public shows the state incorrectly
Screenshot 2025-06-20 at 11 21 27

Copy link
Copy Markdown
Contributor

@peterschmidt85 peterschmidt85 left a comment

Choose a reason for hiding this comment

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

Added a few minor changes. Please review.
If all is good, please confirm so we can merge.

@haydnli-shopify haydnli-shopify force-pushed the PR3-add-join-leave-ui-buttons branch from 12e3f9b to cb13d4f Compare June 25, 2025 15:21
async def update_project(
body: UpdateProjectRequest,
session: AsyncSession = Depends(get_session),
user_project: Tuple[UserModel, ProjectModel] = Depends(ProjectManager()),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Project manager can manage project members but otherwise they are regular users, so they should not be able to update projects. Project update must be limited to project admins.

 - UI captions
 - Added confirmation on Leave
 - Removed Join/Leave from Project Details Header
@peterschmidt85 peterschmidt85 merged commit e47c927 into dstackai:master Jun 26, 2025
25 checks passed
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.

4 participants