@industry-theme/git-panels 0.1.10 → 0.1.11

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.
@@ -1 +1 @@
1
- {"version":3,"file":"GitPullRequestsPanel.d.ts","sourceRoot":"","sources":["../../src/panels/GitPullRequestsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAU5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA2S9D,CAAC;AAwIF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAkE/C,CAAC"}
1
+ {"version":3,"file":"GitPullRequestsPanel.d.ts","sourceRoot":"","sources":["../../src/panels/GitPullRequestsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAU5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA6S9D,CAAC;AAqIF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAkE/C,CAAC"}
@@ -705,6 +705,7 @@ const GitPullRequestsPanel = ({
705
705
  var _a;
706
706
  const { theme: theme2 } = useTheme();
707
707
  const [filter, setFilter] = useState("open");
708
+ const [selectedPrId, setSelectedPrId] = useState(null);
708
709
  const prSlice = context.getSlice("pullRequests");
709
710
  const hasPRs = context.hasSlice("pullRequests");
710
711
  const isLoading = context.isSliceLoading("pullRequests");
@@ -746,6 +747,7 @@ const GitPullRequestsPanel = ({
746
747
  }
747
748
  };
748
749
  const handlePRClick = (pr) => {
750
+ setSelectedPrId(pr.id);
749
751
  events.emit({
750
752
  type: "git-panels.pull-request:selected",
751
753
  source: "git-panels.pull-requests",
@@ -981,13 +983,15 @@ const GitPullRequestsPanel = ({
981
983
  ] })
982
984
  ]
983
985
  }
984
- ) : filteredPullRequests.map((pr) => /* @__PURE__ */ jsx(PullRequestCard, { pr, theme: theme2, onClick: () => handlePRClick(pr) }, pr.id))
986
+ ) : filteredPullRequests.map((pr) => /* @__PURE__ */ jsx(PullRequestCard, { pr, theme: theme2, isSelected: selectedPrId === pr.id, onClick: () => handlePRClick(pr) }, pr.id))
985
987
  }
986
988
  )
987
989
  ] });
988
990
  };
989
- const PullRequestCard = ({ pr, theme: theme2, onClick }) => {
991
+ const PullRequestCard = ({ pr, theme: theme2, isSelected, onClick }) => {
990
992
  var _a;
993
+ const [isHovered, setIsHovered] = useState(false);
994
+ const isActive = isHovered || isSelected;
991
995
  const isMerged = pr.merged_at !== null;
992
996
  const isOpen = pr.state === "open";
993
997
  const totalComments = (pr.comments || 0) + (pr.review_comments || 0);
@@ -1003,57 +1007,33 @@ const PullRequestCard = ({ pr, theme: theme2, onClick }) => {
1003
1007
  onClick == null ? void 0 : onClick();
1004
1008
  }
1005
1009
  },
1010
+ onMouseEnter: () => setIsHovered(true),
1011
+ onMouseLeave: () => setIsHovered(false),
1006
1012
  style: {
1007
1013
  borderBottom: `1px solid ${theme2.colors.border}`,
1008
- padding: "12px 16px",
1009
- backgroundColor: theme2.colors.backgroundSecondary,
1014
+ padding: "16px 16px",
1015
+ backgroundColor: isActive ? theme2.colors.background : theme2.colors.backgroundSecondary,
1010
1016
  display: "flex",
1011
1017
  flexDirection: "column",
1012
1018
  gap: "8px",
1013
1019
  cursor: onClick ? "pointer" : "default",
1014
- minWidth: 0
1020
+ minWidth: 0,
1021
+ transition: "background-color 0.15s ease"
1015
1022
  },
1016
1023
  children: [
1017
- /* @__PURE__ */ jsxs(
1024
+ /* @__PURE__ */ jsx(
1018
1025
  "div",
1019
1026
  {
1020
1027
  style: {
1021
- display: "flex",
1022
- alignItems: "baseline",
1023
- gap: "8px"
1028
+ fontFamily: theme2.fonts.heading,
1029
+ fontSize: theme2.fontSizes[2],
1030
+ fontWeight: 600,
1031
+ color: isActive ? theme2.colors.primary : theme2.colors.text,
1032
+ lineHeight: 1.3,
1033
+ wordBreak: "break-word",
1034
+ transition: "color 0.15s ease"
1024
1035
  },
1025
- children: [
1026
- /* @__PURE__ */ jsxs(
1027
- "span",
1028
- {
1029
- style: {
1030
- fontFamily: theme2.fonts.heading,
1031
- fontSize: theme2.fontSizes[1],
1032
- fontWeight: 600,
1033
- color: theme2.colors.textSecondary,
1034
- flexShrink: 0
1035
- },
1036
- children: [
1037
- "#",
1038
- pr.number
1039
- ]
1040
- }
1041
- ),
1042
- /* @__PURE__ */ jsx(
1043
- "span",
1044
- {
1045
- style: {
1046
- fontFamily: theme2.fonts.heading,
1047
- fontSize: theme2.fontSizes[2],
1048
- fontWeight: 600,
1049
- color: theme2.colors.text,
1050
- lineHeight: 1.3,
1051
- wordBreak: "break-word"
1052
- },
1053
- children: pr.title
1054
- }
1055
- )
1056
- ]
1036
+ children: pr.title
1057
1037
  }
1058
1038
  ),
1059
1039
  /* @__PURE__ */ jsxs(
@@ -1086,6 +1066,20 @@ const PullRequestCard = ({ pr, theme: theme2, onClick }) => {
1086
1066
  children: "Draft"
1087
1067
  }
1088
1068
  ),
1069
+ /* @__PURE__ */ jsxs(
1070
+ "span",
1071
+ {
1072
+ style: {
1073
+ fontFamily: theme2.fonts.heading,
1074
+ fontWeight: 600,
1075
+ color: theme2.colors.textSecondary
1076
+ },
1077
+ children: [
1078
+ "#",
1079
+ pr.number
1080
+ ]
1081
+ }
1082
+ ),
1089
1083
  /* @__PURE__ */ jsxs("span", { children: [
1090
1084
  "by ",
1091
1085
  ((_a = pr.user) == null ? void 0 : _a.login) ?? "unknown"