hyperlist 1.5.1 → 1.6.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 (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/hyperlist +105 -35
  4. data/hyperlist.gemspec +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d906cdf818500e49cb3911de90fec6dc30c2de1d8b184a6ea1f59f6055776263
4
- data.tar.gz: d35bd7c1a80843e9167e9ff30321dec10b7f91269a888870dbf655961c3b1f58
3
+ metadata.gz: d21f62ca7a02ec79a5b845d35afe4ba4ce0c28083ae2cac61c0857375e63f73c
4
+ data.tar.gz: 4af367432d5a1037d3dabf5fa84f5afe4f1eb1ad9b9d2f56fca21523efb3ba73
5
5
  SHA512:
6
- metadata.gz: 531069f6958c4056feab35ff0db6124801501741248ec773e8582134f289d42ed9c37fc77ae25c58e45c0aa06d5c80deb114b91bc3b89d8358c482219c0d497d
7
- data.tar.gz: 67bb2e44b183907672c08a58971149ff59297f7d800e8d1ed9156b7e27f5a04d7ec0c1acf205656c6ce813e7047eec723a6db727f5ae0cdac908e3d28a4e25b5
6
+ metadata.gz: 00dad920e90a26a443ae81ab3e241e788f3494142aaff21105cc477d21d14cde22515aeb036ccec1647b74a22c9386505dd30e8aa02209ef19a1efd0f1cf2e1c
7
+ data.tar.gz: ad4d36624c61337c243fdf43fcfc0e7b55be57d0870dd5328fa7de76c60ad914c6b100615e92db961d5b653fa3df17bce3286466442cd5c923997f0ac5e2afc1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes to the HyperList Ruby TUI will be documented in this file.
4
4
 
5
+ ## [1.6.0] - 2025-09-18
6
+
7
+ ### BREAKING CHANGES
8
+ - **Complete reassignment of arrow key functionality**
9
+ - **RIGHT key**: Now uncollapses items (if collapsed)
10
+ - **LEFT key**: Now collapses items (if they have children)
11
+ - **TAB key**: Takes over old RIGHT key functionality (indent right)
12
+ - **S-TAB key**: Takes over old LEFT key functionality (indent left)
13
+ - This provides more intuitive navigation where arrow keys control visibility and TAB keys control indentation
14
+ - Updated help documentation to reflect new key mappings
15
+
16
+ ## [1.5.2] - 2025-09-18
17
+
18
+ ### Enhanced
19
+ - **Smart movement behavior for collapsed items**
20
+ - LEFT/RIGHT arrow keys move collapsed trees as a unit when item is folded
21
+ - Uncollapsed items move individually (only the current item)
22
+ - Maintains "move what's visible" principle for intuitive navigation
23
+ - Works in both normal and split-view modes
24
+
5
25
  ## [1.4.5] - 2025-09-02
6
26
 
7
27
  ### Added
data/hyperlist CHANGED
@@ -72,7 +72,7 @@ class HyperListApp
72
72
  include Rcurses::Input
73
73
  include Rcurses::Cursor
74
74
 
75
- VERSION = "1.5.1"
75
+ VERSION = "1.6.0"
76
76
 
77
77
  def initialize(filename = nil)
78
78
  @filename = filename ? File.expand_path(filename) : nil
@@ -1610,6 +1610,30 @@ class HyperListApp
1610
1610
  false
1611
1611
  end
1612
1612
 
1613
+ def should_move_with_children?
1614
+ if @split_view && @active_pane == :split
1615
+ # Handle split pane
1616
+ visible_items = get_visible_split_items
1617
+ return false if @split_current >= visible_items.length
1618
+
1619
+ item = visible_items[@split_current]
1620
+ real_idx = @split_items.index(item)
1621
+
1622
+ # Move with children only if item is folded (collapsed) and has children
1623
+ return real_idx && has_children_in_array?(real_idx, @split_items) && item["fold"]
1624
+ else
1625
+ # Handle main pane
1626
+ visible = get_visible_items
1627
+ return false if @current >= visible.length
1628
+
1629
+ item = visible[@current]
1630
+ real_idx = get_real_index(item)
1631
+
1632
+ # Move with children only if item is folded (collapsed) and has children
1633
+ return real_idx && has_children?(real_idx, @items) && @items[real_idx]["fold"]
1634
+ end
1635
+ end
1636
+
1613
1637
  def get_last_descendant_index(idx, items)
1614
1638
  # Find the index after the last descendant of item at idx
1615
1639
  # Returns idx + 1 if no children
@@ -1709,7 +1733,61 @@ class HyperListApp
1709
1733
  end
1710
1734
  end
1711
1735
  end
1712
-
1736
+
1737
+ def collapse_item
1738
+ if @split_view && @active_pane == :split
1739
+ # Handle collapse in split pane
1740
+ visible_items = get_visible_split_items
1741
+ return if @split_current >= visible_items.length
1742
+
1743
+ item = visible_items[@split_current]
1744
+ real_idx = @split_items.index(item)
1745
+
1746
+ if real_idx && has_children_in_array?(real_idx, @split_items) && !item["fold"]
1747
+ item["fold"] = true
1748
+ end
1749
+ else
1750
+ # Handle collapse in main pane
1751
+ visible = get_visible_items
1752
+ return if @current >= visible.length
1753
+
1754
+ item = visible[@current]
1755
+ real_idx = get_real_index(item)
1756
+
1757
+ if real_idx && has_children?(real_idx, @items) && !@items[real_idx]["fold"]
1758
+ @items[real_idx]["fold"] = true
1759
+ record_last_action(:toggle_fold, nil)
1760
+ end
1761
+ end
1762
+ end
1763
+
1764
+ def uncollapse_item
1765
+ if @split_view && @active_pane == :split
1766
+ # Handle uncollapse in split pane
1767
+ visible_items = get_visible_split_items
1768
+ return if @split_current >= visible_items.length
1769
+
1770
+ item = visible_items[@split_current]
1771
+ real_idx = @split_items.index(item)
1772
+
1773
+ if real_idx && has_children_in_array?(real_idx, @split_items) && item["fold"]
1774
+ item["fold"] = false
1775
+ end
1776
+ else
1777
+ # Handle uncollapse in main pane
1778
+ visible = get_visible_items
1779
+ return if @current >= visible.length
1780
+
1781
+ item = visible[@current]
1782
+ real_idx = get_real_index(item)
1783
+
1784
+ if real_idx && has_children?(real_idx, @items) && @items[real_idx]["fold"]
1785
+ @items[real_idx]["fold"] = false
1786
+ record_last_action(:toggle_fold, nil)
1787
+ end
1788
+ end
1789
+ end
1790
+
1713
1791
  def move_up
1714
1792
  if @presentation_mode
1715
1793
  # In presentation mode, we need to handle navigation differently
@@ -2990,8 +3068,8 @@ class HyperListApp
2990
3068
  help_lines << help_line("#{"r".fg("10")}" + ", ".fg("10") + "#{"C-R".fg("10")}", "Redo")
2991
3069
  help_lines << help_line("#{"S-UP".fg("10")}", "Move item up", "#{"S-DOWN".fg("10")}", "Move item down")
2992
3070
  help_lines << help_line("#{"C-UP".fg("10")}", "Move item&descendants up", "#{"C-DOWN".fg("10")}", "Move item&descendants down")
3071
+ help_lines << help_line("#{"→".fg("10")}", "Uncollapse item", "#{"←".fg("10")}", "Collapse item")
2993
3072
  help_lines << help_line("#{"Tab".fg("10")}", "Indent item+kids", "#{"S-Tab".fg("10")}", "Unindent item+kids")
2994
- help_lines << help_line("#{"→".fg("10")}", "Indent item only", "#{"←".fg("10")}", "Unindent item only")
2995
3073
  help_lines << ""
2996
3074
  help_lines << "#{"SPECIAL FEATURES".fg("14")}"
2997
3075
  help_lines << help_line("#{"v".fg("10")}", "Toggle checkbox", "#{"V".fg("10")}", "Checkbox with date")
@@ -4871,29 +4949,27 @@ class HyperListApp
4871
4949
  when "V"
4872
4950
  toggle_checkbox_with_date
4873
4951
  when "TAB"
4952
+ # Indent with move conditions (moved from RIGHT key)
4953
+ should_move_children = should_move_with_children?
4874
4954
  if @split_view && @active_pane == :split
4875
- indent_split_right(true) # with children
4955
+ indent_split_right(should_move_children)
4876
4956
  else
4877
- indent_right(true) # with children
4957
+ indent_right(should_move_children)
4878
4958
  end
4879
4959
  when "S-TAB"
4960
+ # Unindent with move conditions (moved from LEFT key)
4961
+ should_move_children = should_move_with_children?
4880
4962
  if @split_view && @active_pane == :split
4881
- indent_split_left(true) # with children
4963
+ indent_split_left(should_move_children)
4882
4964
  else
4883
- indent_left(true) # with children
4965
+ indent_left(should_move_children)
4884
4966
  end
4885
4967
  when "RIGHT"
4886
- if @split_view && @active_pane == :split
4887
- indent_split_right(false)
4888
- else
4889
- indent_right(false)
4890
- end
4968
+ # Uncollapse item if it is collapsed
4969
+ uncollapse_item
4891
4970
  when "LEFT"
4892
- if @split_view && @active_pane == :split
4893
- indent_split_left(false)
4894
- else
4895
- indent_left(false)
4896
- end
4971
+ # Collapse item if it has children
4972
+ collapse_item
4897
4973
  when " "
4898
4974
  toggle_fold
4899
4975
  when "u"
@@ -5681,19 +5757,11 @@ class HyperListApp
5681
5757
  when "l"
5682
5758
  go_to_first_child
5683
5759
  when "LEFT"
5684
- # Unindent only the current item
5685
- if @split_view && @active_pane == :split
5686
- indent_split_left(false)
5687
- else
5688
- indent_left(false)
5689
- end
5760
+ # Collapse item if it has children
5761
+ collapse_item
5690
5762
  when "RIGHT"
5691
- # Indent only the current item
5692
- if @split_view && @active_pane == :split
5693
- indent_split_right(false)
5694
- else
5695
- indent_right(false)
5696
- end
5763
+ # Uncollapse item if it is collapsed
5764
+ uncollapse_item
5697
5765
  when "PgUP" # Page Up
5698
5766
  page_up
5699
5767
  when "PgDOWN" # Page Down
@@ -5838,11 +5906,12 @@ class HyperListApp
5838
5906
  # In presentation mode, Tab goes to next sibling
5839
5907
  jump_to_next_sibling
5840
5908
  else
5841
- # Normal mode: Indent with all children
5909
+ # Normal mode: Indent with move conditions (moved from RIGHT key)
5910
+ should_move_children = should_move_with_children?
5842
5911
  if @split_view && @active_pane == :split
5843
- indent_split_right(true)
5912
+ indent_split_right(should_move_children)
5844
5913
  else
5845
- indent_right(true)
5914
+ indent_right(should_move_children)
5846
5915
  end
5847
5916
  end
5848
5917
  when "S-TAB" # Shift-Tab
@@ -5850,11 +5919,12 @@ class HyperListApp
5850
5919
  # In presentation mode, Shift-Tab goes to previous sibling
5851
5920
  jump_to_prev_sibling
5852
5921
  else
5853
- # Normal mode: Unindent with all children
5922
+ # Normal mode: Unindent with move conditions (moved from LEFT key)
5923
+ should_move_children = should_move_with_children?
5854
5924
  if @split_view && @active_pane == :split
5855
- indent_split_left(true)
5925
+ indent_split_left(should_move_children)
5856
5926
  else
5857
- indent_left(true)
5927
+ indent_left(should_move_children)
5858
5928
  end
5859
5929
  end
5860
5930
  when "u"
data/hyperlist.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "hyperlist"
3
- spec.version = "1.5.1"
3
+ spec.version = "1.6.0"
4
4
  spec.authors = ["Geir Isene"]
5
5
  spec.email = ["g@isene.com"]
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyperlist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: "."
10
10
  cert_chain: []
11
- date: 2025-09-14 00:00:00.000000000 Z
11
+ date: 2025-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rcurses