Skip to content

Add GitHub repository link and branch selection to DAK dashboard#123

Merged
litlfred merged 3 commits intomainfrom
copilot/fix-122
Jul 27, 2025
Merged

Add GitHub repository link and branch selection to DAK dashboard#123
litlfred merged 3 commits intomainfrom
copilot/fix-122

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jul 27, 2025

This PR implements the requested GitHub repository link and branch selection functionality for the DAK dashboard, enabling users to easily navigate back to GitHub and select different branches for DAK component scanning.

🎯 Key Features

Prominent GitHub Repository Link

The repository name in the DAK dashboard header is now a clickable link that opens the GitHub repository in a new tab. The link includes visual indicators (folder icon 📁 and external link arrow ↗) for clear user guidance.

Branch Selection with Session Persistence

Added a comprehensive branch selection component that:

  • Displays all available branches in a dropdown selector
  • Defaults to "main" branch (as requested, not "master")
  • Includes a "+" button to create new branches with validation
  • Persists the selected branch in session storage per repository
  • Maintains branch context throughout the DAK editing session

Integration with DAK Component Scanning

The business process selection (BPMN workflows) now uses the selected branch when loading files from the repository, ensuring users can work with components from their chosen branch.

🏗️ Technical Implementation

New Services and Components

  • BranchContextService: Manages branch selection persistence in session storage with proper error handling
  • BranchSelector: Reusable React component for branch selection with create functionality
  • Enhanced GitHubService: Added methods for getBranches(), createBranch(), and getBranch()

Session Context Management

Branch selections are stored per repository using the format owner/repo-name and persist throughout the user's session. When switching repositories, each maintains its own branch context.

Error Handling

The implementation includes graceful error handling for:

  • Network failures when loading branches
  • Authentication issues in demo mode
  • Invalid branch names when creating new branches
  • Corrupted session storage data

🧪 Testing

Added comprehensive test coverage for the new BranchContextService with 18 test cases covering all functionality including edge cases and error scenarios.

📸 Visual Changes

DAK Dashboard with Branch Selection

The screenshot shows:

  • Prominent GitHub repository link in the header (📁 maternal-health-dak ↗)
  • Branch selector component with proper error handling for unauthenticated demo mode
  • Clean integration with the existing dashboard design and layout

🔄 Backward Compatibility

All changes are fully backward compatible. Existing functionality remains unchanged, and the new features gracefully handle cases where branch information is not available.

Fixes #122.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Copilot AI changed the title [WIP] show link to github repo Add GitHub repository link and branch selection to DAK dashboard Jul 27, 2025
Copilot AI requested a review from litlfred July 27, 2025 01:07
@litlfred
Copy link
Copy Markdown
Owner

great. i see it in the title/header. however the header/title is getting crowded and the repo status should float to the left rather than be below the user and documentaiton links
image

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jul 27, 2025

great. i see it in the title/header. however the header/title is getting crowded and the repo status should float to the left rather than be below the user and documentaiton links
<img width="482"...

The header layout has been reorganized to address the crowding issue. The repository status (GitHub link, branch selector, and access level) now floats to the left next to the WHO branding, while the user information and documentation link remain on the right side.

Improved Header Layout

Changes made (commit d4ad0b9):

  • Moved repository status to left side with visual separator
  • Kept user avatar, username, and documentation on the right
  • Maintained mobile responsiveness with proper stacking on smaller screens

@litlfred litlfred marked this pull request as ready for review July 27, 2025 01:25
@litlfred litlfred merged commit 191b41b into main Jul 27, 2025
Copilot AI added a commit that referenced this pull request Aug 27, 2025
- Convert issue references (#123, Fixes #456) to clickable GitHub issue links
- Convert user mentions (@username) to GitHub profile links
- Convert cross-repository references (org/repo#123) to issue links
- Convert commit SHAs to GitHub commit links
- Preserve existing markdown links without double-conversion
- Support all common GitHub notation patterns in PR descriptions and comments

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
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.

show link to github repo

2 participants