git-stack-cli 1.6.1 → 1.6.2

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.
@@ -28561,11 +28561,13 @@ function MultiSelect(props) {
28561
28561
  return;
28562
28562
  }
28563
28563
  const space = input === " ";
28564
- if (key.return || space) {
28565
- selectRef.current = true;
28566
- const item = props.items[index];
28567
- if (!item.disabled) {
28568
- return select(index);
28564
+ if (!props.disableSelect) {
28565
+ if (key.return || space) {
28566
+ selectRef.current = true;
28567
+ const item = props.items[index];
28568
+ if (!item.disabled) {
28569
+ return select(index);
28570
+ }
28569
28571
  }
28570
28572
  }
28571
28573
  if (key.upArrow) {
@@ -28797,6 +28799,8 @@ function SelectCommitRangesInternal(props) {
28797
28799
  }
28798
28800
  });
28799
28801
  const group = group_list[current_index];
28802
+ const multiselect_disabled = group_input;
28803
+ const multiselect_disableSelect = group.id === props.commit_range.UNASSIGNED;
28800
28804
  const items = props.commit_range.commit_list.map((commit) => {
28801
28805
  const commit_metadata_id = commit_map.get(commit.sha);
28802
28806
  const selected = commit_metadata_id !== null;
@@ -28804,9 +28808,6 @@ function SelectCommitRangesInternal(props) {
28804
28808
  if (group_input) {
28805
28809
  disabled = true;
28806
28810
  }
28807
- else if (group.id === props.commit_range.UNASSIGNED) {
28808
- disabled = true;
28809
- }
28810
28811
  else {
28811
28812
  disabled = Boolean(selected && commit_metadata_id !== group.id);
28812
28813
  }
@@ -28832,7 +28833,7 @@ function SelectCommitRangesInternal(props) {
28832
28833
  const [focused, set_focused] = reactExports.useState("");
28833
28834
  return (reactExports.createElement(Box, { flexDirection: "column" },
28834
28835
  reactExports.createElement(Box, { height: 1 }),
28835
- reactExports.createElement(MultiSelect, { key: group.id, items: items, maxWidth: max_item_width, disabled: group_input, onFocus: (args) => {
28836
+ reactExports.createElement(MultiSelect, { items: items, maxWidth: max_item_width, disabled: multiselect_disabled, disableSelect: multiselect_disableSelect, onFocus: (args) => {
28836
28837
  // console.debug("onFocus", args);
28837
28838
  set_focused(args.item.subject_line);
28838
28839
  }, onSelect: (args) => {
@@ -34461,7 +34462,7 @@ async function command() {
34461
34462
  .wrap(123)
34462
34463
  // disallow unknown options
34463
34464
  .strict()
34464
- .version("1.6.1" )
34465
+ .version("1.6.2" )
34465
34466
  .showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`")
34466
34467
  .help("help", "Show usage via `git stack help`").argv);
34467
34468
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
@@ -12,6 +12,7 @@ type Props<T> = {
12
12
  onSelect: (args: CallbackArgs<T>) => void;
13
13
  onFocus?: (args: CallbackArgs<T>) => void;
14
14
  disabled?: boolean;
15
+ disableSelect?: boolean;
15
16
  maxWidth?: number;
16
17
  };
17
18
 
@@ -118,11 +119,13 @@ export function MultiSelect<T>(props: Props<T>) {
118
119
 
119
120
  const space = input === " ";
120
121
 
121
- if (key.return || space) {
122
- selectRef.current = true;
123
- const item = props.items[index];
124
- if (!item.disabled) {
125
- return select(index);
122
+ if (!props.disableSelect) {
123
+ if (key.return || space) {
124
+ selectRef.current = true;
125
+ const item = props.items[index];
126
+ if (!item.disabled) {
127
+ return select(index);
128
+ }
126
129
  }
127
130
  }
128
131
 
@@ -171,6 +171,9 @@ function SelectCommitRangesInternal(props: Props) {
171
171
 
172
172
  const group = group_list[current_index];
173
173
 
174
+ const multiselect_disabled = group_input;
175
+ const multiselect_disableSelect = group.id === props.commit_range.UNASSIGNED;
176
+
174
177
  const items = props.commit_range.commit_list.map((commit) => {
175
178
  const commit_metadata_id = commit_map.get(commit.sha);
176
179
 
@@ -180,8 +183,6 @@ function SelectCommitRangesInternal(props: Props) {
180
183
 
181
184
  if (group_input) {
182
185
  disabled = true;
183
- } else if (group.id === props.commit_range.UNASSIGNED) {
184
- disabled = true;
185
186
  } else {
186
187
  disabled = Boolean(selected && commit_metadata_id !== group.id);
187
188
  }
@@ -218,10 +219,10 @@ function SelectCommitRangesInternal(props: Props) {
218
219
  <Ink.Box height={1} />
219
220
 
220
221
  <MultiSelect
221
- key={group.id}
222
222
  items={items}
223
223
  maxWidth={max_item_width}
224
- disabled={group_input}
224
+ disabled={multiselect_disabled}
225
+ disableSelect={multiselect_disableSelect}
225
226
  onFocus={(args) => {
226
227
  // console.debug("onFocus", args);
227
228