marvi 0.8.0 → 0.8.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f6a2c8745ddc2086bb12cb705f8564f1a23b770bb8b1026bdf89e2ccfea8bea
4
- data.tar.gz: 879c6bbf77fac95dc588c8abce142144e2b27a5216d9831fd7c8d231956d248d
3
+ metadata.gz: ce10cf349eaa081b2f4fc1f2f9c038fd62c7e3aaa5f01ed782e03e6a05a93e8c
4
+ data.tar.gz: 7e4c20a1f8f53dd60e21ed27ad3f95ae08f5be365e6eda5fba514fb947b25f0e
5
5
  SHA512:
6
- metadata.gz: d4edaa52fd6b82ad2443c821dab35e40ceb87cd28def6fa6401f413fb654f175d9fdf64b2ac070004c6dfdac99a1c757b0f4b6648388a4cbf952ab744d3815b2
7
- data.tar.gz: b53ac675a9618f8e2be301758c3cb768315942665dc22dd81273bd35d8b490206d575b07689308c522f796f24987a6bd970a85c51cf9463dd8ee8d4e372077f8
6
+ metadata.gz: e6ebac4779d6b0d88b3473d26d9455322cd0680defe3c94e7784dc6506c23173d4dc8236be67f28ff8feae4b25f9526b3a53502decb8a16e107285414cf4b4f3
7
+ data.tar.gz: bf8467ba67c1f3ff3cd87c02cb577492c76ff36ff8b67efbc89e5e9cd219f5388175ced544043008ea1d4bf1b2f1e3c94cc20f9473ec8f9377e6798e4e63aae7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.8.1] - 2026-07-07
4
+
5
+ - Add a blank margin row between the tab bar and the document. Clicks on the margin row select the tab directly above it, giving each tab a taller effective click target.
6
+
3
7
  ## [0.8.0] - 2026-07-06
4
8
 
5
9
  - Turn the `o` prompt into a file picker. It lists Markdown/text documents under the current directory and narrows the list as you type (all space-separated terms must match, case-insensitive); select with `C-n`/`C-p` or the arrow keys and open with `Enter`. Input starting with `/`, `~`, `./`, or `../` switches to explicit path entry with shell-style `Tab` completion, and selecting a directory descends into it.
@@ -42,6 +42,12 @@ module Marvi
42
42
  items.find { |item| item.contains?(y, x) }
43
43
  end
44
44
 
45
+ # Resolve a click including the margin row directly below the bar,
46
+ # which is attributed to the tab above it — a taller click target.
47
+ def item_for_click(items, y, x)
48
+ item_at(items, y, x) || ((y == rows(items)) ? item_at(items, y - 1, x) : nil)
49
+ end
50
+
45
51
  def truncate_to_width(text, max_width)
46
52
  return text if Unicode::DisplayWidth.of(text) <= max_width
47
53
 
@@ -32,6 +32,11 @@ module Marvi
32
32
  MIN_HORIZONTAL_PADDING = 2
33
33
  HORIZONTAL_PADDING_DIVISOR = 12
34
34
 
35
+ # Blank row between the tab bar and the document. Clicks landing on it
36
+ # are attributed to the tab directly above, giving each tab a taller
37
+ # effective click target than the single character cell.
38
+ TAB_BAR_MARGIN_ROWS = 1
39
+
35
40
  def render(markdown, file: nil)
36
41
  run([Tab.new(file: file, markdown: markdown)])
37
42
  end
@@ -211,7 +216,7 @@ module Marvi
211
216
  return unless event
212
217
  return if (event.bstate & (::Curses::BUTTON1_CLICKED | ::Curses::BUTTON1_PRESSED)).zero?
213
218
 
214
- item = TabBar.item_at(tab_layout, event.y, event.x)
219
+ item = TabBar.item_for_click(tab_layout, event.y, event.x)
215
220
  switch_to(item.index) if item
216
221
  end
217
222
 
@@ -228,7 +233,8 @@ module Marvi
228
233
  end
229
234
 
230
235
  def tab_bar_height
231
- TabBar.rows(tab_layout)
236
+ rows = TabBar.rows(tab_layout)
237
+ rows.zero? ? 0 : rows + TAB_BAR_MARGIN_ROWS
232
238
  end
233
239
 
234
240
  def draw_tab_bar(layout)
@@ -313,7 +319,8 @@ module Marvi
313
319
  ::Curses.clear
314
320
  layout = tab_layout
315
321
  draw_tab_bar(layout)
316
- offset = TabBar.rows(layout)
322
+ bar_rows = TabBar.rows(layout)
323
+ offset = bar_rows.zero? ? 0 : bar_rows + TAB_BAR_MARGIN_ROWS
317
324
  tab = current_tab
318
325
  tab.clamp_scroll(page_size)
319
326
  padding = horizontal_padding
data/lib/marvi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Marvi
4
- VERSION = "0.8.0"
4
+ VERSION = "0.8.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marvi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitsutaka Mimura