@harborppm/cli 0.88.0 → 0.89.0

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.
Files changed (2) hide show
  1. package/dist/app.mjs +17 -4
  2. package/package.json +1 -1
package/dist/app.mjs CHANGED
@@ -4944,7 +4944,7 @@ function normalizeBoardConfig(raw) {
4944
4944
  const todo = columns.find((c) => c.status === "todo") ?? columns[0];
4945
4945
  todo.visible = true;
4946
4946
  }
4947
- const swimlane = raw.swimlane === "assignee" || raw.swimlane === "priority" ? raw.swimlane : "none";
4947
+ const swimlane = raw.swimlane === "assignee" || raw.swimlane === "priority" ? raw.swimlane : typeof raw.swimlane === "string" && /^field:[^\s]{1,100}$/.test(raw.swimlane) ? raw.swimlane : "none";
4948
4948
  const cardFields = {
4949
4949
  dueDate: raw.cardFields?.dueDate !== false,
4950
4950
  assignee: raw.cardFields?.assignee !== false,
@@ -30011,6 +30011,15 @@ function defaultAction(type) {
30011
30011
  };
30012
30012
  }
30013
30013
 
30014
+ // src/lib/board-lanes.ts
30015
+ /** Fields a board can be split into lanes by. */
30016
+ function isLaneField(def) {
30017
+ return def.type === "select" || def.type === "multi" || def.type === "person" || def.type === "checkbox" || def.type === "date";
30018
+ }
30019
+ function fieldLane(fieldId) {
30020
+ return `field:${fieldId}`;
30021
+ }
30022
+
30014
30023
  // src/tui/views/setup.tsx
30015
30024
  /**
30016
30025
  * A project's board setup, as the website's board settings have it: where it
@@ -30077,6 +30086,10 @@ function BoardPanel({ id, width, height, go, active, onClose }) {
30077
30086
  const people = useHarbor((s) => s.people);
30078
30087
  if (!project) return null;
30079
30088
  const config = boardConfigOf({ boardConfigs }, id);
30089
+ const lanes = [...LANES, ...(project.customFields ?? []).filter(isLaneField).map((f) => ({
30090
+ value: fieldLane(f.id),
30091
+ label: `By ${f.name}`
30092
+ }))];
30080
30093
  const set = (patch) => store.getState().setBoardConfig(id, {
30081
30094
  ...config,
30082
30095
  preset: "custom",
@@ -30159,15 +30172,15 @@ function BoardPanel({ id, width, height, go, active, onClose }) {
30159
30172
  ...config.columns.map(columnField),
30160
30173
  {
30161
30174
  label: "Lanes",
30162
- value: LANES.find((l) => l.value === config.swimlane)?.label ?? "None",
30175
+ value: lanes.find((l) => l.value === config.swimlane)?.label ?? "None",
30163
30176
  edit: {
30164
30177
  kind: "pick",
30165
30178
  title: "Lanes across the website's board",
30166
- choices: LANES.map((l) => ({
30179
+ choices: lanes.map((l) => ({
30167
30180
  label: l.label,
30168
30181
  value: l.value
30169
30182
  })),
30170
- initial: LANES.findIndex((l) => l.value === config.swimlane),
30183
+ initial: Math.max(0, lanes.findIndex((l) => l.value === config.swimlane)),
30171
30184
  onPick: (v) => set({ swimlane: v })
30172
30185
  }
30173
30186
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harborppm/cli",
3
- "version": "0.88.0",
3
+ "version": "0.89.0",
4
4
  "description": "Harbor from the terminal: a full-screen app with everything, plus commands for scripts and agents.",
5
5
  "keywords": [
6
6
  "harbor",