gitxelectron 1.1.7 → 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.
@@ -13819,14 +13819,19 @@ function ContributorsModal({ onClose, remoteUrl }) {
13819
13819
  const [removingId, setRemovingId] = reactExports.useState(null);
13820
13820
  const [suggestions, setSuggestions] = reactExports.useState([]);
13821
13821
  const [showSuggestions, setShowSuggestions] = reactExports.useState(false);
13822
- const [debounceTimeout, setDebounceTimeout] = reactExports.useState(null);
13822
+ const debounceTimeoutRef = reactExports.useRef(null);
13823
13823
  const fetchData = async () => {
13824
+ if (!remoteUrl) {
13825
+ setLoading(false);
13826
+ setErrorMsg("No remote GitHub repository URL detected for this folder. Please push or add a remote origin first to invite collaborators.");
13827
+ return;
13828
+ }
13824
13829
  try {
13825
13830
  setLoading(true);
13826
13831
  setErrorMsg("");
13827
13832
  const data = await window.api.getCollaborators(remoteUrl);
13828
- setCollaborators(data.collaborators);
13829
- setInvitations(data.invitations);
13833
+ setCollaborators(data.collaborators || []);
13834
+ setInvitations(data.invitations || []);
13830
13835
  setContributors(data.contributors || []);
13831
13836
  } catch (e) {
13832
13837
  setErrorMsg(e.message || "Failed to load collaborators");
@@ -13836,24 +13841,50 @@ function ContributorsModal({ onClose, remoteUrl }) {
13836
13841
  };
13837
13842
  reactExports.useEffect(() => {
13838
13843
  fetchData();
13844
+ return () => {
13845
+ if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);
13846
+ };
13839
13847
  }, []);
13848
+ const handleSelectUser = async (user) => {
13849
+ setNewUsername(user.login);
13850
+ setShowSuggestions(false);
13851
+ setIsSearching(true);
13852
+ setErrorMsg("");
13853
+ try {
13854
+ const fullUser = await window.api.searchGitHubUser(user.login);
13855
+ const targetUser = fullUser || user;
13856
+ const isExisting = collaborators.some((c) => c.login.toLowerCase() === targetUser.login.toLowerCase()) || invitations.some((i) => i.invitee && i.invitee.login.toLowerCase() === targetUser.login.toLowerCase());
13857
+ if (isExisting) {
13858
+ setErrorMsg(`${targetUser.login} is already a collaborator or has a pending invitation.`);
13859
+ setSearchResult(null);
13860
+ } else {
13861
+ setSearchResult(targetUser);
13862
+ }
13863
+ } catch (e) {
13864
+ setErrorMsg(e.message || "Error verifying GitHub account.");
13865
+ } finally {
13866
+ setIsSearching(false);
13867
+ }
13868
+ };
13840
13869
  const handleSearch = async (e) => {
13841
13870
  e.preventDefault();
13842
- if (!newUsername.trim()) return;
13871
+ const query = newUsername.trim();
13872
+ if (!query) return;
13843
13873
  try {
13844
13874
  setIsSearching(true);
13845
13875
  setErrorMsg("");
13846
13876
  setSearchResult(null);
13847
- const user = await window.api.searchGitHubUser(newUsername.trim());
13877
+ setShowSuggestions(false);
13878
+ const user = await window.api.searchGitHubUser(query);
13848
13879
  if (user) {
13849
- const isExisting = collaborators.some((c) => c.login.toLowerCase() === user.login.toLowerCase()) || invitations.some((i) => i.invitee.login.toLowerCase() === user.login.toLowerCase());
13880
+ const isExisting = collaborators.some((c) => c.login.toLowerCase() === user.login.toLowerCase()) || invitations.some((i) => i.invitee && i.invitee.login.toLowerCase() === user.login.toLowerCase());
13850
13881
  if (isExisting) {
13851
13882
  setErrorMsg(`${user.login} is already a collaborator or has a pending invitation.`);
13852
13883
  } else {
13853
13884
  setSearchResult(user);
13854
13885
  }
13855
13886
  } else {
13856
- setErrorMsg("User not found on GitHub.");
13887
+ setErrorMsg(`User '${query}' was not found in GitHub's database.`);
13857
13888
  }
13858
13889
  } catch (e2) {
13859
13890
  setErrorMsg(e2.message || "Error searching user.");
@@ -13861,6 +13892,37 @@ function ContributorsModal({ onClose, remoteUrl }) {
13861
13892
  setIsSearching(false);
13862
13893
  }
13863
13894
  };
13895
+ const handleInputChange = (val) => {
13896
+ setNewUsername(val);
13897
+ setSearchResult(null);
13898
+ setErrorMsg("");
13899
+ if (debounceTimeoutRef.current) {
13900
+ clearTimeout(debounceTimeoutRef.current);
13901
+ }
13902
+ const trimmed = val.trim();
13903
+ if (trimmed) {
13904
+ setShowSuggestions(true);
13905
+ setIsSearching(true);
13906
+ debounceTimeoutRef.current = setTimeout(async () => {
13907
+ try {
13908
+ const users = await window.api.searchGitHubUsers(trimmed);
13909
+ const existingLogins = /* @__PURE__ */ new Set([
13910
+ ...collaborators.map((c) => c.login.toLowerCase()),
13911
+ ...invitations.map((i) => i.invitee ? i.invitee.login.toLowerCase() : "")
13912
+ ]);
13913
+ setSuggestions(users.filter((u) => !existingLogins.has(u.login.toLowerCase())));
13914
+ } catch (err) {
13915
+ console.error("Failed to query GitHub users", err);
13916
+ } finally {
13917
+ setIsSearching(false);
13918
+ }
13919
+ }, 300);
13920
+ } else {
13921
+ setSuggestions([]);
13922
+ setIsSearching(false);
13923
+ setShowSuggestions(false);
13924
+ }
13925
+ };
13864
13926
  const handleAdd = async () => {
13865
13927
  if (!searchResult) return;
13866
13928
  try {
@@ -13913,7 +13975,7 @@ function ContributorsModal({ onClose, remoteUrl }) {
13913
13975
  )
13914
13976
  }
13915
13977
  ),
13916
- "Manage Collaborators"
13978
+ "Collaboration & Contributors"
13917
13979
  ] }),
13918
13980
  /* @__PURE__ */ jsxRuntimeExports.jsx(
13919
13981
  "button",
@@ -13955,7 +14017,10 @@ function ContributorsModal({ onClose, remoteUrl }) {
13955
14017
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: errorMsg })
13956
14018
  ] }),
13957
14019
  /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleSearch, className: "mb-4", children: [
13958
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-secondary mb-2", children: "Invite Collaborator" }),
14020
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium text-secondary mb-2 flex items-center justify-between", children: [
14021
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Invite Collaborator" }),
14022
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[11px] text-brand/80 font-normal", children: "Searches worldwide GitHub users" })
14023
+ ] }),
13959
14024
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
13960
14025
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex-1", children: [
13961
14026
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -13981,62 +14046,53 @@ function ContributorsModal({ onClose, remoteUrl }) {
13981
14046
  {
13982
14047
  type: "text",
13983
14048
  value: newUsername,
13984
- onChange: (e) => {
13985
- const val = e.target.value;
13986
- setNewUsername(val);
13987
- setSearchResult(null);
13988
- setShowSuggestions(true);
13989
- if (debounceTimeout) clearTimeout(debounceTimeout);
13990
- if (val.trim()) {
13991
- setIsSearching(true);
13992
- setDebounceTimeout(
13993
- setTimeout(async () => {
13994
- try {
13995
- setErrorMsg("");
13996
- const users = await window.api.searchGitHubUsers(val.trim());
13997
- const existingLogins = /* @__PURE__ */ new Set([
13998
- ...collaborators.map((c) => c.login.toLowerCase()),
13999
- ...invitations.map((i) => i.invitee.login.toLowerCase())
14000
- ]);
14001
- setSuggestions(users.filter((u) => !existingLogins.has(u.login.toLowerCase())));
14002
- } catch (err) {
14003
- console.error(err);
14004
- } finally {
14005
- setIsSearching(false);
14006
- }
14007
- }, 400)
14008
- );
14009
- } else {
14010
- setSuggestions([]);
14011
- setIsSearching(false);
14012
- setShowSuggestions(false);
14013
- }
14014
- },
14015
- onBlur: () => setTimeout(() => setShowSuggestions(false), 200),
14049
+ onChange: (e) => handleInputChange(e.target.value),
14050
+ onBlur: () => setTimeout(() => setShowSuggestions(false), 250),
14016
14051
  onFocus: () => {
14017
14052
  if (suggestions.length > 0) setShowSuggestions(true);
14018
14053
  },
14019
- placeholder: "GitHub Username",
14054
+ placeholder: "Type GitHub username...",
14020
14055
  className: "w-full bg-surface border border-border rounded-lg pl-9 pr-3 py-2 text-sm text-primary placeholder-secondary focus:outline-none focus:border-brand focus:ring-1 focus:ring-brand transition-all",
14021
14056
  disabled: adding || loading
14022
14057
  }
14023
14058
  ),
14024
- showSuggestions && suggestions.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-full left-0 right-0 mt-1 bg-surface border border-border rounded-lg shadow-xl overflow-hidden z-10 max-h-60 overflow-y-auto", children: suggestions.map((user) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
14025
- "div",
14026
- {
14027
- onClick: () => {
14028
- setNewUsername(user.login);
14029
- setSearchResult(user);
14030
- setShowSuggestions(false);
14059
+ showSuggestions && suggestions.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute top-full left-0 right-0 mt-1 bg-surface border border-border rounded-lg shadow-2xl overflow-hidden z-20 max-h-64 overflow-y-auto custom-scrollbar", children: [
14060
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-3 py-1.5 bg-canvas/80 text-[10px] uppercase font-bold text-secondary tracking-wider border-b border-border flex items-center justify-between", children: [
14061
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Worldwide GitHub Accounts" }),
14062
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
14063
+ suggestions.length,
14064
+ " found"
14065
+ ] })
14066
+ ] }),
14067
+ suggestions.map((user) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
14068
+ "div",
14069
+ {
14070
+ onMouseDown: (e) => {
14071
+ e.preventDefault();
14072
+ handleSelectUser(user);
14073
+ },
14074
+ className: "px-3 py-2.5 flex items-center justify-between hover:bg-brand/10 cursor-pointer transition-colors border-b border-border/50 last:border-b-0 group",
14075
+ children: [
14076
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2.5", children: [
14077
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
14078
+ "img",
14079
+ {
14080
+ src: user.avatar_url,
14081
+ alt: user.login,
14082
+ className: "w-7 h-7 rounded-full bg-canvas object-cover border border-border"
14083
+ }
14084
+ ),
14085
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
14086
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-primary font-medium group-hover:text-brand transition-colors", children: user.login }),
14087
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] text-secondary", children: "Real GitHub Account" })
14088
+ ] })
14089
+ ] }),
14090
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-brand opacity-0 group-hover:opacity-100 transition-opacity font-medium", children: "Select →" })
14091
+ ]
14031
14092
  },
14032
- className: "px-3 py-2 flex items-center gap-3 hover:bg-surface-hover cursor-pointer transition-colors border-b border-border last:border-b-0",
14033
- children: [
14034
- /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: user.avatar_url, alt: user.login, className: "w-6 h-6 rounded-full" }),
14035
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-primary font-medium", children: user.login })
14036
- ]
14037
- },
14038
- user.id
14039
- )) })
14093
+ user.id
14094
+ ))
14095
+ ] })
14040
14096
  ] }),
14041
14097
  /* @__PURE__ */ jsxRuntimeExports.jsx(
14042
14098
  "button",
@@ -14044,7 +14100,7 @@ function ContributorsModal({ onClose, remoteUrl }) {
14044
14100
  type: "submit",
14045
14101
  disabled: !newUsername.trim() || adding || loading || isSearching,
14046
14102
  className: "bg-surface-hover hover:brightness-110 text-primary border border-border px-4 py-2 rounded-lg text-sm font-medium transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",
14047
- children: isSearching ? /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [
14103
+ children: isSearching ? /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className: "w-4 h-4 animate-spin text-brand", fill: "none", viewBox: "0 0 24 24", children: [
14048
14104
  /* @__PURE__ */ jsxRuntimeExports.jsx(
14049
14105
  "circle",
14050
14106
  {
@@ -14069,48 +14125,42 @@ function ContributorsModal({ onClose, remoteUrl }) {
14069
14125
  )
14070
14126
  ] })
14071
14127
  ] }),
14072
- searchResult && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6 p-4 bg-surface border border-brand/30 rounded-lg flex items-center justify-between shadow-sm animate-in fade-in zoom-in-95 duration-200", children: [
14128
+ searchResult && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6 p-4 bg-surface/90 border border-brand/40 rounded-xl flex items-center justify-between shadow-lg animate-in fade-in zoom-in-95 duration-200", children: [
14073
14129
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
14074
14130
  /* @__PURE__ */ jsxRuntimeExports.jsx(
14075
14131
  "img",
14076
14132
  {
14077
14133
  src: searchResult.avatar_url,
14078
14134
  alt: searchResult.login,
14079
- className: "w-10 h-10 rounded-full bg-canvas object-cover"
14135
+ className: "w-12 h-12 rounded-full bg-canvas object-cover border-2 border-brand/40"
14080
14136
  }
14081
14137
  ),
14082
14138
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
14083
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-bold text-primary", children: searchResult.login }),
14084
- searchResult.name && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-secondary", children: searchResult.name })
14139
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
14140
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-bold text-primary", children: searchResult.login }),
14141
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-emerald-500/20 text-emerald-400 border border-emerald-500/30 px-1.5 py-0.5 rounded font-medium flex items-center gap-1", children: "✓ Real GitHub User" })
14142
+ ] }),
14143
+ searchResult.name && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-secondary font-medium", children: searchResult.name }),
14144
+ searchResult.bio && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[11px] text-secondary/80 line-clamp-1 max-w-xs", children: searchResult.bio })
14085
14145
  ] })
14086
14146
  ] }),
14087
14147
  /* @__PURE__ */ jsxRuntimeExports.jsx(
14088
14148
  "button",
14089
14149
  {
14150
+ type: "button",
14090
14151
  onClick: handleAdd,
14091
14152
  disabled: adding,
14092
- className: "bg-brand hover:bg-brand-hover text-white px-4 py-2 rounded-lg text-sm font-medium transition-all disabled:opacity-50 flex items-center gap-2 shadow-sm",
14093
- children: adding ? /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [
14094
- /* @__PURE__ */ jsxRuntimeExports.jsx(
14095
- "circle",
14096
- {
14097
- className: "opacity-25",
14098
- cx: "12",
14099
- cy: "12",
14100
- r: "10",
14101
- stroke: "currentColor",
14102
- strokeWidth: "4"
14103
- }
14104
- ),
14105
- /* @__PURE__ */ jsxRuntimeExports.jsx(
14106
- "path",
14107
- {
14108
- className: "opacity-75",
14109
- fill: "currentColor",
14110
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
14111
- }
14112
- )
14113
- ] }) : "Invite User"
14153
+ className: "bg-brand hover:bg-brand-hover text-white px-4 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50 flex items-center gap-2 shadow-md hover:shadow-brand/20",
14154
+ children: adding ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
14155
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [
14156
+ /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
14157
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
14158
+ ] }),
14159
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Inviting..." })
14160
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
14161
+ /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z" }) }),
14162
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Invite" })
14163
+ ] })
14114
14164
  }
14115
14165
  )
14116
14166
  ] }),
@@ -23539,6 +23589,304 @@ const AuthHoverButton = ({ username }) => {
23539
23589
  ] })
23540
23590
  ] });
23541
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
+ };
23542
23890
  const translations = {
23543
23891
  en: {
23544
23892
  settings: "Settings",
@@ -23900,6 +24248,9 @@ const THEMES = [
23900
24248
  ];
23901
24249
  function App() {
23902
24250
  const [repoPath, setRepoPath] = reactExports.useState(null);
24251
+ const [collaboratedRepos, setCollaboratedRepos] = reactExports.useState([]);
24252
+ const [showCollabActionModal, setShowCollabActionModal] = reactExports.useState(null);
24253
+ const [isCloning, setIsCloning] = reactExports.useState(false);
23903
24254
  reactExports.useEffect(() => {
23904
24255
  const playSusSound = () => {
23905
24256
  const AudioContextClass = window.AudioContext || window.webkitAudioContext;
@@ -24063,6 +24414,16 @@ function App() {
24063
24414
  };
24064
24415
  const [theme, setTheme] = reactExports.useState(localStorage.getItem("gitelectron-theme") || "github-dark");
24065
24416
  const [changesTab, setChangesTab] = reactExports.useState("changes");
24417
+ const [collabSearch, setCollabSearch] = reactExports.useState("");
24418
+ const [collabMappings, setCollabMappings] = reactExports.useState(() => {
24419
+ try {
24420
+ return JSON.parse(localStorage.getItem("gitelectron_collab_mappings") || "{}");
24421
+ } catch {
24422
+ return {};
24423
+ }
24424
+ });
24425
+ const [pathExistenceMap, setPathExistenceMap] = reactExports.useState({});
24426
+ const [isUploading, setIsUploading] = reactExports.useState(false);
24066
24427
  const [showSetupWizard, setShowSetupWizard] = reactExports.useState(false);
24067
24428
  const [pushAllBranches, setPushAllBranches] = reactExports.useState(false);
24068
24429
  const [showUniversalWizard, setShowUniversalWizard] = reactExports.useState(false);
@@ -24088,7 +24449,41 @@ function App() {
24088
24449
  setToasts((prev) => prev.filter((t2) => t2.id !== id2));
24089
24450
  }, 4e3);
24090
24451
  };
24091
- const loadRepo = (targetPath) => {
24452
+ const loadRepo = async (targetPath) => {
24453
+ try {
24454
+ const exists = await window.api.checkPathExists(targetPath);
24455
+ if (!exists) {
24456
+ console.warn("Target path does not exist on disk:", targetPath);
24457
+ const currentMappings = JSON.parse(localStorage.getItem("gitelectron_collab_mappings") || "{}");
24458
+ const matching = Object.entries(currentMappings).find(([_, p]) => p === targetPath);
24459
+ if (matching) {
24460
+ const [fullName] = matching;
24461
+ let repo = collaboratedRepos.find((r) => r.full_name === fullName);
24462
+ if (!repo) {
24463
+ try {
24464
+ const allCollabs = await window.api.getCollaboratedRepos();
24465
+ setCollaboratedRepos(allCollabs);
24466
+ repo = allCollabs.find((r) => r.full_name === fullName);
24467
+ } catch (e) {
24468
+ }
24469
+ }
24470
+ if (repo) {
24471
+ showToast(`The local folder for ${fullName} was deleted. You can re-clone it now.`, "warning");
24472
+ setShowCollabActionModal({
24473
+ repo,
24474
+ url: repo.clone_url,
24475
+ name: repo.name,
24476
+ fullName: repo.full_name,
24477
+ missingPreviousPath: targetPath
24478
+ });
24479
+ setChangesTab("collaboration-repo");
24480
+ return;
24481
+ }
24482
+ }
24483
+ }
24484
+ } catch (e) {
24485
+ console.error("Error checking target path existence:", e);
24486
+ }
24092
24487
  window.api.setRepoPath(targetPath).then(async (result) => {
24093
24488
  if (result) {
24094
24489
  setRepoPath(result.path);
@@ -24103,6 +24498,33 @@ function App() {
24103
24498
  }
24104
24499
  }).catch((err) => console.error("Failed to load repo", err));
24105
24500
  };
24501
+ reactExports.useEffect(() => {
24502
+ const checkAllPaths = async () => {
24503
+ const results = {};
24504
+ for (const [fullName, path] of Object.entries(collabMappings)) {
24505
+ if (path) {
24506
+ try {
24507
+ results[fullName] = await window.api.checkPathExists(path);
24508
+ } catch {
24509
+ results[fullName] = false;
24510
+ }
24511
+ }
24512
+ }
24513
+ setPathExistenceMap(results);
24514
+ };
24515
+ if (changesTab === "collaboration-repo" || collaboratedRepos.length > 0) {
24516
+ checkAllPaths();
24517
+ }
24518
+ }, [collabMappings, changesTab, collaboratedRepos.length]);
24519
+ reactExports.useEffect(() => {
24520
+ if (authStatus.status === "Verified") {
24521
+ window.api.getCollaboratedRepos().then((repos) => {
24522
+ setCollaboratedRepos(repos);
24523
+ }).catch((err) => console.error(err));
24524
+ } else {
24525
+ setCollaboratedRepos([]);
24526
+ }
24527
+ }, [authStatus.status]);
24106
24528
  reactExports.useEffect(() => {
24107
24529
  window.api.getAuthStatus().then((auth) => {
24108
24530
  setAuthStatus(auth);
@@ -24123,11 +24545,6 @@ function App() {
24123
24545
  window.api.getCliRepo().then((cliRepoPath) => {
24124
24546
  if (cliRepoPath) {
24125
24547
  loadRepo(cliRepoPath);
24126
- } else {
24127
- const lastRepo = localStorage.getItem("gitelectron-last-repo");
24128
- if (lastRepo) {
24129
- loadRepo(lastRepo);
24130
- }
24131
24548
  }
24132
24549
  });
24133
24550
  }, []);
@@ -24212,28 +24629,147 @@ function App() {
24212
24629
  setTheme(newTheme);
24213
24630
  localStorage.setItem("gitelectron-theme", newTheme);
24214
24631
  };
24215
- const handleSelectDirectory = async () => {
24632
+ const saveMapping = (repoFullName, localPath) => {
24633
+ setCollabMappings((prev) => {
24634
+ const updated = { ...prev, [repoFullName]: localPath };
24635
+ localStorage.setItem("gitelectron_collab_mappings", JSON.stringify(updated));
24636
+ return updated;
24637
+ });
24638
+ };
24639
+ const openCollabRepoPath = async (targetPath) => {
24640
+ localStorage.setItem("gitelectron-last-repo", targetPath);
24641
+ setRepoPath(targetPath);
24642
+ setIsRepo(true);
24643
+ await window.api.setRepoPath(targetPath);
24644
+ window.api.toggleAutoSync(targetPath, true);
24645
+ await refreshRepoState();
24646
+ setChangesTab("changes");
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
+ };
24661
+ const handleRepoCardClick = async (repo) => {
24662
+ const savedPath = collabMappings[repo.full_name];
24663
+ if (savedPath) {
24664
+ const exists = await window.api.checkPathExists(savedPath);
24665
+ if (exists) {
24666
+ await openCollabRepoPath(savedPath);
24667
+ return;
24668
+ } else {
24669
+ setShowCollabActionModal({
24670
+ repo,
24671
+ url: repo.clone_url,
24672
+ name: repo.name,
24673
+ fullName: repo.full_name,
24674
+ missingPreviousPath: savedPath
24675
+ });
24676
+ return;
24677
+ }
24678
+ }
24679
+ setShowCollabActionModal({
24680
+ repo,
24681
+ url: repo.clone_url,
24682
+ name: repo.name,
24683
+ fullName: repo.full_name
24684
+ });
24685
+ };
24686
+ const handleCollabMap = async () => {
24687
+ if (!showCollabActionModal) return;
24688
+ const { fullName } = showCollabActionModal;
24689
+ setShowCollabActionModal(null);
24216
24690
  const result = await window.api.selectDirectory();
24217
24691
  if (result) {
24692
+ if (fullName) {
24693
+ saveMapping(fullName, result.path);
24694
+ }
24218
24695
  localStorage.setItem("gitelectron-last-repo", result.path);
24219
24696
  setRepoPath(result.path);
24220
24697
  setIsRepo(result.isRepo);
24221
- const dismissed = localStorage.getItem(`gitelectron-wizard-dismissed-${result.path}`) === "true";
24222
- if (!result.isRepo) {
24223
- if (!dismissed) setShowSetupWizard(true);
24224
- } else {
24698
+ if (result.isRepo) {
24699
+ await window.api.setRepoPath(result.path);
24225
24700
  await refreshRepoState();
24701
+ window.api.toggleAutoSync(result.path, true);
24226
24702
  }
24703
+ setChangesTab("changes");
24704
+ showToast(`Linked repository to ${result.path}`, "success");
24227
24705
  }
24228
24706
  };
24229
- const refreshRepoState = async () => {
24230
- setIsRefreshing(true);
24707
+ const handleCollabClone = async () => {
24708
+ if (!showCollabActionModal) return;
24709
+ const { url, name, fullName, repo } = showCollabActionModal;
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
+ }
24231
24716
  try {
24232
- setErrorMsg("");
24233
- const s = await window.api.getStatus();
24234
- setStatus(s);
24235
- if (!branches) {
24236
- setBranches({ current: s.current || "main", all: [] });
24717
+ const result = await window.api.selectDirectory();
24718
+ if (!result) return;
24719
+ const repoName = name || repo?.name || (fullName ? fullName.split("/").pop() : "repository");
24720
+ const selectedBasename = result.path.replace(/\\/g, "/").split("/").pop();
24721
+ const destPath = selectedBasename?.toLowerCase() === repoName.toLowerCase() ? result.path : `${result.path}\\${repoName}`;
24722
+ setIsCloning(true);
24723
+ const clonedPath = await window.api.cloneRepository(cloneUrl, destPath);
24724
+ if (fullName) {
24725
+ saveMapping(fullName, clonedPath);
24726
+ }
24727
+ await openCollabRepoPath(clonedPath);
24728
+ showToast(`Repository successfully cloned into ${clonedPath}!`, "success");
24729
+ } catch (err) {
24730
+ console.error(err);
24731
+ showToast(`Failed to clone: ${err.message || err}`, "error");
24732
+ } finally {
24733
+ setIsCloning(false);
24734
+ }
24735
+ };
24736
+ const handleUploadFiles = async () => {
24737
+ if (!repoPath) return;
24738
+ try {
24739
+ setIsUploading(true);
24740
+ const res = await window.api.uploadFilesToRepo(repoPath);
24741
+ if (res && res.success && res.count > 0) {
24742
+ await refreshRepoState();
24743
+ }
24744
+ } catch (err) {
24745
+ console.error("Failed to upload files", err);
24746
+ alert(`Failed to upload files: ${err.message || err}`);
24747
+ } finally {
24748
+ setIsUploading(false);
24749
+ }
24750
+ };
24751
+ const handleSelectDirectory = async () => {
24752
+ const result = await window.api.selectDirectory();
24753
+ if (result) {
24754
+ localStorage.setItem("gitelectron-last-repo", result.path);
24755
+ setRepoPath(result.path);
24756
+ setIsRepo(result.isRepo);
24757
+ const dismissed = localStorage.getItem(`gitelectron-wizard-dismissed-${result.path}`) === "true";
24758
+ if (!result.isRepo) {
24759
+ if (!dismissed) setShowSetupWizard(true);
24760
+ } else {
24761
+ await refreshRepoState();
24762
+ }
24763
+ }
24764
+ };
24765
+ const refreshRepoState = async () => {
24766
+ setIsRefreshing(true);
24767
+ try {
24768
+ setErrorMsg("");
24769
+ const s = await window.api.getStatus();
24770
+ setStatus(s);
24771
+ if (!branches) {
24772
+ setBranches({ current: s.current || "main", all: [] });
24237
24773
  }
24238
24774
  try {
24239
24775
  const dh = await window.api.getDeletedHistory();
@@ -24307,6 +24843,14 @@ function App() {
24307
24843
  try {
24308
24844
  const collabData = await window.api.getCollaborators(remoteUrl2);
24309
24845
  setRepoCollaborators(collabData.collaborators || []);
24846
+ if (remoteUrl2 && repoPath) {
24847
+ const cleaned = remoteUrl2.replace("https://github.com/", "").replace(/\.git$/, "");
24848
+ saveMapping(cleaned, repoPath);
24849
+ }
24850
+ if (collabData.collaborators?.length > 1 || collabData.invitations?.length > 0) {
24851
+ window.api.getCollaboratedRepos().then((repos) => setCollaboratedRepos(repos || [])).catch(() => {
24852
+ });
24853
+ }
24310
24854
  } catch (e) {
24311
24855
  console.error("Failed to fetch collaborators", e);
24312
24856
  setRepoCollaborators([]);
@@ -24321,6 +24865,31 @@ function App() {
24321
24865
  console.error(e);
24322
24866
  setErrorMsg(e.message || "Error fetching git status");
24323
24867
  setStatus(null);
24868
+ if (repoPath) {
24869
+ try {
24870
+ const exists = await window.api.checkPathExists(repoPath);
24871
+ if (!exists) {
24872
+ const currentMappings = JSON.parse(localStorage.getItem("gitelectron_collab_mappings") || "{}");
24873
+ const matching = Object.entries(currentMappings).find(([_, p]) => p === repoPath);
24874
+ if (matching) {
24875
+ const [fullName] = matching;
24876
+ const repo = collaboratedRepos.find((r) => r.full_name === fullName);
24877
+ if (repo) {
24878
+ showToast(`Repository folder was deleted on disk: ${fullName}. Prompting to re-clone.`, "warning");
24879
+ setShowCollabActionModal({
24880
+ repo,
24881
+ url: repo.clone_url,
24882
+ name: repo.name,
24883
+ fullName: repo.full_name,
24884
+ missingPreviousPath: repoPath
24885
+ });
24886
+ setChangesTab("collaboration-repo");
24887
+ }
24888
+ }
24889
+ }
24890
+ } catch (err) {
24891
+ }
24892
+ }
24324
24893
  } finally {
24325
24894
  setIsRefreshing(false);
24326
24895
  }
@@ -25376,7 +25945,64 @@ function App() {
25376
25945
  onProceed: handleDropProceed
25377
25946
  }
25378
25947
  ),
25379
- showContributorsModal && remoteUrl && /* @__PURE__ */ jsxRuntimeExports.jsx(ContributorsModal, { remoteUrl, onClose: () => setShowContributorsModal(false) }),
25948
+ showContributorsModal && /* @__PURE__ */ jsxRuntimeExports.jsx(ContributorsModal, { remoteUrl: remoteUrl || "", onClose: () => setShowContributorsModal(false) }),
25949
+ showCollabActionModal && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[150] transition-opacity p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-surface/95 backdrop-blur-xl p-6 rounded-2xl shadow-2xl border border-border w-full max-w-[460px] mx-4 flex flex-col gap-4 relative animate-in fade-in zoom-in-95", children: [
25950
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
25951
+ "button",
25952
+ {
25953
+ onClick: () => setShowCollabActionModal(null),
25954
+ className: "absolute top-4 right-4 text-secondary hover:text-primary transition-colors p-1",
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" }) })
25956
+ }
25957
+ ),
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 })
25963
+ ] })
25964
+ ] }),
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: [
25966
+ /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-5 h-5 flex-shrink-0 mt-0.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
25967
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
25968
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-danger", children: "Linked local folder was not found or was deleted:" }),
25969
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-mono text-[10px] break-all opacity-90 mt-0.5", children: showCollabActionModal.missingPreviousPath }),
25970
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-secondary", children: "You can re-clone this repository into a new folder, or select its new location on your computer." })
25971
+ ] })
25972
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-secondary", children: [
25973
+ "How would you like to set up ",
25974
+ /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: showCollabActionModal.name }),
25975
+ " on your computer?"
25976
+ ] }),
25977
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
25978
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
25979
+ "button",
25980
+ {
25981
+ onClick: handleCollabClone,
25982
+ className: "w-full py-3 px-4 bg-brand hover:bg-brand-hover text-white rounded-xl text-sm font-semibold transition-all shadow-md hover:shadow-brand/20 text-left flex items-center justify-between border border-white/10",
25983
+ children: [
25984
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: showCollabActionModal.missingPreviousPath ? "Re-Clone (Git Clone into New Folder)" : "Create (Git Clone)" }),
25985
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-base", children: "☁️" })
25986
+ ]
25987
+ }
25988
+ ),
25989
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
25990
+ "button",
25991
+ {
25992
+ onClick: handleCollabMap,
25993
+ className: "w-full py-3 px-4 bg-surface-hover hover:bg-surface-hover/80 border border-border rounded-xl text-primary text-sm font-medium transition-colors text-left flex items-center justify-between",
25994
+ children: [
25995
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Already have this project folder" }),
25996
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-base", children: "📁" })
25997
+ ]
25998
+ }
25999
+ )
26000
+ ] })
26001
+ ] }) }),
26002
+ isCloning && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute inset-0 bg-black/80 backdrop-blur-sm flex flex-col items-center justify-center z-[200]", children: [
26003
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-12 h-12 border-4 border-brand border-t-transparent rounded-full animate-spin mb-4 shadow-[0_0_15px_rgba(var(--brand-color),0.5)]" }),
26004
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-white font-medium tracking-wide text-lg", children: "Cloning Repository..." })
26005
+ ] }),
25380
26006
  showHealerOverlay && /* @__PURE__ */ jsxRuntimeExports.jsx(AIHealerOverlay, { message: healerMessage, attempt: healerAttempt, maxAttempts: 5, originalError: healerOriginalError }),
25381
26007
  showAutoSyncLogs && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-[110] transition-opacity", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-surface/95 backdrop-blur-xl p-8 rounded-xl shadow-2xl border border-border w-full max-w-[600px] mx-4 flex flex-col max-h-[80vh]", children: [
25382
26008
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-6 border-b border-border pb-4", children: [
@@ -25671,6 +26297,32 @@ function App() {
25671
26297
  }
25672
26298
  )
25673
26299
  ] }),
26300
+ collaboratedRepos.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
26301
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-secondary font-semibold mb-2 uppercase tracking-wider px-1", children: "Collaboration Repo" }),
26302
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 max-h-40 overflow-y-auto pr-1 custom-scrollbar", children: collaboratedRepos.map((repo) => {
26303
+ const saved = collabMappings[repo.full_name];
26304
+ const isMissing = saved && pathExistenceMap[repo.full_name] === false;
26305
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
26306
+ "button",
26307
+ {
26308
+ onClick: () => handleRepoCardClick(repo),
26309
+ className: `w-full text-left bg-canvas hover:bg-surface-hover text-primary py-2 px-3 rounded-md transition-all border text-sm truncate flex flex-col group ${isMissing ? "border-danger/40 bg-danger/5" : "border-border"}`,
26310
+ title: repo.name,
26311
+ children: [
26312
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between w-full", children: [
26313
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium truncate group-hover:text-brand transition-colors", children: repo.name }),
26314
+ isMissing && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[9px] bg-danger/20 text-danger px-1 rounded font-bold", children: "Deleted" })
26315
+ ] }),
26316
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[10px] text-secondary truncate", children: [
26317
+ "by @",
26318
+ repo.owner?.login
26319
+ ] })
26320
+ ]
26321
+ },
26322
+ repo.id
26323
+ );
26324
+ }) })
26325
+ ] }),
25674
26326
  repoPath && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-canvas p-3 rounded-md border border-border mb-4", children: [
25675
26327
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-secondary font-semibold mb-1", children: "LOCAL PATH" }),
25676
26328
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs font-mono text-accent truncate", title: repoPath, children: repoPath.split("\\").pop() })
@@ -25684,6 +26336,35 @@ function App() {
25684
26336
  }
25685
26337
  ),
25686
26338
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-auto space-y-2", children: [
26339
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
26340
+ "button",
26341
+ {
26342
+ onClick: () => setChangesTab("collaboration-repo"),
26343
+ className: `w-full flex items-center py-2 px-3 hover:bg-surface-hover rounded-md text-sm transition-colors group ${changesTab === "collaboration-repo" ? "bg-surface-hover text-primary font-semibold" : "text-secondary hover:text-primary"}`,
26344
+ children: [
26345
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26346
+ "svg",
26347
+ {
26348
+ className: "w-4 h-4 mr-3 text-secondary group-hover:text-primary",
26349
+ fill: "none",
26350
+ stroke: "currentColor",
26351
+ viewBox: "0 0 24 24",
26352
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
26353
+ "path",
26354
+ {
26355
+ strokeLinecap: "round",
26356
+ strokeLinejoin: "round",
26357
+ strokeWidth: 2,
26358
+ 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"
26359
+ }
26360
+ )
26361
+ }
26362
+ ),
26363
+ "Collaboration Repo",
26364
+ collaboratedRepos.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-auto bg-brand/20 text-brand text-[10px] font-bold px-1.5 py-0.5 rounded-full", children: collaboratedRepos.length })
26365
+ ]
26366
+ }
26367
+ ),
25687
26368
  isRepo && /* @__PURE__ */ jsxRuntimeExports.jsxs(
25688
26369
  "button",
25689
26370
  {
@@ -26210,135 +26891,286 @@ function App() {
26210
26891
  )
26211
26892
  ] })
26212
26893
  ] }),
26213
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-hidden flex flex-col lg:flex-row gap-6 pb-2", children: [
26214
- /* @__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: [
26215
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center border-b border-border px-4 pt-3 gap-1", children: [
26216
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26217
- "button",
26218
- {
26219
- onClick: () => setChangesTab("changes"),
26220
- 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"}`,
26221
- children: [
26222
- "Changes",
26223
- 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 })
26224
- ]
26225
- }
26226
- ),
26227
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26228
- "button",
26229
- {
26230
- onClick: () => setChangesTab("deleted"),
26231
- 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"}`,
26232
- children: [
26233
- "Deleted",
26234
- 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 })
26235
- ]
26236
- }
26237
- ),
26238
- changesTab === "changes" && /* @__PURE__ */ jsxRuntimeExports.jsx(
26239
- "button",
26240
- {
26241
- onClick: handleStageAll,
26242
- className: "ml-auto text-xs bg-surface-hover text-primary px-2.5 py-1 rounded-md transition-colors border border-border hover:brightness-110 mb-1",
26243
- children: "Stage All"
26244
- }
26245
- )
26246
- ] }),
26247
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-auto p-4 custom-scrollbar", children: [
26248
- changesTab === "changes" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-1", children: [
26249
- status.conflicted.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26250
- "li",
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: [
26936
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
26937
+ "button",
26251
26938
  {
26252
- className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
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"}`,
26253
26941
  children: [
26254
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26255
- "span",
26256
- {
26257
- onClick: () => viewDiff(f, false),
26258
- className: "text-xs text-warning font-mono cursor-pointer flex-1 flex items-center gap-1.5 truncate",
26259
- children: [
26260
- /* @__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: "!" }),
26261
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
26262
- ]
26263
- }
26264
- ),
26265
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: [
26266
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26267
- "button",
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 })
26944
+ ]
26945
+ }
26946
+ ),
26947
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
26948
+ "button",
26949
+ {
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
+ ]
26956
+ }
26957
+ ),
26958
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
26959
+ "button",
26960
+ {
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"}`,
26967
+ children: [
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",
26268
27006
  {
26269
- onClick: () => openEditor(f),
26270
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26271
- 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
+ ]
26272
27013
  }
26273
27014
  ),
26274
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26275
- "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",
26276
27044
  {
26277
- onClick: () => handleStageSingle(f),
26278
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26279
- 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
+ ]
26280
27051
  }
26281
- )
26282
- ] })
26283
- ]
26284
- },
26285
- `c-${f}`
26286
- )),
26287
- status.not_added.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26288
- "li",
26289
- {
26290
- className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
26291
- children: [
26292
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26293
- "span",
26294
- {
26295
- onClick: () => viewDiff(f, false),
26296
- className: "text-xs text-success font-mono cursor-pointer flex-1 flex items-center gap-1.5 truncate",
26297
- children: [
26298
- /* @__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" }),
26299
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
26300
- ]
26301
- }
26302
- ),
26303
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: [
26304
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26305
- "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",
26306
27082
  {
26307
- onClick: () => openEditor(f),
26308
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26309
- 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
+ ]
26310
27089
  }
26311
27090
  ),
26312
- /* @__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(
26313
27126
  "button",
26314
27127
  {
26315
27128
  onClick: () => handleStageSingle(f),
26316
27129
  className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26317
27130
  children: "+"
26318
27131
  }
26319
- )
26320
- ] })
26321
- ]
26322
- },
26323
- `u-${f}`
26324
- )),
26325
- 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(
26326
27161
  "li",
26327
27162
  {
26328
27163
  className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
26329
27164
  children: [
26330
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
27165
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26331
27166
  "span",
26332
27167
  {
26333
- onClick: () => viewDiff(f, false),
26334
- className: "text-xs text-warning font-mono cursor-pointer flex-1 flex items-center gap-1.5 truncate",
26335
- children: [
26336
- /* @__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" }),
26337
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
26338
- ]
27168
+ onClick: () => viewDiff(f, true),
27169
+ className: "text-xs text-success font-mono cursor-pointer flex-1",
27170
+ children: f
26339
27171
  }
26340
27172
  ),
26341
- /* @__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: [
26342
27174
  /* @__PURE__ */ jsxRuntimeExports.jsx(
26343
27175
  "button",
26344
27176
  {
@@ -26350,124 +27182,76 @@ function App() {
26350
27182
  /* @__PURE__ */ jsxRuntimeExports.jsx(
26351
27183
  "button",
26352
27184
  {
26353
- onClick: () => handleStageSingle(f),
26354
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26355
- 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: "-"
26356
27188
  }
26357
27189
  )
26358
27190
  ] })
26359
27191
  ]
26360
27192
  },
26361
- `m-${f}`
27193
+ f
26362
27194
  )),
26363
- 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" })
26364
- ] }) : /* @__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(
26365
- "li",
26366
- {
26367
- className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md transition-colors",
26368
- children: [
26369
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-danger/70 font-mono flex-1 flex items-center gap-1.5 truncate", children: [
26370
- /* @__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" }),
26371
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: f })
26372
- ] }),
26373
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1 flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
26374
- "button",
26375
- {
26376
- onClick: () => handleStageSingle(f),
26377
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26378
- children: "+"
26379
- }
26380
- ) })
26381
- ]
26382
- },
26383
- `d-${f}`
26384
- )) }),
26385
- changesTab === "deleted" && deletedHistory?.all && deletedHistory.all.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 pt-3 border-t border-border/50", children: [
26386
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[11px] font-semibold text-secondary uppercase tracking-wider mb-2", children: "Recently Deleted in Repository" }),
26387
- /* @__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: [
26388
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-start mb-1.5", children: [
26389
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-semibold text-primary truncate", title: commit.message, children: commit.message }),
26390
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[10px] text-secondary whitespace-nowrap ml-2 flex-shrink-0", children: [
26391
- new Date(commit.date).toLocaleDateString(),
26392
- " ",
26393
- new Date(commit.date).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })
26394
- ] })
26395
- ] }),
26396
- /* @__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: [
26397
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0 font-bold bg-danger/10 text-danger border border-danger/20 px-1 rounded", children: "D" }),
26398
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", title: f.file, children: f.file })
26399
- ] }, i)) })
26400
- ] }, commit.hash)) })
26401
- ] })
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
+ ] }) })
26402
27197
  ] })
26403
27198
  ] }),
26404
- /* @__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: [
26405
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-semibold mb-4 text-primary text-sm", children: "Staged Changes" }),
26406
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-auto pr-2 custom-scrollbar", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-1", children: [
26407
- status.staged.map((f) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26408
- "li",
26409
- {
26410
- className: "flex justify-between items-center hover:bg-surface-hover px-2 py-1.5 rounded-md group transition-colors",
26411
- children: [
26412
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26413
- "span",
26414
- {
26415
- onClick: () => viewDiff(f, true),
26416
- className: "text-xs text-success font-mono cursor-pointer flex-1",
26417
- children: f
26418
- }
26419
- ),
26420
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "opacity-0 group-hover:opacity-100 flex gap-1", children: [
26421
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26422
- "button",
26423
- {
26424
- onClick: () => openEditor(f),
26425
- className: "text-[10px] text-secondary hover:text-primary px-2 py-0.5 border border-border rounded bg-canvas",
26426
- children: "Edit"
26427
- }
26428
- ),
26429
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26430
- "button",
26431
- {
26432
- onClick: () => handleUnstageSingle(f),
26433
- className: "text-[10px] text-secondary hover:text-danger px-2 py-0.5 border border-border rounded bg-canvas",
26434
- children: "-"
26435
- }
26436
- )
26437
- ] })
26438
- ]
26439
- },
26440
- f
26441
- )),
26442
- status.staged.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "text-xs text-secondary italic mt-2 text-center", children: "No files staged for commit" })
26443
- ] }) })
26444
- ] })
26445
- ] }),
26446
- /* @__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: [
26447
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26448
- "input",
26449
- {
26450
- type: "text",
26451
- placeholder: "Commit message...",
26452
- 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",
26453
- value: commitMessage,
26454
- disabled: !pushPermission,
26455
- onChange: (e) => setCommitMessage(e.target.value),
26456
- onKeyDown: (e) => {
26457
- 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
+ }
26458
27212
  }
26459
- }
26460
- ),
26461
- /* @__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(
26462
27228
  "button",
26463
27229
  {
26464
- onClick: handleCommitClick,
26465
- disabled: status.staged.length === 0 || !commitMessage || !pushPermission,
26466
- 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",
26467
- 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
+ ]
26468
27236
  }
26469
- )
26470
- ] })
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
+ )
26471
27255
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col items-center justify-center text-secondary relative z-10", children: [
26472
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" }) }),
26473
27257
  repoPath ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [