Add GitHub connection type — repo viewer with org grouping and auto-refresh

New protocol type 'github' for browsing repositories via the GitHub REST API.
Creates a non-terminal panel showing repos grouped by owner/org, sorted by
last commit date (newest first), with search filtering and auto-refresh.

Backend:
- ProtocolGitHub constant and GitHubConfig/GitHubRepo model structs
- New internal/githubclient package (REST API, pagination, token validation)
- Session manager connectGitHub() with periodic refresh goroutine
- API surface: RefreshGitHubRepos() for on-demand refresh
- Token stored via existing credential infrastructure (keychain/vault)

Frontend:
- GitHub tab in profile editor with API URL and token storage fields
- New github.js viewer component (grouped repos, badges, language dots)
- github.css with charcoal-themed repo cards and org headers
- Protocol colour tokens, tab badge, sidebar indicator for GitHub
- Event wiring for session:github:repos and session:github:error
- Cleanup on tab close

Supports GitHub Enterprise via configurable API base URL.
This commit is contained in:
2026-04-16 00:00:00 +01:00
parent 58eb1626f6
commit c98ace2396
20 changed files with 1179 additions and 21 deletions
+21
View File
@@ -166,6 +166,20 @@ class App {
this.rawViewer.handleData(payload);
});
// GitHub repository data
window.runtime.EventsOn('session:github:repos', (payload) => {
window.NexusTerminal.GitHubViewer.updateRepos(
payload.sessionID, payload.login, payload.repos
);
});
// GitHub refresh errors
window.runtime.EventsOn('session:github:error', (payload) => {
window.NexusTerminal.GitHubViewer.showError(
payload.sessionID, payload.error
);
});
// Telnet negotiation debug messages
window.runtime.EventsOn('session:debug', (payload) => {
console.debug('[session:debug]', payload);
@@ -341,6 +355,13 @@ class App {
const panelId = `panel-${sessionInfo.id}`;
if (profile.protocol === 'raw') {
this.rawViewer.createViewer(sessionInfo.id, panelId, profile);
} else if (profile.protocol === 'github') {
const container = document.getElementById(panelId);
if (container) {
window.NexusTerminal.GitHubViewer.createViewer(
sessionInfo.id, container, profile.displayName || profile.host
);
}
} else {
this.terminals.createTerminal(sessionInfo.id, panelId, profile);
}