Display branches visually in a popup in project view (SZ-121)
rk@tigase.net opened 2 weeks ago

Summary

Add a Branches button to the project view toolbar that opens a modal listing all branches for the current project.

Motivation

OneDev provides a per-project branch overview. Sztab should offer equivalent visibility scoped to the project context.

Scope

  • New BranchListModal component fetching from existing GET /api/branches/project/{projectId}
  • New useBranches(projectId) hook with loading/error states
  • Toolbar button (GitBranch icon) wired to toggle the modal

Branch data displayed

ColumnSource
NameBranchDto.name
DefaultBranchDto.isDefault
StatusBranchDto.status
ParentBranchDto.parentName
CreatorBranchDto.creatorName
CreatedBranchDto.createdAt

Out of scope

  • Ahead/behind default branch (no backend data yet)
  • Active PR count per branch (no backend data yet)
  • These will be addressed in a follow-up once a summary endpoint exists

Acceptance criteria

  •  Toolbar button visible in project view header
  •  Clicking opens modal scoped to current project
  •  Modal shows branch list with columns above
  •  Loading and error states handled
  •  Modal dismissible via close button and backdrop click
  •  No regressions to existing project view

Estimate

2h

  • rk@tigase.net commented 2 weeks ago

    rksuma@Ramakrishnans-MacBook-Pro sztab % git checkout -b feature/SZ-121-Display-branches-visually Switched to a new branch 'feature/SZ-121-Display-branches-visually' rksuma@Ramakrishnans-MacBook-Pro sztab %

  • rk@tigase.net changed state to 'In Progress' 2 weeks ago
    Previous Value Current Value
    Open
    In Progress
  • rk@tigase.net commented 1 week ago
    rksuma@Ramakrishnans-MacBook-Pro sztab % git status
    On branch feature/SZ-121-Display-branches-visually
    Your branch is up to date with 'origin/feature/SZ-121-Display-branches-visually'.
    
    nothing to commit, working tree clean
    rksuma@Ramakrishnans-MacBook-Pro sztab % git checkout wolnosc
    git merge feature/SZ-121-Display-branches-visually
    git push
    Switched to branch 'wolnosc'
    Updating ce83edd..2cce01c
    Fast-forward
     Makefile                                                                          |  28 ++++++
     backend/pom.xml                                                                   |   3 +-
     backend/pom.xml.versionsBackup                                                    | 365 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     backend/src/main/java/com/sztab/controller/SystemController.java                  |  33 +++----
     backend/src/main/java/com/sztab/controller/project/ProjectController.java         |   3 +-
     backend/src/main/java/com/sztab/dto/project/ProjectCreateDto.java                 |   5 +-
     backend/src/main/java/com/sztab/model/Project.java                                |   4 +
     backend/src/main/java/com/sztab/service/ProjectService.java                       |   4 +-
     backend/src/main/java/com/sztab/service/impl/IssueServiceImpl.java                |  14 ++-
     backend/src/main/java/com/sztab/service/impl/ProjectServiceImpl.java              |  11 ++-
     backend/src/main/resources/db/migration/V15__add_default_assignee_to_projects.sql |   7 ++
     backend/src/test/java/com/sztab/controller/project/ProjectControllerTest.java     |  10 +-
     backend/src/test/java/com/sztab/regression/ProjectRegressionTest.java             |   4 +-
     backend/src/test/java/com/sztab/service/IssueServiceImplTest.java                 | 136 +++++++++++++++++++++++++++
     backend/src/test/java/com/sztab/service/ProjectServiceImplTest.java               | 121 +++++++++++++++++-------
     deploy/docker/docker-compose.yml                                                  |  12 +--
     deploy/helm/sztab/Chart.yaml                                                      |   2 +-
     deploy/helm/sztab/values-staging.yaml                                             |   7 +-
     deploy/helm/sztab/values.yaml                                                     |   2 +-
     frontend/src/components/branch/BranchTreeView.tsx                                 | 280 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
     frontend/src/components/layout/AboutModal.tsx                                     |  14 ++-
     frontend/src/components/project/CreateProjectModal.tsx                            |  16 ++++
     frontend/src/components/project/EditProjectModal.tsx                              |  23 +++++
     frontend/src/pages/projects/BranchesPage.tsx                                      |  49 +++++++---
     frontend/src/types/project.ts                                                     |   7 ++
     frontend/src/types/system.ts                                                      |   4 +-
     pom.xml                                                                           |   2 +-
     query-cli/pom.xml                                                                 |   2 +-
     query-dsl/pom.xml                                                                 |   2 +-
     29 files changed, 1073 insertions(+), 97 deletions(-)
     create mode 100644 Makefile
     create mode 100644 backend/pom.xml.versionsBackup
     create mode 100644 backend/src/main/resources/db/migration/V15__add_default_assignee_to_projects.sql
     create mode 100644 frontend/src/components/branch/BranchTreeView.tsx
    fatal: The current branch wolnosc has no upstream branch.
    To push the current branch and set the remote as upstream, use
    
        git push --set-upstream origin wolnosc
    
    To have this happen automatically for branches without a tracking
    upstream, see 'push.autoSetupRemote' in 'git help config'.
    
    rksuma@Ramakrishnans-MacBook-Pro sztab %     git push --set-upstream origin wolnosc
    
    Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
    To https://tigase.dev/sztab.git
       ce83edd..2cce01c  wolnosc -> wolnosc
    branch 'wolnosc' set up to track 'origin/wolnosc'.
    rksuma@Ramakrishnans-MacBook-Pro sztab % 
    rksuma@Ramakrishnans-MacBook-Pro sztab % git log --oneline --diff-filter=A -- frontend/src/components/branch/BranchTreeView.tsx
    cbd19ca First rev of visual branch and other fixes
    rksuma@Ramakrishnans-MacBook-Pro sztab % git branch -d feature/SZ-121-Display-branches-visually
    Deleted branch feature/SZ-121-Display-branches-visually (was 2cce01c).
    rksuma@Ramakrishnans-MacBook-Pro sztab % git push origin --delete feature/SZ-121-Display-branches-visually
    remote:  
    remote: Create a pull request for 'feature/SZ-121-Display-branches-visually' by visiting:
    remote:     https://tigase.dev/sztab/~pulls/new?target=1325:wolnosc&source=1325:feature/SZ-121-Display-branches-visually
    remote:  
    To https://tigase.dev/sztab.git
     - [deleted]         feature/SZ-121-Display-branches-visually
    rksuma@Ramakrishnans-MacBook-Pro sztab % git branch -a | grep SZ-121
    rksuma@Ramakrishnans-MacBook-Pro sztab % git fetch --prune
    rksuma@Ramakrishnans-MacBook-Pro sztab % git config --global push.autoSetupRemote true
    rksuma@Ramakrishnans-MacBook-Pro sztab % 
    
    
  • rk@tigase.net changed state to 'Closed' 1 week ago
    Previous Value Current Value
    In Progress
    Closed
  • rk@tigase.net commented 1 week ago

    Result:

    Screenshot 2026-03-19 at 12.17.25 PM.pngScreenshot 2026-03-19 at 12.17.25 PM Screenshot 2026-03-19 at 12.17.19 PM

    Screenshot 2026-03-19 at 12.17.19 PM.pngScreenshot 2026-03-19 at 12.17.19 PM

  • rk@tigase.net referenced from other issue 4 days ago
issue 1 of 1
Type
New Feature
Priority
Normal
Assignee
Version
1.10.0
Sprints
n/a
Customer
n/a
Issue Votes (0)
Watchers (3)
Reference
SZ-121
Please wait...
Page is in error, reload to recover