@david-xpn/llm-ui-feedback 0.1.15 → 0.1.16

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.
package/dist/index.js CHANGED
@@ -549,7 +549,7 @@ function SidePanel({
549
549
  "Feedback Session",
550
550
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { fontSize: 11, fontWeight: 400, color: "#9ca3af", marginLeft: 6 }, children: [
551
551
  "v",
552
- "0.1.15"
552
+ "0.1.16"
553
553
  ] })
554
554
  ] }),
555
555
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
@@ -982,6 +982,10 @@ function SubmitModal({ count, onSubmit, onCancel, onDone, submitting, submittedU
982
982
  const [projects, setProjects] = (0, import_react5.useState)([]);
983
983
  const [labels, setLabels] = (0, import_react5.useState)([]);
984
984
  const [selectedProjectId, setSelectedProjectId] = (0, import_react5.useState)("");
985
+ const [projectSearch, setProjectSearch] = (0, import_react5.useState)("");
986
+ const [projectDropdownOpen, setProjectDropdownOpen] = (0, import_react5.useState)(false);
987
+ const projectInputRef = (0, import_react5.useRef)(null);
988
+ const projectDropdownRef = (0, import_react5.useRef)(null);
985
989
  const [selectedLabelIds, setSelectedLabelIds] = (0, import_react5.useState)([]);
986
990
  const [linearError, setLinearError] = (0, import_react5.useState)(null);
987
991
  (0, import_react5.useEffect)(() => {
@@ -998,7 +1002,9 @@ function SubmitModal({ count, onSubmit, onCancel, onDone, submitting, submittedU
998
1002
  if (cancelled) return;
999
1003
  setProjects(p);
1000
1004
  setLabels(l);
1001
- if (p.length > 0) setSelectedProjectId(p[0].id);
1005
+ if (p.length > 0) {
1006
+ setSelectedProjectId(p[0].id);
1007
+ }
1002
1008
  setLinearLoading(false);
1003
1009
  });
1004
1010
  }).catch((err) => {
@@ -1015,6 +1021,25 @@ function SubmitModal({ count, onSubmit, onCancel, onDone, submitting, submittedU
1015
1021
  (0, import_react5.useEffect)(() => {
1016
1022
  if (!ticketTitleEdited) setTicketTitle(title);
1017
1023
  }, [title, ticketTitleEdited]);
1024
+ (0, import_react5.useEffect)(() => {
1025
+ function handleClickOutside(e) {
1026
+ if (projectDropdownRef.current && !projectDropdownRef.current.contains(e.target) && projectInputRef.current && !projectInputRef.current.contains(e.target)) {
1027
+ setProjectDropdownOpen(false);
1028
+ }
1029
+ }
1030
+ document.addEventListener("mousedown", handleClickOutside);
1031
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1032
+ }, []);
1033
+ const filteredProjects = projects.filter(
1034
+ (p) => p.name.toLowerCase().includes(projectSearch.toLowerCase())
1035
+ );
1036
+ const selectedProject = projects.find((p) => p.id === selectedProjectId);
1037
+ const projectDisplayName = (p) => p.name + (p.teams[0] ? ` \u2014 ${p.teams[0].key}` : "");
1038
+ const handleProjectSelect = (p) => {
1039
+ setSelectedProjectId(p.id);
1040
+ setProjectSearch("");
1041
+ setProjectDropdownOpen(false);
1042
+ };
1018
1043
  const handleSubmit = () => {
1019
1044
  if (!title.trim() || submitting) return;
1020
1045
  if (createTicket && linearConfigured && ticketTitle.trim()) {
@@ -1046,7 +1071,8 @@ function SubmitModal({ count, onSubmit, onCancel, onDone, submitting, submittedU
1046
1071
  border: "1px solid #d1d5db",
1047
1072
  fontSize: 14,
1048
1073
  boxSizing: "border-box",
1049
- background: "#fff"
1074
+ background: "#fff",
1075
+ color: "#111827"
1050
1076
  };
1051
1077
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1052
1078
  "div",
@@ -1230,21 +1256,71 @@ function SubmitModal({ count, onSubmit, onCancel, onDone, submitting, submittedU
1230
1256
  }
1231
1257
  )
1232
1258
  ] }),
1233
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1259
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { position: "relative" }, children: [
1234
1260
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { style: { display: "block", fontSize: 12, color: "#6b7280", marginBottom: 4 }, children: "Project" }),
1235
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1236
- "select",
1261
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1262
+ "input",
1263
+ {
1264
+ ref: projectInputRef,
1265
+ type: "text",
1266
+ value: projectDropdownOpen ? projectSearch : selectedProject ? projectDisplayName(selectedProject) : "",
1267
+ onChange: (e) => {
1268
+ setProjectSearch(e.target.value);
1269
+ setProjectDropdownOpen(true);
1270
+ },
1271
+ onFocus: () => {
1272
+ setProjectSearch("");
1273
+ setProjectDropdownOpen(true);
1274
+ },
1275
+ placeholder: "Search projects\u2026",
1276
+ style: inputStyle
1277
+ }
1278
+ ),
1279
+ projectDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1280
+ "div",
1237
1281
  {
1238
- value: selectedProjectId,
1239
- onChange: (e) => setSelectedProjectId(e.target.value),
1240
- style: { ...inputStyle, appearance: "auto" },
1241
- children: [
1242
- projects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: "(no projects)" }),
1243
- projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("option", { value: p.id, children: [
1244
- p.name,
1245
- p.teams[0] ? ` \u2014 ${p.teams[0].key}` : ""
1246
- ] }, p.id))
1247
- ]
1282
+ ref: projectDropdownRef,
1283
+ style: {
1284
+ position: "absolute",
1285
+ top: "100%",
1286
+ left: 0,
1287
+ right: 0,
1288
+ maxHeight: 160,
1289
+ overflowY: "auto",
1290
+ background: "#fff",
1291
+ border: "1px solid #d1d5db",
1292
+ borderRadius: 8,
1293
+ boxShadow: "0 4px 12px rgba(0,0,0,0.12)",
1294
+ zIndex: 10,
1295
+ marginTop: 2
1296
+ },
1297
+ children: filteredProjects.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { padding: "8px 12px", fontSize: 13, color: "#9ca3af" }, children: "No matching projects" }) : filteredProjects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1298
+ "div",
1299
+ {
1300
+ onClick: () => handleProjectSelect(p),
1301
+ style: {
1302
+ padding: "8px 12px",
1303
+ fontSize: 13,
1304
+ cursor: "pointer",
1305
+ background: p.id === selectedProjectId ? "#eff6ff" : "#fff",
1306
+ color: "#111827"
1307
+ },
1308
+ onMouseEnter: (e) => {
1309
+ e.currentTarget.style.background = "#f3f4f6";
1310
+ },
1311
+ onMouseLeave: (e) => {
1312
+ e.currentTarget.style.background = p.id === selectedProjectId ? "#eff6ff" : "#fff";
1313
+ },
1314
+ children: [
1315
+ p.name,
1316
+ p.teams[0] && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { style: { color: "#9ca3af" }, children: [
1317
+ " \u2014 ",
1318
+ p.teams[0].key
1319
+ ] })
1320
+ ]
1321
+ },
1322
+ p.id
1323
+ ))
1248
1324
  }
1249
1325
  )
1250
1326
  ] }),