gitxelectron 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23589,6 +23589,304 @@ const AuthHoverButton = ({ username }) => {
23589
23589
  ] })
23590
23590
  ] });
23591
23591
  };
23592
+ const CollaborationRepoView = ({
23593
+ collaboratedRepos,
23594
+ collabMappings,
23595
+ pathExistenceMap,
23596
+ collabSearch,
23597
+ setCollabSearch,
23598
+ currentRepoPath,
23599
+ onRepoCardClick,
23600
+ onRefresh,
23601
+ isRefreshing,
23602
+ onOpenExternal
23603
+ }) => {
23604
+ const filteredRepos = collaboratedRepos.filter((repo) => {
23605
+ if (!collabSearch.trim()) return true;
23606
+ const q = collabSearch.toLowerCase().trim();
23607
+ return repo.name?.toLowerCase().includes(q) || repo.full_name?.toLowerCase().includes(q) || repo.owner?.login?.toLowerCase().includes(q) || repo.description && repo.description.toLowerCase().includes(q) || repo.language && repo.language.toLowerCase().includes(q);
23608
+ });
23609
+ const connectedCount = collaboratedRepos.filter((r) => {
23610
+ const saved = collabMappings[r.full_name];
23611
+ return saved && pathExistenceMap[r.full_name] !== false;
23612
+ }).length;
23613
+ const missingCount = collaboratedRepos.filter((r) => {
23614
+ const saved = collabMappings[r.full_name];
23615
+ return saved && pathExistenceMap[r.full_name] === false;
23616
+ }).length;
23617
+ const notClonedCount = collaboratedRepos.length - connectedCount - missingCount;
23618
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col min-w-0 overflow-hidden gap-4", children: [
23619
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-gradient-to-r from-brand/15 via-surface/60 to-purple-500/10 border border-brand/20 rounded-2xl p-4 sm:p-5 shadow-sm flex flex-col md:flex-row md:items-center justify-between gap-4 flex-shrink-0", children: [
23620
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start sm:items-center gap-3.5 min-w-0", children: [
23621
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-11 h-11 rounded-2xl bg-brand/20 border border-brand/30 flex items-center justify-center text-brand flex-shrink-0 shadow-inner", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
23622
+ "path",
23623
+ {
23624
+ strokeLinecap: "round",
23625
+ strokeLinejoin: "round",
23626
+ strokeWidth: 2,
23627
+ d: "M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2"
23628
+ }
23629
+ ) }) }),
23630
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0", children: [
23631
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
23632
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-base sm:text-lg font-bold text-primary tracking-tight", children: "Collaboration Repositories" }),
23633
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs bg-brand/20 border border-brand/30 text-brand px-2.5 py-0.5 rounded-full font-bold", children: collaboratedRepos.length })
23634
+ ] }),
23635
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-secondary mt-0.5 truncate", children: "Repositories you collaborate on with organizations, teams, and other developers." })
23636
+ ] })
23637
+ ] }),
23638
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-center gap-2.5 w-full md:w-auto", children: [
23639
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex-1 sm:w-64 min-w-[200px]", children: [
23640
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
23641
+ "svg",
23642
+ {
23643
+ className: "w-4 h-4 text-secondary absolute left-3 top-2.5 pointer-events-none",
23644
+ fill: "none",
23645
+ stroke: "currentColor",
23646
+ viewBox: "0 0 24 24",
23647
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
23648
+ "path",
23649
+ {
23650
+ strokeLinecap: "round",
23651
+ strokeLinejoin: "round",
23652
+ strokeWidth: 2,
23653
+ d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
23654
+ }
23655
+ )
23656
+ }
23657
+ ),
23658
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
23659
+ "input",
23660
+ {
23661
+ type: "text",
23662
+ value: collabSearch,
23663
+ onChange: (e) => setCollabSearch(e.target.value),
23664
+ placeholder: "Search by repo, owner, or tech...",
23665
+ className: "w-full bg-surface border border-border rounded-xl pl-9 pr-8 py-2 text-xs text-primary placeholder-secondary/70 focus:outline-none focus:border-brand focus:ring-1 focus:ring-brand transition-all shadow-xs"
23666
+ }
23667
+ ),
23668
+ collabSearch && /* @__PURE__ */ jsxRuntimeExports.jsx(
23669
+ "button",
23670
+ {
23671
+ onClick: () => setCollabSearch(""),
23672
+ className: "absolute right-2.5 top-2 text-secondary hover:text-primary text-xs p-0.5 rounded",
23673
+ title: "Clear search",
23674
+ children: "✕"
23675
+ }
23676
+ )
23677
+ ] }),
23678
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
23679
+ "button",
23680
+ {
23681
+ onClick: onRefresh,
23682
+ disabled: isRefreshing,
23683
+ className: "px-3.5 py-2 bg-surface hover:bg-surface-hover border border-border rounded-xl text-xs font-medium text-primary transition-all flex items-center gap-1.5 shadow-xs disabled:opacity-50 flex-shrink-0",
23684
+ title: "Refresh collaboration repositories from GitHub",
23685
+ children: [
23686
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
23687
+ "svg",
23688
+ {
23689
+ className: `w-3.5 h-3.5 ${isRefreshing ? "animate-spin text-brand" : "text-secondary"}`,
23690
+ fill: "none",
23691
+ stroke: "currentColor",
23692
+ viewBox: "0 0 24 24",
23693
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
23694
+ "path",
23695
+ {
23696
+ strokeLinecap: "round",
23697
+ strokeLinejoin: "round",
23698
+ strokeWidth: 2,
23699
+ d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
23700
+ }
23701
+ )
23702
+ }
23703
+ ),
23704
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: isRefreshing ? "Refreshing..." : "Refresh" })
23705
+ ]
23706
+ }
23707
+ )
23708
+ ] })
23709
+ ] }),
23710
+ collaboratedRepos.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-xs text-secondary flex-wrap px-1", children: [
23711
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[11px] font-medium text-secondary/80", children: "Filter summary:" }),
23712
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1 bg-surface border border-border px-2.5 py-1 rounded-lg font-mono text-[11px] text-primary", children: [
23713
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-2 h-2 rounded-full bg-emerald-400" }),
23714
+ connectedCount,
23715
+ " Connected"
23716
+ ] }),
23717
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1 bg-surface border border-border px-2.5 py-1 rounded-lg font-mono text-[11px] text-secondary", children: [
23718
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-2 h-2 rounded-full bg-secondary/50" }),
23719
+ notClonedCount,
23720
+ " Not Cloned"
23721
+ ] }),
23722
+ missingCount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1 bg-danger/10 border border-danger/30 px-2.5 py-1 rounded-lg font-mono text-[11px] text-danger", children: [
23723
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-2 h-2 rounded-full bg-danger animate-pulse" }),
23724
+ missingCount,
23725
+ " Missing Folder"
23726
+ ] })
23727
+ ] }),
23728
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto pr-1 pb-4 custom-scrollbar min-h-0", children: collaboratedRepos.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-16 px-6 border border-dashed border-border rounded-2xl bg-surface/30 max-w-lg mx-auto my-8", children: [
23729
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-16 h-16 mx-auto mb-4 rounded-2xl bg-brand/10 border border-brand/20 flex items-center justify-center text-3xl", children: "🤝" }),
23730
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-base font-bold text-primary mb-1.5", children: "No Collaboration Repositories Found" }),
23731
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-secondary leading-relaxed mb-5 max-w-sm mx-auto", children: "You do not have any external collaboration repositories yet. When someone invites you as a collaborator or you invite someone to your repository, it will automatically appear here." }),
23732
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
23733
+ "button",
23734
+ {
23735
+ onClick: onRefresh,
23736
+ disabled: isRefreshing,
23737
+ className: "px-4 py-2 bg-brand hover:bg-brand-hover text-white text-xs font-semibold rounded-xl transition-all shadow-sm flex items-center gap-2 mx-auto",
23738
+ children: [
23739
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
23740
+ "svg",
23741
+ {
23742
+ className: `w-3.5 h-3.5 ${isRefreshing ? "animate-spin" : ""}`,
23743
+ fill: "none",
23744
+ stroke: "currentColor",
23745
+ viewBox: "0 0 24 24",
23746
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
23747
+ "path",
23748
+ {
23749
+ strokeLinecap: "round",
23750
+ strokeLinejoin: "round",
23751
+ strokeWidth: 2,
23752
+ d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
23753
+ }
23754
+ )
23755
+ }
23756
+ ),
23757
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Refresh from GitHub" })
23758
+ ]
23759
+ }
23760
+ )
23761
+ ] }) : filteredRepos.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-12 px-6 border border-dashed border-border rounded-2xl bg-surface/20 max-w-md mx-auto my-8", children: [
23762
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-2xl mb-2", children: "🔍" }),
23763
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-semibold text-primary mb-1", children: "No matches found" }),
23764
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-secondary mb-4", children: [
23765
+ "No repository matches ",
23766
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-semibold text-primary", children: [
23767
+ '"',
23768
+ collabSearch,
23769
+ '"'
23770
+ ] })
23771
+ ] }),
23772
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
23773
+ "button",
23774
+ {
23775
+ onClick: () => setCollabSearch(""),
23776
+ className: "px-3.5 py-1.5 bg-surface hover:bg-surface-hover border border-border text-primary text-xs font-medium rounded-lg transition-colors",
23777
+ children: "Clear Search Filter"
23778
+ }
23779
+ )
23780
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 2xl:grid-cols-3 gap-4", children: filteredRepos.map((repo) => {
23781
+ const savedPath = collabMappings[repo.full_name];
23782
+ const isMissing = savedPath && pathExistenceMap[repo.full_name] === false;
23783
+ const isCurrentActive = currentRepoPath && savedPath && currentRepoPath.toLowerCase() === savedPath.toLowerCase();
23784
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
23785
+ "div",
23786
+ {
23787
+ onClick: () => onRepoCardClick(repo),
23788
+ className: `group relative rounded-2xl border p-4 sm:p-5 flex flex-col justify-between gap-3.5 transition-all duration-200 cursor-pointer min-w-0 ${isCurrentActive ? "bg-brand/10 border-brand shadow-md ring-1 ring-brand/40" : "bg-surface/75 hover:bg-surface border-border hover:border-brand/40 shadow-xs hover:shadow-md"}`,
23789
+ children: [
23790
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3 min-w-0", children: [
23791
+ repo.owner?.avatar_url ? /* @__PURE__ */ jsxRuntimeExports.jsx(
23792
+ "img",
23793
+ {
23794
+ src: repo.owner.avatar_url,
23795
+ alt: repo.owner.login,
23796
+ className: "w-10 h-10 rounded-xl border border-border/80 flex-shrink-0 object-cover bg-canvas shadow-xs mt-0.5"
23797
+ }
23798
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 rounded-xl bg-canvas border border-border/80 flex items-center justify-center text-xs font-bold text-secondary flex-shrink-0 mt-0.5", children: repo.owner?.login ? repo.owner.login.slice(0, 2).toUpperCase() : "GH" }),
23799
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
23800
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5 flex-wrap min-w-0", children: [
23801
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
23802
+ "span",
23803
+ {
23804
+ className: "text-sm font-bold text-primary group-hover:text-brand transition-colors truncate max-w-[220px]",
23805
+ title: repo.name,
23806
+ children: repo.name
23807
+ }
23808
+ ),
23809
+ repo.private ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-amber-500/10 text-amber-400 border border-amber-500/25 px-2 py-0.2 rounded-full font-medium flex-shrink-0", children: "Private" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-emerald-500/10 text-emerald-400 border border-emerald-500/25 px-2 py-0.2 rounded-full font-medium flex-shrink-0", children: "Public" }),
23810
+ isCurrentActive && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[9px] bg-brand text-white px-2 py-0.5 rounded-full font-bold uppercase tracking-wider flex-shrink-0 shadow-xs", children: "Active" })
23811
+ ] }),
23812
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mt-1 text-xs text-secondary min-w-0 flex-wrap", children: [
23813
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-mono text-secondary truncate max-w-[140px]", title: `@${repo.owner?.login}`, children: [
23814
+ "@",
23815
+ repo.owner?.login
23816
+ ] }),
23817
+ repo.default_branch && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[10px] font-mono bg-surface-hover text-secondary border border-border/60 px-1.5 py-0.5 rounded flex items-center gap-1 flex-shrink-0", children: [
23818
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "🌿" }),
23819
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate max-w-[90px]", children: repo.default_branch })
23820
+ ] }),
23821
+ repo.language && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[10px] font-medium text-secondary/70 flex items-center gap-1 flex-shrink-0", children: [
23822
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-brand/60" }),
23823
+ repo.language
23824
+ ] })
23825
+ ] })
23826
+ ] }),
23827
+ repo.html_url && /* @__PURE__ */ jsxRuntimeExports.jsx(
23828
+ "button",
23829
+ {
23830
+ type: "button",
23831
+ onClick: (e) => {
23832
+ e.stopPropagation();
23833
+ onOpenExternal(repo.html_url);
23834
+ },
23835
+ className: "p-1.5 rounded-lg text-secondary hover:text-primary hover:bg-surface-hover transition-colors flex-shrink-0 opacity-70 group-hover:opacity-100",
23836
+ title: "Open on GitHub",
23837
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.205 11.387.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 21.795 24 17.298 24 12c0-6.627-5.373-12-12-12z" }) })
23838
+ }
23839
+ )
23840
+ ] }),
23841
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-secondary line-clamp-2 min-h-[34px] break-words leading-relaxed", children: repo.description || /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "italic text-secondary/50", children: "No repository description provided." }) }),
23842
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t border-border/60 pt-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2.5 min-w-0", children: [
23843
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-0 flex-1", children: savedPath ? isMissing ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
23844
+ "div",
23845
+ {
23846
+ className: "inline-flex items-center gap-1.5 text-xs text-danger font-mono bg-danger/10 border border-danger/25 px-2.5 py-1 rounded-lg min-w-0 max-w-full truncate",
23847
+ title: `Folder was deleted or moved: ${savedPath}`,
23848
+ children: [
23849
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-danger animate-pulse flex-shrink-0" }),
23850
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: "Folder missing on disk" })
23851
+ ]
23852
+ }
23853
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
23854
+ "div",
23855
+ {
23856
+ className: "inline-flex items-center gap-1.5 text-xs text-emerald-400 font-mono bg-emerald-500/10 border border-emerald-500/25 px-2.5 py-1 rounded-lg min-w-0 max-w-full truncate",
23857
+ title: savedPath,
23858
+ children: [
23859
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400 flex-shrink-0" }),
23860
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: savedPath.split("\\").pop() || savedPath })
23861
+ ]
23862
+ }
23863
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "inline-flex items-center gap-1.5 text-xs text-secondary/70 italic bg-canvas/60 border border-border/60 px-2.5 py-1 rounded-lg flex-shrink-0", children: [
23864
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-secondary/40" }),
23865
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Not cloned yet" })
23866
+ ] }) }),
23867
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2 flex-shrink-0 self-end sm:self-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
23868
+ "button",
23869
+ {
23870
+ type: "button",
23871
+ onClick: (e) => {
23872
+ e.stopPropagation();
23873
+ onRepoCardClick(repo);
23874
+ },
23875
+ className: `px-3.5 py-1.5 text-xs font-semibold rounded-xl transition-all shadow-xs flex items-center gap-1.5 ${savedPath ? isMissing ? "bg-danger/20 hover:bg-danger/30 text-danger border border-danger/40" : "bg-brand hover:bg-brand-hover text-white shadow-brand/20" : "bg-brand hover:bg-brand-hover text-white shadow-brand/20"}`,
23876
+ children: [
23877
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: savedPath ? isMissing ? "Re-Clone" : "Open Repo" : "Clone / Connect" }),
23878
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: isMissing ? "☁️" : savedPath ? "→" : "☁️" })
23879
+ ]
23880
+ }
23881
+ ) })
23882
+ ] })
23883
+ ]
23884
+ },
23885
+ repo.id
23886
+ );
23887
+ }) }) })
23888
+ ] });
23889
+ };
23592
23890
  const translations = {
23593
23891
  en: {
23594
23892
  settings: "Settings",
@@ -24247,11 +24545,6 @@ function App() {
24247
24545
  window.api.getCliRepo().then((cliRepoPath) => {
24248
24546
  if (cliRepoPath) {
24249
24547
  loadRepo(cliRepoPath);
24250
- } else {
24251
- const lastRepo = localStorage.getItem("gitelectron-last-repo");
24252
- if (lastRepo) {
24253
- loadRepo(lastRepo);
24254
- }
24255
24548
  }
24256
24549
  });
24257
24550
  }, []);
@@ -24352,6 +24645,19 @@ function App() {
24352
24645
  await refreshRepoState();
24353
24646
  setChangesTab("changes");
24354
24647
  };
24648
+ const handleCollabRefresh = async () => {
24649
+ showToast("Refreshing collaboration repositories...", "info");
24650
+ try {
24651
+ setIsRefreshing(true);
24652
+ const repos = await window.api.getCollaboratedRepos();
24653
+ setCollaboratedRepos(repos || []);
24654
+ showToast(`Loaded ${repos?.length || 0} collaboration repository(ies)`, "success");
24655
+ } catch (e) {
24656
+ showToast(`Failed to refresh: ${e.message || e}`, "error");
24657
+ } finally {
24658
+ setIsRefreshing(false);
24659
+ }
24660
+ };
24355
24661
  const handleRepoCardClick = async (repo) => {
24356
24662
  const savedPath = collabMappings[repo.full_name];
24357
24663
  if (savedPath) {
@@ -24400,15 +24706,21 @@ function App() {
24400
24706
  };
24401
24707
  const handleCollabClone = async () => {
24402
24708
  if (!showCollabActionModal) return;
24403
- const { url, name, fullName } = showCollabActionModal;
24709
+ const { url, name, fullName, repo } = showCollabActionModal;
24404
24710
  setShowCollabActionModal(null);
24711
+ const cloneUrl = url || repo?.clone_url || repo?.html_url || (fullName ? `https://github.com/${fullName}.git` : "");
24712
+ if (!cloneUrl) {
24713
+ showToast("Could not resolve clone URL for this repository", "error");
24714
+ return;
24715
+ }
24405
24716
  try {
24406
24717
  const result = await window.api.selectDirectory();
24407
24718
  if (!result) return;
24719
+ const repoName = name || repo?.name || (fullName ? fullName.split("/").pop() : "repository");
24408
24720
  const selectedBasename = result.path.replace(/\\/g, "/").split("/").pop();
24409
- const destPath = selectedBasename?.toLowerCase() === name.toLowerCase() ? result.path : `${result.path}\\${name}`;
24721
+ const destPath = selectedBasename?.toLowerCase() === repoName.toLowerCase() ? result.path : `${result.path}\\${repoName}`;
24410
24722
  setIsCloning(true);
24411
- const clonedPath = await window.api.cloneRepository(url, destPath);
24723
+ const clonedPath = await window.api.cloneRepository(cloneUrl, destPath);
24412
24724
  if (fullName) {
24413
24725
  saveMapping(fullName, clonedPath);
24414
24726
  }
@@ -24416,7 +24728,7 @@ function App() {
24416
24728
  showToast(`Repository successfully cloned into ${clonedPath}!`, "success");
24417
24729
  } catch (err) {
24418
24730
  console.error(err);
24419
- showToast(`Failed to clone repository: ${err.message || err}`, "error");
24731
+ showToast(`Failed to clone: ${err.message || err}`, "error");
24420
24732
  } finally {
24421
24733
  setIsCloning(false);
24422
24734
  }
@@ -25643,11 +25955,11 @@ function App() {
25643
25955
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
25644
25956
  }
25645
25957
  ),
25646
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
25647
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 rounded-xl bg-brand/10 border border-brand/20 flex items-center justify-center text-brand", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" }) }) }),
25648
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
25649
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-bold text-primary tracking-tight", children: "Collaboration Repository" }),
25650
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-secondary font-mono truncate max-w-[300px]", children: showCollabActionModal.fullName || showCollabActionModal.name })
25958
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 pr-8 min-w-0", children: [
25959
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 rounded-xl bg-brand/10 border border-brand/20 flex items-center justify-center text-brand flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" }) }) }),
25960
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
25961
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-base font-bold text-primary tracking-tight truncate", children: "Collaboration Repository" }),
25962
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-secondary font-mono truncate max-w-full", children: showCollabActionModal.fullName || showCollabActionModal.name })
25651
25963
  ] })
25652
25964
  ] }),
25653
25965
  showCollabActionModal.missingPreviousPath ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-3.5 bg-danger/10 border border-danger/30 rounded-xl text-danger text-xs flex items-start gap-2.5", children: [
@@ -26579,165 +26891,286 @@ function App() {
26579
26891
  )
26580
26892
  ] })
26581
26893
  ] }),
26582
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-hidden flex flex-col lg:flex-row gap-6 pb-2", children: [
26583
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 bg-surface/70 backdrop-blur-md rounded-xl border border-border flex flex-col transition-colors duration-300 overflow-hidden", children: [
26584
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center border-b border-border px-4 pt-3 gap-1", children: [
26585
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26586
- "button",
26587
- {
26588
- onClick: () => setChangesTab("changes"),
26589
- className: `text-xs font-semibold px-3 py-1.5 rounded-t-md transition-colors border-b-2 ${changesTab === "changes" ? "text-primary border-accent bg-canvas/50" : "text-secondary border-transparent hover:text-primary"}`,
26590
- children: [
26591
- "Changes",
26592
- status.not_added.length + status.modified.length + status.created.length + status.conflicted.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1.5 bg-accent/20 text-accent text-[10px] font-bold px-1.5 py-0.5 rounded-full", children: status.not_added.length + status.modified.length + status.created.length + status.conflicted.length })
26593
- ]
26594
- }
26595
- ),
26596
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26597
- "button",
26598
- {
26599
- onClick: () => setChangesTab("deleted"),
26600
- className: `text-xs font-semibold px-3 py-1.5 rounded-t-md transition-colors border-b-2 ${changesTab === "deleted" ? "text-primary border-danger bg-canvas/50" : "text-secondary border-transparent hover:text-primary"}`,
26601
- children: [
26602
- "Deleted",
26603
- status.deleted.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1.5 bg-danger/20 text-danger text-[10px] font-bold px-1.5 py-0.5 rounded-full", children: status.deleted.length })
26604
- ]
26605
- }
26606
- ),
26607
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26608
- "button",
26609
- {
26610
- onClick: () => {
26611
- setChangesTab("collaboration-repo");
26612
- window.api.getCollaboratedRepos().then((repos) => setCollaboratedRepos(repos || [])).catch(() => {
26613
- });
26614
- },
26615
- className: `text-xs font-semibold px-3 py-1.5 rounded-t-md transition-colors border-b-2 ${changesTab === "collaboration-repo" ? "text-primary border-brand bg-canvas/50" : "text-secondary border-transparent hover:text-primary"}`,
26616
- children: [
26617
- "Collaboration Repo",
26618
- collaboratedRepos.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1.5 bg-brand/20 text-brand text-[10px] font-bold px-1.5 py-0.5 rounded-full", children: collaboratedRepos.length })
26619
- ]
26620
- }
26621
- ),
26622
- changesTab === "changes" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ml-auto flex items-center gap-2 mb-1", children: [
26894
+ changesTab === "collaboration-repo" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 bg-surface/70 backdrop-blur-md rounded-2xl border border-border flex flex-col transition-colors duration-300 overflow-hidden p-4 sm:p-5 min-w-0", children: [
26895
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center border-b border-border pb-3 mb-4 gap-2 flex-shrink-0", children: [
26896
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
26897
+ "button",
26898
+ {
26899
+ onClick: () => setChangesTab("changes"),
26900
+ className: "text-xs font-semibold px-3 py-1.5 rounded-lg text-secondary hover:text-primary hover:bg-surface-hover transition-colors flex items-center gap-1.5",
26901
+ children: [
26902
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "←" }),
26903
+ " Changes"
26904
+ ]
26905
+ }
26906
+ ),
26907
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26908
+ "button",
26909
+ {
26910
+ onClick: () => setChangesTab("deleted"),
26911
+ className: "text-xs font-semibold px-3 py-1.5 rounded-lg text-secondary hover:text-primary hover:bg-surface-hover transition-colors",
26912
+ children: "Deleted"
26913
+ }
26914
+ ),
26915
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-auto text-xs font-bold text-brand bg-brand/10 border border-brand/20 px-3 py-1 rounded-full", children: "Collaboration Repo" })
26916
+ ] }),
26917
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26918
+ CollaborationRepoView,
26919
+ {
26920
+ collaboratedRepos,
26921
+ collabMappings,
26922
+ pathExistenceMap,
26923
+ collabSearch,
26924
+ setCollabSearch,
26925
+ currentRepoPath: repoPath,
26926
+ onRepoCardClick: handleRepoCardClick,
26927
+ onRefresh: handleCollabRefresh,
26928
+ isRefreshing,
26929
+ onOpenExternal: (url) => window.api.openExternal(url)
26930
+ }
26931
+ )
26932
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
26933
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-hidden flex flex-col lg:flex-row gap-6 pb-2", children: [
26934
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 bg-surface/70 backdrop-blur-md rounded-xl border border-border flex flex-col transition-colors duration-300 overflow-hidden", children: [
26935
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center border-b border-border px-4 pt-3 gap-1", children: [
26623
26936
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
26624
26937
  "button",
26625
26938
  {
26626
- onClick: handleUploadFiles,
26627
- disabled: !repoPath || isUploading,
26628
- className: "text-xs bg-brand/10 hover:bg-brand/20 text-brand border border-brand/30 px-2.5 py-1 rounded-md transition-all flex items-center gap-1.5 font-medium shadow-sm disabled:opacity-50",
26629
- title: "Upload files directly into this repository",
26939
+ onClick: () => setChangesTab("changes"),
26940
+ className: `text-xs font-semibold px-3 py-1.5 rounded-t-md transition-colors border-b-2 ${changesTab === "changes" ? "text-primary border-accent bg-canvas/50" : "text-secondary border-transparent hover:text-primary"}`,
26630
26941
  children: [
26631
- /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-3.5 h-3.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" }) }),
26632
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: isUploading ? "Uploading..." : "Upload Files" })
26942
+ "Changes",
26943
+ status.not_added.length + status.modified.length + status.created.length + status.conflicted.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1.5 bg-accent/20 text-accent text-[10px] font-bold px-1.5 py-0.5 rounded-full", children: status.not_added.length + status.modified.length + status.created.length + status.conflicted.length })
26633
26944
  ]
26634
26945
  }
26635
26946
  ),
26636
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26947
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
26637
26948
  "button",
26638
26949
  {
26639
- onClick: handleStageAll,
26640
- className: "text-xs bg-surface-hover text-primary px-2.5 py-1 rounded-md transition-colors border border-border hover:brightness-110",
26641
- children: "Stage All"
26950
+ onClick: () => setChangesTab("deleted"),
26951
+ className: `text-xs font-semibold px-3 py-1.5 rounded-t-md transition-colors border-b-2 ${changesTab === "deleted" ? "text-primary border-danger bg-canvas/50" : "text-secondary border-transparent hover:text-primary"}`,
26952
+ children: [
26953
+ "Deleted",
26954
+ status.deleted.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1.5 bg-danger/20 text-danger text-[10px] font-bold px-1.5 py-0.5 rounded-full", children: status.deleted.length })
26955
+ ]
26642
26956
  }
26643
- )
26644
- ] })
26645
- ] }),
26646
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-auto p-4 custom-scrollbar", children: [
26647
- changesTab === "changes" && /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-1", children: [
26648
- status.conflicted.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26649
- "li",
26957
+ ),
26958
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
26959
+ "button",
26650
26960
  {
26651
- className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
26961
+ onClick: () => {
26962
+ setChangesTab("collaboration-repo");
26963
+ window.api.getCollaboratedRepos().then((repos) => setCollaboratedRepos(repos || [])).catch(() => {
26964
+ });
26965
+ },
26966
+ className: `text-xs font-semibold px-3 py-1.5 rounded-t-md transition-colors border-b-2 ${changesTab === "collaboration-repo" ? "text-primary border-brand bg-canvas/50" : "text-secondary border-transparent hover:text-primary"}`,
26652
26967
  children: [
26653
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26654
- "span",
26655
- {
26656
- onClick: () => viewDiff(f, false),
26657
- className: "text-xs text-warning font-mono cursor-pointer flex-1 flex items-center gap-1.5 truncate",
26658
- children: [
26659
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 text-[10px] font-bold bg-warning/20 text-warning border border-warning/30 px-1 rounded", children: "!" }),
26660
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
26661
- ]
26662
- }
26663
- ),
26664
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: [
26665
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26666
- "button",
26968
+ "Collaboration Repo",
26969
+ collaboratedRepos.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1.5 bg-brand/20 text-brand text-[10px] font-bold px-1.5 py-0.5 rounded-full", children: collaboratedRepos.length })
26970
+ ]
26971
+ }
26972
+ ),
26973
+ changesTab === "changes" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ml-auto flex items-center gap-2 mb-1", children: [
26974
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
26975
+ "button",
26976
+ {
26977
+ onClick: handleUploadFiles,
26978
+ disabled: !repoPath || isUploading,
26979
+ className: "text-xs bg-brand/10 hover:bg-brand/20 text-brand border border-brand/30 px-2.5 py-1 rounded-md transition-all flex items-center gap-1.5 font-medium shadow-sm disabled:opacity-50",
26980
+ title: "Upload files directly into this repository",
26981
+ children: [
26982
+ /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-3.5 h-3.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" }) }),
26983
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: isUploading ? "Uploading..." : "Upload Files" })
26984
+ ]
26985
+ }
26986
+ ),
26987
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26988
+ "button",
26989
+ {
26990
+ onClick: handleStageAll,
26991
+ className: "text-xs bg-surface-hover text-primary px-2.5 py-1 rounded-md transition-colors border border-border hover:brightness-110",
26992
+ children: "Stage All"
26993
+ }
26994
+ )
26995
+ ] })
26996
+ ] }),
26997
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-auto p-4 custom-scrollbar", children: [
26998
+ changesTab === "changes" && /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-1", children: [
26999
+ status.conflicted.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
27000
+ "li",
27001
+ {
27002
+ className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
27003
+ children: [
27004
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
27005
+ "span",
26667
27006
  {
26668
- onClick: () => openEditor(f),
26669
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26670
- children: "Edit"
27007
+ onClick: () => viewDiff(f, false),
27008
+ className: "text-xs text-warning font-mono cursor-pointer flex-1 flex items-center gap-1.5 truncate",
27009
+ children: [
27010
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 text-[10px] font-bold bg-warning/20 text-warning border border-warning/30 px-1 rounded", children: "!" }),
27011
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
27012
+ ]
26671
27013
  }
26672
27014
  ),
26673
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26674
- "button",
27015
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: [
27016
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27017
+ "button",
27018
+ {
27019
+ onClick: () => openEditor(f),
27020
+ className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
27021
+ children: "Edit"
27022
+ }
27023
+ ),
27024
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27025
+ "button",
27026
+ {
27027
+ onClick: () => handleStageSingle(f),
27028
+ className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
27029
+ children: "+"
27030
+ }
27031
+ )
27032
+ ] })
27033
+ ]
27034
+ },
27035
+ `c-${f}`
27036
+ )),
27037
+ status.not_added.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
27038
+ "li",
27039
+ {
27040
+ className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
27041
+ children: [
27042
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
27043
+ "span",
26675
27044
  {
26676
- onClick: () => handleStageSingle(f),
26677
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26678
- children: "+"
27045
+ onClick: () => viewDiff(f, false),
27046
+ className: "text-xs text-success font-mono cursor-pointer flex-1 flex items-center gap-1.5 truncate",
27047
+ children: [
27048
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 text-[10px] font-bold bg-success/20 text-success border border-success/30 px-1 rounded", children: "U" }),
27049
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
27050
+ ]
26679
27051
  }
26680
- )
26681
- ] })
26682
- ]
26683
- },
26684
- `c-${f}`
26685
- )),
26686
- status.not_added.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26687
- "li",
26688
- {
26689
- className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
26690
- children: [
26691
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26692
- "span",
26693
- {
26694
- onClick: () => viewDiff(f, false),
26695
- className: "text-xs text-success font-mono cursor-pointer flex-1 flex items-center gap-1.5 truncate",
26696
- children: [
26697
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 text-[10px] font-bold bg-success/20 text-success border border-success/30 px-1 rounded", children: "U" }),
26698
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
26699
- ]
26700
- }
26701
- ),
26702
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: [
26703
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26704
- "button",
27052
+ ),
27053
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: [
27054
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27055
+ "button",
27056
+ {
27057
+ onClick: () => openEditor(f),
27058
+ className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
27059
+ children: "Edit"
27060
+ }
27061
+ ),
27062
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27063
+ "button",
27064
+ {
27065
+ onClick: () => handleStageSingle(f),
27066
+ className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
27067
+ children: "+"
27068
+ }
27069
+ )
27070
+ ] })
27071
+ ]
27072
+ },
27073
+ `u-${f}`
27074
+ )),
27075
+ status.modified.filter((f) => !status.conflicted.includes(f)).map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
27076
+ "li",
27077
+ {
27078
+ className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
27079
+ children: [
27080
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
27081
+ "span",
26705
27082
  {
26706
- onClick: () => openEditor(f),
26707
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26708
- children: "Edit"
27083
+ onClick: () => viewDiff(f, false),
27084
+ className: "text-xs text-warning font-mono cursor-pointer flex-1 flex items-center gap-1.5 truncate",
27085
+ children: [
27086
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 text-[10px] font-bold bg-warning/20 text-warning border border-warning/30 px-1 rounded", children: "M" }),
27087
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
27088
+ ]
26709
27089
  }
26710
27090
  ),
26711
- /* @__PURE__ */ jsxRuntimeExports.jsx(
27091
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: [
27092
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27093
+ "button",
27094
+ {
27095
+ onClick: () => openEditor(f),
27096
+ className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
27097
+ children: "Edit"
27098
+ }
27099
+ ),
27100
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27101
+ "button",
27102
+ {
27103
+ onClick: () => handleStageSingle(f),
27104
+ className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
27105
+ children: "+"
27106
+ }
27107
+ )
27108
+ ] })
27109
+ ]
27110
+ },
27111
+ `m-${f}`
27112
+ )),
27113
+ status.not_added.length + status.modified.length + status.created.length + status.conflicted.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "text-xs text-secondary italic mt-2 text-center", children: "No working tree changes" })
27114
+ ] }),
27115
+ changesTab === "deleted" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
27116
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-1", children: status.deleted.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "text-xs text-secondary italic mt-2 text-center", children: "No locally deleted files" }) : status.deleted.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
27117
+ "li",
27118
+ {
27119
+ className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md transition-colors",
27120
+ children: [
27121
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-danger/70 font-mono flex-1 flex items-center gap-1.5 truncate", children: [
27122
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 text-[10px] font-bold bg-danger/20 text-danger border border-danger/30 px-1 rounded", children: "D" }),
27123
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
27124
+ ] }),
27125
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
26712
27126
  "button",
26713
27127
  {
26714
27128
  onClick: () => handleStageSingle(f),
26715
27129
  className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26716
27130
  children: "+"
26717
27131
  }
26718
- )
26719
- ] })
26720
- ]
26721
- },
26722
- `u-${f}`
26723
- )),
26724
- status.modified.filter((f) => !status.conflicted.includes(f)).map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
27132
+ ) })
27133
+ ]
27134
+ },
27135
+ `d-${f}`
27136
+ )) }),
27137
+ deletedHistory?.all && deletedHistory.all.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 pt-3 border-t border-border/50", children: [
27138
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[11px] font-semibold text-secondary uppercase tracking-wider mb-2", children: "Recently Deleted in Repository" }),
27139
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-2", children: deletedHistory.all.map((commit) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "bg-surface/50 p-2 rounded-md border border-border/50", children: [
27140
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-start mb-1.5", children: [
27141
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-semibold text-primary truncate", title: commit.message, children: commit.message }),
27142
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[10px] text-secondary whitespace-nowrap ml-2 flex-shrink-0", children: [
27143
+ new Date(commit.date).toLocaleDateString(),
27144
+ " ",
27145
+ new Date(commit.date).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })
27146
+ ] })
27147
+ ] }),
27148
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-1", children: commit.diff?.files?.filter((f) => f.status === "D").map((f, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5 text-[11px] font-mono text-danger/80", children: [
27149
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 font-bold bg-danger/10 text-danger border border-danger/20 px-1 rounded", children: "D" }),
27150
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", title: f.file, children: f.file })
27151
+ ] }, i)) })
27152
+ ] }, commit.hash)) })
27153
+ ] })
27154
+ ] })
27155
+ ] })
27156
+ ] }),
27157
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 bg-surface/70 backdrop-blur-md rounded-xl p-4 border border-border flex flex-col transition-colors duration-300", children: [
27158
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-semibold mb-4 text-primary text-sm", children: "Staged Changes" }),
27159
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-auto pr-2 custom-scrollbar", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-1", children: [
27160
+ status.staged.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26725
27161
  "li",
26726
27162
  {
26727
27163
  className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
26728
27164
  children: [
26729
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
27165
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26730
27166
  "span",
26731
27167
  {
26732
- onClick: () => viewDiff(f, false),
26733
- className: "text-xs text-warning font-mono cursor-pointer flex-1 flex items-center gap-1.5 truncate",
26734
- children: [
26735
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 text-[10px] font-bold bg-warning/20 text-warning border border-warning/30 px-1 rounded", children: "M" }),
26736
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
26737
- ]
27168
+ onClick: () => viewDiff(f, true),
27169
+ className: "text-xs text-success font-mono cursor-pointer flex-1",
27170
+ children: f
26738
27171
  }
26739
27172
  ),
26740
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: [
27173
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1", children: [
26741
27174
  /* @__PURE__ */ jsxRuntimeExports.jsx(
26742
27175
  "button",
26743
27176
  {
@@ -26749,251 +27182,76 @@ function App() {
26749
27182
  /* @__PURE__ */ jsxRuntimeExports.jsx(
26750
27183
  "button",
26751
27184
  {
26752
- onClick: () => handleStageSingle(f),
26753
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26754
- children: "+"
27185
+ onClick: () => handleUnstageSingle(f),
27186
+ className: "text-[10px] text-secondary hover:text-danger px-2 py-0.5 border border-border rounded bg-canvas",
27187
+ children: "-"
26755
27188
  }
26756
27189
  )
26757
27190
  ] })
26758
27191
  ]
26759
27192
  },
26760
- `m-${f}`
27193
+ f
26761
27194
  )),
26762
- status.not_added.length + status.modified.length + status.created.length + status.conflicted.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "text-xs text-secondary italic mt-2 text-center", children: "No working tree changes" })
26763
- ] }),
26764
- changesTab === "deleted" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
26765
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-1", children: status.deleted.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "text-xs text-secondary italic mt-2 text-center", children: "No locally deleted files" }) : status.deleted.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26766
- "li",
26767
- {
26768
- className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md transition-colors",
26769
- children: [
26770
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-danger/70 font-mono flex-1 flex items-center gap-1.5 truncate", children: [
26771
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 text-[10px] font-bold bg-danger/20 text-danger border border-danger/30 px-1 rounded", children: "D" }),
26772
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
26773
- ] }),
26774
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
26775
- "button",
26776
- {
26777
- onClick: () => handleStageSingle(f),
26778
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26779
- children: "+"
26780
- }
26781
- ) })
26782
- ]
26783
- },
26784
- `d-${f}`
26785
- )) }),
26786
- deletedHistory?.all && deletedHistory.all.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 pt-3 border-t border-border/50", children: [
26787
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[11px] font-semibold text-secondary uppercase tracking-wider mb-2", children: "Recently Deleted in Repository" }),
26788
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-2", children: deletedHistory.all.map((commit) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "bg-surface/50 p-2 rounded-md border border-border/50", children: [
26789
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-start mb-1.5", children: [
26790
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-semibold text-primary truncate", title: commit.message, children: commit.message }),
26791
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[10px] text-secondary whitespace-nowrap ml-2 flex-shrink-0", children: [
26792
- new Date(commit.date).toLocaleDateString(),
26793
- " ",
26794
- new Date(commit.date).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })
26795
- ] })
26796
- ] }),
26797
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-1", children: commit.diff?.files?.filter((f) => f.status === "D").map((f, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5 text-[11px] font-mono text-danger/80", children: [
26798
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 font-bold bg-danger/10 text-danger border border-danger/20 px-1 rounded", children: "D" }),
26799
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", title: f.file, children: f.file })
26800
- ] }, i)) })
26801
- ] }, commit.hash)) })
26802
- ] })
26803
- ] }),
26804
- changesTab === "collaboration-repo" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
26805
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center justify-between gap-3 p-4 bg-brand/10 border border-brand/30 rounded-xl", children: [
26806
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
26807
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 rounded-xl bg-brand/20 border border-brand/30 flex items-center justify-center text-brand", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" }) }) }),
26808
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
26809
- /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-base font-bold text-primary flex items-center gap-2", children: [
26810
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Collaboration Repositories" }),
26811
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs bg-brand/20 text-brand px-2 py-0.5 rounded-full font-semibold", children: collaboratedRepos.length })
26812
- ] }),
26813
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-secondary", children: "All repositories you are collaborating on with teams & other developers" })
26814
- ] })
26815
- ] }),
26816
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
26817
- "button",
26818
- {
26819
- onClick: async () => {
26820
- showToast("Refreshing collaboration repositories...", "info");
26821
- try {
26822
- const repos = await window.api.getCollaboratedRepos();
26823
- setCollaboratedRepos(repos || []);
26824
- showToast(`Found ${repos?.length || 0} collaboration repository(ies)`, "success");
26825
- } catch (e) {
26826
- showToast(`Failed to refresh: ${e.message}`, "error");
26827
- }
26828
- },
26829
- className: "text-xs bg-surface border border-border hover:bg-surface-hover text-primary px-3 py-1.5 rounded-lg transition-colors flex items-center gap-1.5 font-medium shadow-sm",
26830
- title: "Refresh repositories from GitHub",
26831
- children: [
26832
- /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-3.5 h-3.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" }) }),
26833
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Refresh" })
26834
- ]
26835
- }
26836
- ) })
26837
- ] }),
26838
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
26839
- /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-4 h-4 text-secondary absolute left-3 top-2.5 pointer-events-none", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }),
26840
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26841
- "input",
26842
- {
26843
- type: "text",
26844
- value: collabSearch,
26845
- onChange: (e) => setCollabSearch(e.target.value),
26846
- placeholder: "Search collaboration repositories by name or owner...",
26847
- className: "w-full bg-surface border border-border rounded-lg pl-9 pr-3 py-2 text-xs text-primary placeholder-secondary focus:outline-none focus:border-brand focus:ring-1 focus:ring-brand transition-all"
26848
- }
26849
- )
26850
- ] }),
26851
- collaboratedRepos.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-12 border border-dashed border-border rounded-xl bg-surface/30 p-6", children: [
26852
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-3xl mb-2", children: "🤝" }),
26853
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-semibold text-primary mb-1", children: "No Collaboration Repositories Found" }),
26854
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-secondary max-w-sm mx-auto", children: "When someone invites you as a collaborator, you add collaborators to your repository, or you work on team repositories, they will appear here." })
26855
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2.5", children: collaboratedRepos.filter((r) => {
26856
- if (!collabSearch.trim()) return true;
26857
- const q = collabSearch.toLowerCase();
26858
- return r.name?.toLowerCase().includes(q) || r.full_name?.toLowerCase().includes(q) || r.owner?.login?.toLowerCase().includes(q) || r.description && r.description.toLowerCase().includes(q);
26859
- }).map((repo) => {
26860
- const savedPath = collabMappings[repo.full_name];
26861
- const isCurrentActive = repoPath && savedPath && repoPath.toLowerCase() === savedPath.toLowerCase();
26862
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
26863
- "div",
26864
- {
26865
- onClick: () => handleRepoCardClick(repo),
26866
- className: `p-3.5 rounded-xl border transition-all cursor-pointer flex flex-col sm:flex-row sm:items-center justify-between gap-3 ${isCurrentActive ? "bg-brand/10 border-brand shadow-sm" : "bg-surface/60 border-border hover:bg-surface-hover hover:border-border/80"}`,
26867
- children: [
26868
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3", children: [
26869
- repo.owner?.avatar_url && /* @__PURE__ */ jsxRuntimeExports.jsx(
26870
- "img",
26871
- {
26872
- src: repo.owner.avatar_url,
26873
- alt: repo.owner.login,
26874
- className: "w-9 h-9 rounded-lg border border-border flex-shrink-0 mt-0.5 object-cover"
26875
- }
26876
- ),
26877
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
26878
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
26879
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-bold text-primary hover:text-brand transition-colors", children: repo.name }),
26880
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-secondary font-mono", children: [
26881
- "by @",
26882
- repo.owner?.login
26883
- ] }),
26884
- repo.private ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-amber-500/10 text-amber-400 border border-amber-500/20 px-1.5 py-0.2 rounded font-medium", children: "Private" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 px-1.5 py-0.2 rounded font-medium", children: "Public" }),
26885
- isCurrentActive && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-brand text-white px-2 py-0.5 rounded font-bold uppercase tracking-wider", children: "Active" })
26886
- ] }),
26887
- repo.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-secondary line-clamp-1 mt-0.5 max-w-md", children: repo.description }),
26888
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 mt-1.5 text-[11px] text-secondary", children: [
26889
- savedPath ? pathExistenceMap[repo.full_name] === false ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-danger font-mono flex items-center gap-1 truncate max-w-xs", title: `Local folder deleted or moved: ${savedPath}`, children: [
26890
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-danger animate-pulse" }),
26891
- "Deleted: ",
26892
- savedPath
26893
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-emerald-400 font-mono flex items-center gap-1 truncate max-w-xs", title: savedPath, children: [
26894
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400" }),
26895
- savedPath
26896
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-secondary/70 italic flex items-center gap-1", children: [
26897
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-secondary/50" }),
26898
- "Not cloned yet"
26899
- ] }),
26900
- repo.default_branch && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
26901
- "Branch: ",
26902
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-primary", children: repo.default_branch })
26903
- ] })
26904
- ] })
26905
- ] })
26906
- ] }),
26907
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2 self-end sm:self-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
26908
- "button",
26909
- {
26910
- type: "button",
26911
- onClick: (e) => {
26912
- e.stopPropagation();
26913
- handleRepoCardClick(repo);
26914
- },
26915
- className: `px-3.5 py-1.5 text-xs font-semibold rounded-lg transition-all shadow-sm flex items-center gap-1.5 ${savedPath ? pathExistenceMap[repo.full_name] === false ? "bg-danger/20 hover:bg-danger/30 text-danger border border-danger/40" : "bg-brand hover:bg-brand-hover text-white" : "bg-surface hover:bg-surface-hover border border-border text-primary"}`,
26916
- children: [
26917
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: savedPath ? pathExistenceMap[repo.full_name] === false ? "Re-Clone" : "Open Repo" : "Connect / Clone" }),
26918
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: pathExistenceMap[repo.full_name] === false ? "☁️" : "→" })
26919
- ]
26920
- }
26921
- ) })
26922
- ]
26923
- },
26924
- repo.id
26925
- );
26926
- }) })
26927
- ] })
27195
+ status.staged.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "text-xs text-secondary italic mt-2 text-center", children: "No files staged for commit" })
27196
+ ] }) })
26928
27197
  ] })
26929
27198
  ] }),
26930
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 bg-surface/70 backdrop-blur-md rounded-xl p-4 border border-border flex flex-col transition-colors duration-300", children: [
26931
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-semibold mb-4 text-primary text-sm", children: "Staged Changes" }),
26932
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-auto pr-2 custom-scrollbar", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-1", children: [
26933
- status.staged.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26934
- "li",
26935
- {
26936
- className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
26937
- children: [
26938
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26939
- "span",
26940
- {
26941
- onClick: () => viewDiff(f, true),
26942
- className: "text-xs text-success font-mono cursor-pointer flex-1",
26943
- children: f
26944
- }
26945
- ),
26946
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1", children: [
26947
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26948
- "button",
26949
- {
26950
- onClick: () => openEditor(f),
26951
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26952
- children: "Edit"
26953
- }
26954
- ),
26955
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26956
- "button",
26957
- {
26958
- onClick: () => handleUnstageSingle(f),
26959
- className: "text-[10px] text-secondary hover:text-danger px-2 py-0.5 border border-border rounded bg-canvas",
26960
- children: "-"
26961
- }
26962
- )
26963
- ] })
26964
- ]
26965
- },
26966
- f
26967
- )),
26968
- status.staged.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "text-xs text-secondary italic mt-2 text-center", children: "No files staged for commit" })
26969
- ] }) })
26970
- ] })
26971
- ] }),
26972
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 bg-surface/70 backdrop-blur-md p-4 rounded-xl border border-border flex gap-3 items-center transition-colors duration-300", children: [
26973
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26974
- "input",
26975
- {
26976
- type: "text",
26977
- placeholder: "Commit message...",
26978
- className: "flex-1 bg-canvas border border-border rounded-md p-2.5 text-primary focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition-all disabled:opacity-50 text-sm",
26979
- value: commitMessage,
26980
- disabled: !pushPermission,
26981
- onChange: (e) => setCommitMessage(e.target.value),
26982
- onKeyDown: (e) => {
26983
- if (e.key === "Enter") handleCommitClick();
27199
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 bg-surface/70 backdrop-blur-md p-4 rounded-xl border border-border flex gap-3 items-center transition-colors duration-300", children: [
27200
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27201
+ "input",
27202
+ {
27203
+ type: "text",
27204
+ placeholder: "Commit message...",
27205
+ className: "flex-1 bg-canvas border border-border rounded-md p-2.5 text-primary focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition-all disabled:opacity-50 text-sm",
27206
+ value: commitMessage,
27207
+ disabled: !pushPermission,
27208
+ onChange: (e) => setCommitMessage(e.target.value),
27209
+ onKeyDown: (e) => {
27210
+ if (e.key === "Enter") handleCommitClick();
27211
+ }
26984
27212
  }
26985
- }
26986
- ),
26987
- /* @__PURE__ */ jsxRuntimeExports.jsx(
27213
+ ),
27214
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27215
+ "button",
27216
+ {
27217
+ onClick: handleCommitClick,
27218
+ disabled: status.staged.length === 0 || !commitMessage || !pushPermission,
27219
+ className: "px-6 py-2.5 bg-brand hover:bg-brand-hover border border-white/10 disabled:opacity-50 disabled:bg-surface-hover disabled:border-border text-white rounded-md font-semibold transition-all shadow-sm flex items-center justify-center gap-2 text-sm",
27220
+ children: "Commit & Push"
27221
+ }
27222
+ )
27223
+ ] })
27224
+ ] })
27225
+ ] }) : changesTab === "collaboration-repo" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 bg-surface/70 backdrop-blur-md rounded-2xl border border-border flex flex-col transition-colors duration-300 overflow-hidden p-4 sm:p-5 min-w-0", children: [
27226
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between border-b border-border pb-3 mb-4 gap-2 flex-shrink-0", children: [
27227
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
26988
27228
  "button",
26989
27229
  {
26990
- onClick: handleCommitClick,
26991
- disabled: status.staged.length === 0 || !commitMessage || !pushPermission,
26992
- className: "px-6 py-2.5 bg-brand hover:bg-brand-hover border border-white/10 disabled:opacity-50 disabled:bg-surface-hover disabled:border-border text-white rounded-md font-semibold transition-all shadow-sm flex items-center justify-center gap-2 text-sm",
26993
- children: "Commit & Push"
27230
+ onClick: () => setChangesTab("changes"),
27231
+ className: "text-xs font-semibold px-3.5 py-1.5 rounded-xl bg-surface hover:bg-surface-hover text-secondary hover:text-primary border border-border transition-colors flex items-center gap-1.5",
27232
+ children: [
27233
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "←" }),
27234
+ " Back to Workspace"
27235
+ ]
26994
27236
  }
26995
- )
26996
- ] })
27237
+ ),
27238
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-brand bg-brand/10 border border-brand/20 px-3 py-1 rounded-full", children: "Collaboration Hub" }) })
27239
+ ] }),
27240
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27241
+ CollaborationRepoView,
27242
+ {
27243
+ collaboratedRepos,
27244
+ collabMappings,
27245
+ pathExistenceMap,
27246
+ collabSearch,
27247
+ setCollabSearch,
27248
+ currentRepoPath: repoPath,
27249
+ onRepoCardClick: handleRepoCardClick,
27250
+ onRefresh: handleCollabRefresh,
27251
+ isRefreshing,
27252
+ onOpenExternal: (url) => window.api.openExternal(url)
27253
+ }
27254
+ )
26997
27255
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col items-center justify-center text-secondary relative z-10", children: [
26998
27256
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-24 h-24 mb-6 opacity-30 hover:opacity-50 transition-opacity", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: logo, alt: "Logo", className: "w-full h-full drop-shadow-md" }) }),
26999
27257
  repoPath ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [