@industry-theme/git-panels 0.1.3 → 0.1.4

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;AAa5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4S9D,CAAC;AAuPF;;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;AAa5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyS9D,CAAC;AA2MF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAkE/C,CAAC"}
@@ -959,7 +959,7 @@ const GitPullRequestsPanel = ({
959
959
  events.on("git-panels.pull-requests:set-filter", (event) => {
960
960
  var _a2;
961
961
  const newFilter = (_a2 = event.payload) == null ? void 0 : _a2.filter;
962
- if (newFilter && ["all", "open", "closed"].includes(newFilter)) {
962
+ if (newFilter && ["open", "closed"].includes(newFilter)) {
963
963
  setFilter(newFilter);
964
964
  }
965
965
  })
@@ -967,15 +967,12 @@ const GitPullRequestsPanel = ({
967
967
  return () => unsubscribers.forEach((unsub) => unsub());
968
968
  }, [events, context]);
969
969
  const filteredPullRequests = useMemo(() => {
970
- if (filter === "all") {
971
- return pullRequests;
972
- }
973
970
  return pullRequests.filter((pr) => pr.state === filter);
974
971
  }, [filter, pullRequests]);
975
972
  const counts = useMemo(() => {
976
973
  const open = pullRequests.filter((pr) => pr.state === "open").length;
977
974
  const closed = pullRequests.filter((pr) => pr.state === "closed").length;
978
- return { open, closed, all: pullRequests.length };
975
+ return { open, closed };
979
976
  }, [pullRequests]);
980
977
  const handleRefresh = async () => {
981
978
  try {
@@ -996,7 +993,7 @@ const GitPullRequestsPanel = ({
996
993
  display: "flex",
997
994
  flexDirection: "column",
998
995
  height: "100%",
999
- backgroundColor: theme2.colors.backgroundSecondary,
996
+ backgroundColor: theme2.colors.background,
1000
997
  overflow: "hidden"
1001
998
  };
1002
999
  const renderState = (icon, title, description) => /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsx(
@@ -1086,7 +1083,7 @@ const GitPullRequestsPanel = ({
1086
1083
  minHeight: "40px",
1087
1084
  padding: "0 12px",
1088
1085
  borderBottom: `1px solid ${theme2.colors.border}`,
1089
- backgroundColor: theme2.colors.backgroundSecondary,
1086
+ backgroundColor: theme2.colors.background,
1090
1087
  display: "flex",
1091
1088
  alignItems: "center",
1092
1089
  justifyContent: "space-between",
@@ -1149,9 +1146,9 @@ const GitPullRequestsPanel = ({
1149
1146
  display: "flex",
1150
1147
  borderBottom: `1px solid ${theme2.colors.border}`
1151
1148
  },
1152
- children: ["open", "closed", "all"].map((value) => {
1149
+ children: ["open", "closed"].map((value) => {
1153
1150
  const isActive = filter === value;
1154
- const label = value === "open" ? "Open" : value === "closed" ? "Closed" : "All";
1151
+ const label = value === "open" ? "Open" : "Closed";
1155
1152
  return /* @__PURE__ */ jsxs(
1156
1153
  "button",
1157
1154
  {
@@ -1213,8 +1210,8 @@ const GitPullRequestsPanel = ({
1213
1210
  /* @__PURE__ */ jsx("div", { style: { fontFamily: theme2.fonts.heading, fontSize: theme2.fontSizes[1], fontWeight: 600 }, children: "No pull requests found" }),
1214
1211
  /* @__PURE__ */ jsxs("div", { style: { marginTop: "4px", fontSize: theme2.fontSizes[0] }, children: [
1215
1212
  "There are no ",
1216
- filter !== "all" ? `${filter} ` : "",
1217
- "pull requests to display."
1213
+ filter,
1214
+ " pull requests to display."
1218
1215
  ] })
1219
1216
  ]
1220
1217
  }
@@ -1228,8 +1225,6 @@ const PullRequestCard = ({ pr, theme: theme2, onClick }) => {
1228
1225
  const [isExpanded, setIsExpanded] = useState(false);
1229
1226
  const isMerged = pr.merged_at !== null;
1230
1227
  const isOpen = pr.state === "open";
1231
- const badgeColor = isOpen ? theme2.colors.success || "#22c55e" : isMerged ? theme2.colors.primary : theme2.colors.error || "#ef4444";
1232
- const badgeBg = `${badgeColor}22`;
1233
1228
  const totalComments = (pr.comments || 0) + (pr.review_comments || 0);
1234
1229
  return /* @__PURE__ */ jsxs(
1235
1230
  "div",
@@ -1247,7 +1242,7 @@ const PullRequestCard = ({ pr, theme: theme2, onClick }) => {
1247
1242
  border: `1px solid ${theme2.colors.border}`,
1248
1243
  borderRadius: "12px",
1249
1244
  padding: "16px",
1250
- backgroundColor: theme2.colors.background,
1245
+ backgroundColor: theme2.colors.backgroundSecondary,
1251
1246
  display: "flex",
1252
1247
  flexDirection: "column",
1253
1248
  gap: "10px",
@@ -1262,112 +1257,65 @@ const PullRequestCard = ({ pr, theme: theme2, onClick }) => {
1262
1257
  style: {
1263
1258
  display: "flex",
1264
1259
  alignItems: "center",
1265
- justifyContent: "space-between",
1266
1260
  gap: "8px",
1267
- flexWrap: "wrap",
1268
- minWidth: 0
1261
+ minWidth: 0,
1262
+ overflow: "hidden"
1269
1263
  },
1270
1264
  children: [
1271
1265
  /* @__PURE__ */ jsxs(
1272
- "div",
1266
+ "span",
1273
1267
  {
1274
1268
  style: {
1275
- display: "flex",
1276
- alignItems: "center",
1277
- gap: "8px",
1278
- minWidth: 0,
1279
- overflow: "hidden"
1269
+ fontFamily: theme2.fonts.heading,
1270
+ fontSize: theme2.fontSizes[1],
1271
+ fontWeight: 600,
1272
+ color: theme2.colors.textSecondary,
1273
+ flexShrink: 0
1280
1274
  },
1281
1275
  children: [
1282
- /* @__PURE__ */ jsxs(
1283
- "span",
1284
- {
1285
- style: {
1286
- fontFamily: theme2.fonts.heading,
1287
- fontSize: theme2.fontSizes[1],
1288
- fontWeight: 600,
1289
- color: theme2.colors.textSecondary,
1290
- flexShrink: 0
1291
- },
1292
- children: [
1293
- "#",
1294
- pr.number
1295
- ]
1296
- }
1297
- ),
1298
- /* @__PURE__ */ jsxs(
1299
- "span",
1300
- {
1301
- style: {
1302
- display: "inline-flex",
1303
- alignItems: "center",
1304
- gap: "6px",
1305
- color: theme2.colors.textSecondary,
1306
- fontFamily: theme2.fonts.monospace,
1307
- fontSize: theme2.fontSizes[0],
1308
- overflow: "hidden",
1309
- textOverflow: "ellipsis",
1310
- whiteSpace: "nowrap",
1311
- minWidth: 0
1312
- },
1313
- children: [
1314
- /* @__PURE__ */ jsx(GitBranch, { size: 14, style: { flexShrink: 0 } }),
1315
- ((_a = pr.head) == null ? void 0 : _a.ref) ?? "unknown",
1316
- " → ",
1317
- ((_b = pr.base) == null ? void 0 : _b.ref) ?? "unknown"
1318
- ]
1319
- }
1320
- )
1276
+ "#",
1277
+ pr.number
1321
1278
  ]
1322
1279
  }
1323
1280
  ),
1281
+ pr.draft && /* @__PURE__ */ jsx(
1282
+ "span",
1283
+ {
1284
+ style: {
1285
+ padding: "4px 10px",
1286
+ borderRadius: "999px",
1287
+ backgroundColor: theme2.colors.background,
1288
+ color: theme2.colors.textSecondary,
1289
+ fontFamily: theme2.fonts.heading,
1290
+ fontSize: theme2.fontSizes[0],
1291
+ fontWeight: 600,
1292
+ textTransform: "uppercase",
1293
+ letterSpacing: "0.02em",
1294
+ flexShrink: 0
1295
+ },
1296
+ children: "Draft"
1297
+ }
1298
+ ),
1324
1299
  /* @__PURE__ */ jsxs(
1325
- "div",
1300
+ "span",
1326
1301
  {
1327
1302
  style: {
1328
- display: "flex",
1303
+ display: "inline-flex",
1329
1304
  alignItems: "center",
1330
- gap: "8px",
1331
- flexShrink: 0
1305
+ gap: "6px",
1306
+ color: theme2.colors.textSecondary,
1307
+ fontFamily: theme2.fonts.monospace,
1308
+ fontSize: theme2.fontSizes[0],
1309
+ overflow: "hidden",
1310
+ textOverflow: "ellipsis",
1311
+ whiteSpace: "nowrap",
1312
+ minWidth: 0
1332
1313
  },
1333
1314
  children: [
1334
- /* @__PURE__ */ jsx(
1335
- "span",
1336
- {
1337
- style: {
1338
- display: "inline-flex",
1339
- alignItems: "center",
1340
- gap: "6px",
1341
- padding: "4px 10px",
1342
- borderRadius: "999px",
1343
- backgroundColor: badgeBg,
1344
- color: badgeColor,
1345
- fontFamily: theme2.fonts.heading,
1346
- fontSize: theme2.fontSizes[0],
1347
- fontWeight: 600,
1348
- textTransform: "uppercase",
1349
- letterSpacing: "0.02em"
1350
- },
1351
- children: isOpen ? "Open" : isMerged ? "Merged" : "Closed"
1352
- }
1353
- ),
1354
- pr.draft && /* @__PURE__ */ jsx(
1355
- "span",
1356
- {
1357
- style: {
1358
- padding: "4px 10px",
1359
- borderRadius: "999px",
1360
- backgroundColor: theme2.colors.backgroundSecondary,
1361
- color: theme2.colors.textSecondary,
1362
- fontFamily: theme2.fonts.heading,
1363
- fontSize: theme2.fontSizes[0],
1364
- fontWeight: 600,
1365
- textTransform: "uppercase",
1366
- letterSpacing: "0.02em"
1367
- },
1368
- children: "Draft"
1369
- }
1370
- )
1315
+ /* @__PURE__ */ jsx(GitBranch, { size: 14, style: { flexShrink: 0 } }),
1316
+ ((_a = pr.head) == null ? void 0 : _a.ref) ?? "unknown",
1317
+ " → ",
1318
+ ((_b = pr.base) == null ? void 0 : _b.ref) ?? "unknown"
1371
1319
  ]
1372
1320
  }
1373
1321
  )