lazyrails-tui 0.2.0 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15f9781893fa5d9ccd84a85d88f3204c2bfb3593cd2ec5169dea14b5ebdf5901
4
- data.tar.gz: '0658498a1425bbcd2135be3d9c29aec4101ff900c8998bc797962985b292f37f'
3
+ metadata.gz: fc816c3d5deb7d2fd1a081d3347b60dd8c38410205f941f749554c6d51bfd6b6
4
+ data.tar.gz: 1d758431f7fe824002391b60a217b0df91c10d47be80c36547e1b771671b7ff4
5
5
  SHA512:
6
- metadata.gz: b2e651987bb7be6eda53e531b86c4a417c08919cacfbb51eb456b99299cb4fc354ab878b643ab3de36d9fde28941ba22bdb9d6eaca3e07646667eb3ba9196fc9
7
- data.tar.gz: f3bc7782b311f84a6363d05afc4adf07e29d5723cefd0a11d52bea669cfcb9f5f5628034b2d6cb6897404f9efdc562fa106a7c797ce0b1b2bdb77db06454b58c
6
+ metadata.gz: f76b9c1fcbd626d6ade54cd3216099145b5d1472d89466b0c71cdaeea8bc13c5362b6ef4a22d2850b95b2eed596ae2199dff13cfce688deed50b3c5c547c9b2d
7
+ data.tar.gz: 90aac8abb3159ea05691929a3d7e91265d1a88827baa62d87dcd2f45592128838fb79740133cc7137ec434cbfb3c625075858d998742ee83e8e0cad0c7368e62
data/README.md CHANGED
@@ -4,7 +4,7 @@ A [lazygit](https://github.com/jesseduffield/lazygit)-style terminal UI for Rail
4
4
 
5
5
  ![Lazyrails overview](docs/overview.gif)
6
6
 
7
- Built with [Chamomile](https://github.com/xjackk/chamomile) (chamomile + petals + flourish).
7
+ Built with [Chamomile](https://github.com/chamomile-rb/chamomile) the complete Ruby TUI framework.
8
8
 
9
9
  ## Install
10
10
 
data/lib/lazyrails/app.rb CHANGED
@@ -59,7 +59,7 @@ module LazyRails
59
59
  @command_log = CommandLog.new
60
60
  @server = ServerManager.new(project)
61
61
  @log_watcher = LogWatcher.new(project)
62
- @detail_viewport = Petals::Viewport.new(width: 40, height: 20)
62
+ @detail_viewport = Chamomile::Viewport.new(width: 40, height: 20)
63
63
 
64
64
  # Component objects
65
65
  @flash = Flash.new
@@ -163,7 +163,7 @@ module LazyRails
163
163
  left_content = render_left_panels(left_width)
164
164
  right_content = render_right_pane(right_width)
165
165
 
166
- layout = Flourish.horizontal([left_content, " ", right_content], align: :top)
166
+ layout = Chamomile.horizontal([left_content, " ", right_content], align: :top)
167
167
 
168
168
  base = if @input_mode.active?
169
169
  "#{layout}\n#{render_filter_bar}"
@@ -49,14 +49,14 @@ module LazyRails
49
49
  def render(width:)
50
50
  return "No commands executed yet.\n\nPress L or Esc to close." if @command_log.empty?
51
51
 
52
- header = Flourish::Style.new.bold.render("Command Log")
52
+ header = Chamomile::Style.new.bold.render("Command Log")
53
53
  list = Views::CommandLogView.render(@command_log, width: width - 4, selected: @cursor)
54
54
 
55
55
  parts = [header, "", list]
56
56
 
57
57
  if @detail
58
58
  parts << ""
59
- parts << Flourish::Style.new.bold.render("Detail")
59
+ parts << Chamomile::Style.new.bold.render("Detail")
60
60
  parts << Views::CommandLogView.render_detail(@detail, width: width - 4)
61
61
  end
62
62
 
@@ -85,9 +85,9 @@ module LazyRails
85
85
  step_label = step_indicator
86
86
  footer = render_footer
87
87
 
88
- box = Flourish::Style.new
88
+ box = Chamomile::Style.new
89
89
  .width(menu_width)
90
- .border(Flourish::Border::ROUNDED)
90
+ .border(Chamomile::Border::ROUNDED)
91
91
  .border_foreground("#b48ead")
92
92
  .padding(0, 1)
93
93
  .render("#{content}\n\n#{footer}")
@@ -95,7 +95,7 @@ module LazyRails
95
95
  box_lines = box.lines
96
96
  if box_lines.any?
97
97
  title_text = " Generate #{@gen_label} #{step_label} "
98
- title_styled = Flourish::Style.new.foreground("#b48ead").bold.render(title_text)
98
+ title_styled = Chamomile::Style.new.foreground("#b48ead").bold.render(title_text)
99
99
  box_lines[0] = ViewHelpers.inject_title(box_lines[0], title_styled, title_text.length)
100
100
  end
101
101
 
@@ -159,14 +159,14 @@ module LazyRails
159
159
  lines << ""
160
160
 
161
161
  prompt = "> #{@name}\u2588"
162
- lines << Flourish::Style.new.bold.render(prompt)
162
+ lines << Chamomile::Style.new.bold.render(prompt)
163
163
 
164
164
  lines << ""
165
- lines << Flourish::Style.new.foreground("#666666").render(name_hint)
165
+ lines << Chamomile::Style.new.foreground("#666666").render(name_hint)
166
166
 
167
167
  if @error
168
168
  lines << ""
169
- lines << Flourish::Style.new.foreground("#ff6347").render(@error)
169
+ lines << Chamomile::Style.new.foreground("#ff6347").render(@error)
170
170
  end
171
171
 
172
172
  lines.join("\n")
@@ -260,7 +260,7 @@ module LazyRails
260
260
  # Show existing fields
261
261
  if @fields.any?
262
262
  @fields.each_with_index do |f, i|
263
- marker = Flourish::Style.new.foreground("#a3be8c").render("\u2713")
263
+ marker = Chamomile::Style.new.foreground("#a3be8c").render("\u2713")
264
264
  lines << " #{marker} #{f[:name]}:#{f[:type]}"
265
265
  end
266
266
  lines << ""
@@ -270,9 +270,9 @@ module LazyRails
270
270
  lines << "Field name: #{@field_name_input}\u2588"
271
271
  lines << ""
272
272
  hint = @fields.empty? ? "Type a field name, then press Enter to pick its type" : "Type a field name, Enter to pick type, Enter with empty to finish"
273
- lines << Flourish::Style.new.foreground("#666666").render(hint)
273
+ lines << Chamomile::Style.new.foreground("#666666").render(hint)
274
274
  if @fields.any?
275
- lines << Flourish::Style.new.foreground("#666666").render("Backspace with empty input to remove last field")
275
+ lines << Chamomile::Style.new.foreground("#666666").render("Backspace with empty input to remove last field")
276
276
  end
277
277
  else
278
278
  lines << "Pick type for '#{@field_name_input}':"
@@ -288,7 +288,7 @@ module LazyRails
288
288
 
289
289
  if @error
290
290
  lines << ""
291
- lines << Flourish::Style.new.foreground("#ff6347").render(@error)
291
+ lines << Chamomile::Style.new.foreground("#ff6347").render(@error)
292
292
  end
293
293
 
294
294
  lines.join("\n")
@@ -331,17 +331,17 @@ module LazyRails
331
331
 
332
332
  CONTROLLER_ACTIONS.each_with_index do |action, i|
333
333
  checked = @action_toggles[action]
334
- marker = checked ? Flourish::Style.new.foreground("#a3be8c").render("[x]") : "[ ]"
334
+ marker = checked ? Chamomile::Style.new.foreground("#a3be8c").render("[x]") : "[ ]"
335
335
  text = "#{marker} #{action}"
336
336
  if i == @action_cursor
337
- lines << ViewHelpers.selected_style.render(" #{Flourish::ANSI.strip(text)} ")
337
+ lines << ViewHelpers.selected_style.render(" #{Chamomile::ANSI.strip(text)} ")
338
338
  else
339
339
  lines << " #{text}"
340
340
  end
341
341
  end
342
342
 
343
343
  lines << ""
344
- lines << Flourish::Style.new.foreground("#666666").render("Space toggle | a toggle all | Enter continue")
344
+ lines << Chamomile::Style.new.foreground("#666666").render("Space toggle | a toggle all | Enter continue")
345
345
 
346
346
  lines.join("\n")
347
347
  end
@@ -389,7 +389,7 @@ module LazyRails
389
389
 
390
390
  if @methods.any?
391
391
  @methods.each do |m|
392
- marker = Flourish::Style.new.foreground("#a3be8c").render("\u2713")
392
+ marker = Chamomile::Style.new.foreground("#a3be8c").render("\u2713")
393
393
  lines << " #{marker} #{m}"
394
394
  end
395
395
  lines << ""
@@ -398,14 +398,14 @@ module LazyRails
398
398
  lines << "Method name: #{@method_input}\u2588"
399
399
  lines << ""
400
400
  hint = @methods.empty? ? "Type a method name and press Enter" : "Enter another method, or Enter with empty to finish"
401
- lines << Flourish::Style.new.foreground("#666666").render(hint)
401
+ lines << Chamomile::Style.new.foreground("#666666").render(hint)
402
402
  if @methods.any?
403
- lines << Flourish::Style.new.foreground("#666666").render("Backspace with empty input to remove last method")
403
+ lines << Chamomile::Style.new.foreground("#666666").render("Backspace with empty input to remove last method")
404
404
  end
405
405
 
406
406
  if @error
407
407
  lines << ""
408
- lines << Flourish::Style.new.foreground("#ff6347").render(@error)
408
+ lines << Chamomile::Style.new.foreground("#ff6347").render(@error)
409
409
  end
410
410
 
411
411
  lines.join("\n")
@@ -435,11 +435,11 @@ module LazyRails
435
435
  cmd_str = cmd.join(" ")
436
436
 
437
437
  lines = []
438
- lines << Flourish::Style.new.foreground("#a3be8c").bold.render("Ready to generate!")
438
+ lines << Chamomile::Style.new.foreground("#a3be8c").bold.render("Ready to generate!")
439
439
  lines << ""
440
440
 
441
441
  lines << "Command:"
442
- lines << Flourish::Style.new.bold.render(" $ #{cmd_str}")
442
+ lines << Chamomile::Style.new.bold.render(" $ #{cmd_str}")
443
443
  lines << ""
444
444
 
445
445
  # Summary
@@ -107,9 +107,9 @@ module LazyRails
107
107
  scroll_hint = @scroll < max_scroll ? " | j/k scroll" : ""
108
108
  footer = "? or Esc close#{scroll_hint}"
109
109
 
110
- box = Flourish::Style.new
110
+ box = Chamomile::Style.new
111
111
  .width(box_width)
112
- .border(Flourish::Border::ROUNDED)
112
+ .border(Chamomile::Border::ROUNDED)
113
113
  .border_foreground("#b48ead")
114
114
  .padding(0, 1)
115
115
  .render("#{content}\n\n#{footer}")
@@ -117,7 +117,7 @@ module LazyRails
117
117
  box_lines = box.lines
118
118
  if box_lines.any?
119
119
  title_text = " Keybindings "
120
- title_styled = Flourish::Style.new.foreground("#b48ead").bold.render(title_text)
120
+ title_styled = Chamomile::Style.new.foreground("#b48ead").bold.render(title_text)
121
121
  box_lines[0] = ViewHelpers.inject_title(box_lines[0], title_styled, title_text.length)
122
122
  end
123
123
 
@@ -130,9 +130,9 @@ module LazyRails
130
130
  lines = []
131
131
  SECTIONS.each_with_index do |section, i|
132
132
  lines << "" if i > 0
133
- lines << Flourish::Style.new.bold.foreground("#b48ead").render(section[:section])
133
+ lines << Chamomile::Style.new.bold.foreground("#b48ead").render(section[:section])
134
134
  section[:bindings].each do |key, desc|
135
- key_styled = Flourish::Style.new.bold.render(key.ljust(18))
135
+ key_styled = Chamomile::Style.new.bold.render(key.ljust(18))
136
136
  lines << " #{key_styled} #{desc}"
137
137
  end
138
138
  end
@@ -50,7 +50,7 @@ module LazyRails
50
50
  @active = true
51
51
  @purpose = purpose
52
52
  @label = prompt
53
- @input = Petals::TextInput.new(prompt: "", placeholder: placeholder)
53
+ @input = Chamomile::TextInput.new(prompt: "", placeholder: placeholder)
54
54
  @input.focus
55
55
  end
56
56
  end
@@ -77,9 +77,9 @@ module LazyRails
77
77
  content = lines.join("\n")
78
78
  footer = "j/k navigate | Enter select | Esc close"
79
79
 
80
- box = Flourish::Style.new
80
+ box = Chamomile::Style.new
81
81
  .width(menu_width)
82
- .border(Flourish::Border::ROUNDED)
82
+ .border(Chamomile::Border::ROUNDED)
83
83
  .border_foreground("#b48ead")
84
84
  .padding(0, 1)
85
85
  .render("#{content}\n\n#{footer}")
@@ -88,7 +88,7 @@ module LazyRails
88
88
  box_lines = box.lines
89
89
  if box_lines.any?
90
90
  title_text = " #{@title} "
91
- title_styled = Flourish::Style.new.foreground("#b48ead").bold.render(title_text)
91
+ title_styled = Chamomile::Style.new.foreground("#b48ead").bold.render(title_text)
92
92
  box_lines[0] = ViewHelpers.inject_title(box_lines[0], title_styled, title_text.length)
93
93
  end
94
94
 
@@ -25,17 +25,17 @@ module LazyRails
25
25
  content = render_panel_content(panel, width: width - 4, height: h - 2, focused: focused)
26
26
 
27
27
  border_color = focused ? FOCUSED_COLOR : UNFOCUSED_COLOR
28
- box = Flourish::Style.new
28
+ box = Chamomile::Style.new
29
29
  .width(width)
30
30
  .height(h)
31
- .border(Flourish::Border::ROUNDED)
31
+ .border(Chamomile::Border::ROUNDED)
32
32
  .border_foreground(border_color)
33
33
  .render(content)
34
34
 
35
35
  box_lines = box.lines
36
36
  if box_lines.any?
37
37
  title = " #{panel.title} "
38
- title_styled = Flourish::Style.new.foreground(border_color).bold.render(title)
38
+ title_styled = Chamomile::Style.new.foreground(border_color).bold.render(title)
39
39
  box_lines[0] = inject_title(box_lines[0], title_styled, title.length)
40
40
  end
41
41
 
@@ -44,7 +44,7 @@ module LazyRails
44
44
  sections << output
45
45
  end
46
46
 
47
- Flourish.vertical(sections, align: :left)
47
+ Chamomile.vertical(sections, align: :left)
48
48
  end
49
49
 
50
50
  def panel_cache_key(panel, focused, width, height)
@@ -104,7 +104,7 @@ module LazyRails
104
104
  when :jobs then Views::JobsView.render_item(item, selected: selected, width: width)
105
105
  when :custom then Views::CustomCommandsView.render_item(item, selected: selected, width: width)
106
106
  else
107
- selected ? Flourish::Style.new.reverse.render(item.to_s) : item.to_s
107
+ selected ? Chamomile::Style.new.reverse.render(item.to_s) : item.to_s
108
108
  end
109
109
  end.join("\n")
110
110
  end
@@ -117,17 +117,17 @@ module LazyRails
117
117
  content = @detail_viewport.view
118
118
  border_color = UNFOCUSED_COLOR
119
119
 
120
- box = Flourish::Style.new
120
+ box = Chamomile::Style.new
121
121
  .width(width)
122
122
  .height(@height - 2)
123
- .border(Flourish::Border::ROUNDED)
123
+ .border(Chamomile::Border::ROUNDED)
124
124
  .border_foreground(border_color)
125
125
  .render(content)
126
126
 
127
127
  box_lines = box.lines
128
128
  if box_lines.any?
129
129
  title = " Detail "
130
- title_styled = Flourish::Style.new.foreground(border_color).bold.render(title)
130
+ title_styled = Chamomile::Style.new.foreground(border_color).bold.render(title)
131
131
  box_lines[0] = inject_title(box_lines[0], title_styled, title.length)
132
132
  end
133
133
 
@@ -194,7 +194,7 @@ module LazyRails
194
194
 
195
195
  def render_status_bar
196
196
  if @flash.active?
197
- return Flourish::Style.new.foreground("#e5c07b").width(@width).render(" #{@flash.message}".slice(0, @width))
197
+ return Chamomile::Style.new.foreground("#e5c07b").width(@width).render(" #{@flash.message}".slice(0, @width))
198
198
  end
199
199
 
200
200
  hints = [
@@ -202,27 +202,27 @@ module LazyRails
202
202
  ["x", "actions"], ["L", "log"], ["?", "help"], ["q", "quit"]
203
203
  ]
204
204
  bar = " " + hints.map do |key, desc|
205
- styled_key = Flourish::Style.new.bold.foreground("#b48ead").render(key)
205
+ styled_key = Chamomile::Style.new.bold.foreground("#b48ead").render(key)
206
206
  "#{styled_key} #{desc}"
207
207
  end.join(" \u2502 ")
208
208
 
209
- Flourish::Style.new.foreground("#999999").width(@width).render(bar)
209
+ Chamomile::Style.new.foreground("#999999").width(@width).render(bar)
210
210
  end
211
211
 
212
212
  def render_filter_bar
213
- label = Flourish::Style.new.bold.foreground("#b48ead").render(" #{@input_mode.styled_label}")
213
+ label = Chamomile::Style.new.bold.foreground("#b48ead").render(" #{@input_mode.styled_label}")
214
214
  input = @input_mode.view
215
- hints = Flourish::Style.new.foreground("#666666").render("Enter submit \u2502 Esc cancel ")
215
+ hints = Chamomile::Style.new.foreground("#666666").render("Enter submit \u2502 Esc cancel ")
216
216
 
217
217
  hints_len = "Enter submit | Esc cancel ".length
218
218
  label_len = @input_mode.styled_label.length + 1
219
219
  input_area = @width - label_len - hints_len
220
220
 
221
221
  # Build: [label][input padding...][hints]
222
- input_visible = Flourish::ANSI.printable_width(input)
222
+ input_visible = Chamomile::ANSI.printable_width(input)
223
223
  padding = input_area > input_visible ? " " * (input_area - input_visible) : ""
224
224
 
225
- Flourish::Style.new.width(@width).render("#{label}#{input}#{padding}#{hints}")
225
+ Chamomile::Style.new.width(@width).render("#{label}#{input}#{padding}#{hints}")
226
226
  end
227
227
 
228
228
  def render_confirmation_box
@@ -235,19 +235,19 @@ module LazyRails
235
235
  cmd = @confirmation.command.is_a?(Array) ? @confirmation.command.join(" ") : @confirmation.command.to_s
236
236
 
237
237
  lines = []
238
- lines << Flourish::Style.new.foreground(color).bold.render(cmd)
238
+ lines << Chamomile::Style.new.foreground(color).bold.render(cmd)
239
239
  lines << ""
240
240
  lines << text
241
241
  lines << ""
242
- lines << Flourish::Style.new.foreground("#666666").render("Esc cancel")
242
+ lines << Chamomile::Style.new.foreground("#666666").render("Esc cancel")
243
243
  content = lines.join("\n")
244
244
 
245
245
  box_width = [[cmd.length + 6, text.length + 6].max, @width - 8].min
246
246
  box_width = [box_width, 30].max
247
247
 
248
- box = Flourish::Style.new
248
+ box = Chamomile::Style.new
249
249
  .width(box_width)
250
- .border(Flourish::Border::ROUNDED)
250
+ .border(Chamomile::Border::ROUNDED)
251
251
  .border_foreground(color)
252
252
  .padding(0, 1)
253
253
  .render(content)
@@ -255,7 +255,7 @@ module LazyRails
255
255
  box_lines = box.lines
256
256
  if box_lines.any?
257
257
  title_text = " Confirm "
258
- title_styled = Flourish::Style.new.foreground(color).bold.render(title_text)
258
+ title_styled = Chamomile::Style.new.foreground(color).bold.render(title_text)
259
259
  box_lines[0] = ViewHelpers.inject_title(box_lines[0], title_styled, title_text.length)
260
260
  end
261
261
 
@@ -268,10 +268,10 @@ module LazyRails
268
268
  box_width = [@width - 4, 60].max
269
269
  box_width = [box_width, @width - 2].min
270
270
 
271
- box = Flourish::Style.new
271
+ box = Chamomile::Style.new
272
272
  .width(box_width)
273
273
  .height(@height - 4)
274
- .border(Flourish::Border::ROUNDED)
274
+ .border(Chamomile::Border::ROUNDED)
275
275
  .border_foreground("#b48ead")
276
276
  .padding(0, 1)
277
277
  .render(content)
@@ -279,7 +279,7 @@ module LazyRails
279
279
  box_lines = box.lines
280
280
  if box_lines.any?
281
281
  title_text = " Command Log "
282
- title_styled = Flourish::Style.new.foreground("#b48ead").bold.render(title_text)
282
+ title_styled = Chamomile::Style.new.foreground("#b48ead").bold.render(title_text)
283
283
  box_lines[0] = ViewHelpers.inject_title(box_lines[0], title_styled, title_text.length)
284
284
  end
285
285
 
@@ -292,10 +292,10 @@ module LazyRails
292
292
  box_width = [@width - 4, 60].max
293
293
  box_width = [box_width, @width - 2].min
294
294
 
295
- box = Flourish::Style.new
295
+ box = Chamomile::Style.new
296
296
  .width(box_width)
297
297
  .height(@height - 4)
298
- .border(Flourish::Border::ROUNDED)
298
+ .border(Chamomile::Border::ROUNDED)
299
299
  .border_foreground("#b48ead")
300
300
  .padding(0, 1)
301
301
  .render(content)
@@ -303,7 +303,7 @@ module LazyRails
303
303
  box_lines = box.lines
304
304
  if box_lines.any?
305
305
  title_text = " Table Browser "
306
- title_styled = Flourish::Style.new.foreground("#b48ead").bold.render(title_text)
306
+ title_styled = Chamomile::Style.new.foreground("#b48ead").bold.render(title_text)
307
307
  box_lines[0] = ViewHelpers.inject_title(box_lines[0], title_styled, title_text.length)
308
308
  end
309
309
 
@@ -71,7 +71,7 @@ module LazyRails
71
71
  row.map { |v| v.nil? ? "NULL" : v.to_s }
72
72
  end
73
73
 
74
- @table_widget = Petals::Table.new(rows: table_rows) do |t|
74
+ @table_widget = Chamomile::Table.new(rows: table_rows) do |t|
75
75
  columns.each { |col| t.column col, width: column_width(col, columns.size) }
76
76
  end
77
77
  end
@@ -199,7 +199,7 @@ module LazyRails
199
199
  end
200
200
 
201
201
  def render_table_list(width, height)
202
- header = Flourish::Style.new.bold.render("Select a Table (#{@tables.size})")
202
+ header = Chamomile::Style.new.bold.render("Select a Table (#{@tables.size})")
203
203
  lines = [header, ""]
204
204
 
205
205
  if @tables.empty?
@@ -226,7 +226,7 @@ module LazyRails
226
226
  end
227
227
 
228
228
  def render_row_data(_width, height)
229
- header = Flourish::Style.new.bold.render("Table: #{@selected_table}")
229
+ header = Chamomile::Style.new.bold.render("Table: #{@selected_table}")
230
230
  lines = [header, ""]
231
231
 
232
232
  # Status line with query info
@@ -235,13 +235,13 @@ module LazyRails
235
235
  status_parts << "ORDER BY #{order_expression}" if @order_column
236
236
  status_parts << "Page #{@page + 1}/#{total_pages} (#{@total_rows} rows)"
237
237
  status_line = status_parts.join(" | ")
238
- lines << Flourish::Style.new.foreground("#888888").render(status_line)
238
+ lines << Chamomile::Style.new.foreground("#888888").render(status_line)
239
239
  lines << ""
240
240
 
241
241
  if @loading
242
242
  lines << "Loading..."
243
243
  elsif @error
244
- lines << Flourish::Style.new.foreground("#ff6347").render("Error: #{@error}")
244
+ lines << Chamomile::Style.new.foreground("#ff6347").render("Error: #{@error}")
245
245
  elsif @table_widget
246
246
  @table_widget.height = [height - 7, 3].max
247
247
  lines << @table_widget.view
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LazyRails
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -9,7 +9,7 @@ module LazyRails
9
9
  end
10
10
 
11
11
  def self.selected_style
12
- Flourish::Style.new.bold.reverse
12
+ Chamomile::Style.new.bold.reverse
13
13
  end
14
14
 
15
15
  def self.classify_name(name)
@@ -24,10 +24,10 @@ module LazyRails
24
24
  box_lines = popup_box.split("\n", -1)
25
25
 
26
26
  # Remove trailing empty lines from box
27
- box_lines.pop while box_lines.last&.then { |l| Flourish::ANSI.strip(l).strip.empty? }
27
+ box_lines.pop while box_lines.last&.then { |l| Chamomile::ANSI.strip(l).strip.empty? }
28
28
 
29
29
  box_h = box_lines.size
30
- box_w = box_lines.map { |l| Flourish::ANSI.printable_width(l) }.max || 0
30
+ box_w = box_lines.map { |l| Chamomile::ANSI.printable_width(l) }.max || 0
31
31
 
32
32
  # Center position
33
33
  start_row = [(screen_height - box_h) / 2, 0].max
@@ -52,9 +52,9 @@ module LazyRails
52
52
  end
53
53
 
54
54
  # Injects a styled title into the first line of a bordered box.
55
- # Used by Renderer and MenuOverlay to add titles to Flourish borders.
55
+ # Used by Renderer and MenuOverlay to add titles to Chamomile borders.
56
56
  def self.inject_title(top_line, styled_title, title_visible_len)
57
- stripped = Flourish::ANSI.strip(top_line)
57
+ stripped = Chamomile::ANSI.strip(top_line)
58
58
  return top_line if stripped.length <= title_visible_len + 2
59
59
 
60
60
  ansi_prefix = top_line[/\A((?:\e\[[0-9;]*m)*)/] || ""
@@ -19,18 +19,18 @@ module LazyRails
19
19
  if i == selected
20
20
  lines << ViewHelpers.selected_style.render(text)
21
21
  else
22
- styled_icon = Flourish::Style.new.foreground(color).render(icon)
22
+ styled_icon = Chamomile::Style.new.foreground(color).render(icon)
23
23
  lines << "#{styled_icon} #{cmd_text.ljust(width - 12)} #{duration}"
24
24
  end
25
25
 
26
26
  if entry.annotation
27
27
  annotation_line = " \u21b3 #{entry.annotation}"
28
- lines << Flourish::Style.new.foreground(DIM).render(annotation_line)
28
+ lines << Chamomile::Style.new.foreground(DIM).render(annotation_line)
29
29
  end
30
30
 
31
31
  if entry.undo_command
32
32
  undo_line = " \u21b3 Undo: #{entry.undo_command.join(' ')}"
33
- lines << Flourish::Style.new.foreground(DIM).render(undo_line)
33
+ lines << Chamomile::Style.new.foreground(DIM).render(undo_line)
34
34
  end
35
35
 
36
36
  lines.join("\n")
@@ -10,7 +10,7 @@ module LazyRails
10
10
  if selected
11
11
  ViewHelpers.selected_style.render(text.ljust(width))
12
12
  else
13
- Flourish::Style.new.foreground(color).render(text)
13
+ Chamomile::Style.new.foreground(color).render(text)
14
14
  end
15
15
  end
16
16
 
@@ -22,7 +22,7 @@ module LazyRails
22
22
  lines << if entry.success?
23
23
  "=> #{entry.result}"
24
24
  else
25
- Flourish::Style.new.foreground("#ff6347").render("Error: #{entry.error}")
25
+ Chamomile::Style.new.foreground("#ff6347").render("Error: #{entry.error}")
26
26
  end
27
27
 
28
28
  lines << ""
@@ -10,7 +10,7 @@ module LazyRails
10
10
  ViewHelpers.selected_style.render(text.ljust(width))
11
11
  else
12
12
  color = credential_file.exists ? "#04b575" : "#666666"
13
- Flourish::Style.new.foreground(color).render(text)
13
+ Chamomile::Style.new.foreground(color).render(text)
14
14
  end
15
15
  end
16
16
 
@@ -34,7 +34,7 @@ module LazyRails
34
34
  lines << ""
35
35
  lines << content
36
36
  lines << ""
37
- warn_style = Flourish::Style.new.foreground("#e5c07b")
37
+ warn_style = Chamomile::Style.new.foreground("#e5c07b")
38
38
  lines << warn_style.render("\u26a0 Sensitive \u2014 press Escape to clear")
39
39
  lines.join("\n")
40
40
  end
@@ -11,7 +11,7 @@ module LazyRails
11
11
  if selected
12
12
  ViewHelpers.selected_style.render(text.ljust(width))
13
13
  else
14
- icon = Flourish::Style.new.foreground(color).render(arrow)
14
+ icon = Chamomile::Style.new.foreground(color).render(arrow)
15
15
  "#{icon} #{migration.version} #{ViewHelpers.truncate(migration.name, width - 22)}"
16
16
  end
17
17
  end
@@ -65,7 +65,7 @@ module LazyRails
65
65
 
66
66
  diffs.each do |d|
67
67
  color = d.op == :add ? "#04b575" : "#ff6347"
68
- lines << Flourish::Style.new.foreground(color).render(d.to_s)
68
+ lines << Chamomile::Style.new.foreground(color).render(d.to_s)
69
69
  end
70
70
 
71
71
  lines << ""
@@ -14,14 +14,14 @@ module LazyRails
14
14
 
15
15
  def self.render(error_text, width:)
16
16
  lines = []
17
- lines << Flourish::Style.new.foreground("#ff6347").bold.render("Error")
17
+ lines << Chamomile::Style.new.foreground("#ff6347").bold.render("Error")
18
18
  lines << ("=" * [width - 4, 40].min)
19
19
  lines << ""
20
20
  lines << error_text
21
21
  lines << ""
22
22
 
23
23
  suggestion = detect_suggestion(error_text)
24
- lines << Flourish::Style.new.foreground("#e5c07b").render("Suggestion: #{suggestion}") if suggestion
24
+ lines << Chamomile::Style.new.foreground("#e5c07b").render("Suggestion: #{suggestion}") if suggestion
25
25
 
26
26
  lines.join("\n")
27
27
  end
@@ -30,13 +30,13 @@ module LazyRails
30
30
  ViewHelpers.selected_style.render(text.ljust(width))
31
31
  else
32
32
  color = STATUS_COLORS.fetch(job.status, "#cccccc")
33
- Flourish::Style.new.foreground(color).render(text)
33
+ Chamomile::Style.new.foreground(color).render(text)
34
34
  end
35
35
  end
36
36
 
37
37
  def self.render_detail(job, width:)
38
38
  lines = []
39
- lines << Flourish::Style.new.bold.render(job.class_name)
39
+ lines << Chamomile::Style.new.bold.render(job.class_name)
40
40
  lines << ""
41
41
 
42
42
  lines << "ID: #{job.id}"
@@ -64,7 +64,7 @@ module LazyRails
64
64
  # Arguments
65
65
  if job.arguments && !job.arguments.to_s.empty?
66
66
  lines << ""
67
- lines << Flourish::Style.new.bold.render("Arguments")
67
+ lines << Chamomile::Style.new.bold.render("Arguments")
68
68
  begin
69
69
  parsed = job.arguments.is_a?(String) ? JSON.parse(job.arguments) : job.arguments
70
70
  lines << JSON.pretty_generate(parsed)
@@ -76,13 +76,13 @@ module LazyRails
76
76
  # Error details for failed jobs
77
77
  if job.status == "failed"
78
78
  lines << ""
79
- lines << Flourish::Style.new.foreground("#ff6347").bold.render("Error")
79
+ lines << Chamomile::Style.new.foreground("#ff6347").bold.render("Error")
80
80
  lines << "#{job.error_class}: #{job.error_message}"
81
81
 
82
82
  if job.backtrace.is_a?(Array) && !job.backtrace.empty?
83
83
  lines << ""
84
- lines << Flourish::Style.new.bold.render("Backtrace")
85
- bt_style = Flourish::Style.new.foreground("#666666")
84
+ lines << Chamomile::Style.new.bold.render("Backtrace")
85
+ bt_style = Chamomile::Style.new.foreground("#666666")
86
86
  job.backtrace.first(20).each do |bt_line|
87
87
  lines << bt_style.render(" #{bt_line}")
88
88
  end
@@ -29,7 +29,7 @@ module LazyRails
29
29
  if selected
30
30
  ViewHelpers.selected_style.render(text.ljust(width))
31
31
  else
32
- Flourish::Style.new.foreground(color).render(text)
32
+ Chamomile::Style.new.foreground(color).render(text)
33
33
  end
34
34
  end
35
35
 
@@ -49,7 +49,7 @@ module LazyRails
49
49
  dur = sql[:duration_ms]
50
50
  color = dur.to_f > 100 ? "#ff6347" : "#5b9bd5"
51
51
  query_text = " #{sql[:query]} (#{dur}ms)"
52
- lines << Flourish::Style.new.foreground(color).render(query_text)
52
+ lines << Chamomile::Style.new.foreground(color).render(query_text)
53
53
  end
54
54
  lines << ""
55
55
  end
@@ -31,7 +31,7 @@ module LazyRails
31
31
  lines << ""
32
32
 
33
33
  if content[:error]
34
- lines << Flourish::Style.new.foreground("#ff6347").render("Error: #{content[:error]}")
34
+ lines << Chamomile::Style.new.foreground("#ff6347").render("Error: #{content[:error]}")
35
35
  return lines.join("\n")
36
36
  end
37
37
 
@@ -46,7 +46,7 @@ module LazyRails
46
46
  color = ARROW_COLORS[color_key] || "#999999"
47
47
 
48
48
  arrow_text = "#{macro_label} \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192 #{a.class_name}"
49
- styled_arrow = Flourish::Style.new.foreground(color).render(arrow_text)
49
+ styled_arrow = Chamomile::Style.new.foreground(color).render(arrow_text)
50
50
  lines << " #{connector}\u2500\u2500 #{styled_arrow}"
51
51
  end
52
52
  lines << ""
@@ -11,7 +11,7 @@ module LazyRails
11
11
  else
12
12
  desc_width = [width - name_text.length - 3, 0].max
13
13
  dimmed_desc = if desc_width.positive?
14
- Flourish::Style.new.foreground("#666666").render(ViewHelpers.truncate(desc,
14
+ Chamomile::Style.new.foreground("#666666").render(ViewHelpers.truncate(desc,
15
15
  desc_width))
16
16
  else
17
17
  ""
@@ -18,7 +18,7 @@ module LazyRails
18
18
  if selected
19
19
  ViewHelpers.selected_style.render("#{verb} #{path}".ljust(width))
20
20
  else
21
- styled_verb = Flourish::Style.new.foreground(VERB_COLORS[route.verb] || "#999999").render(verb)
21
+ styled_verb = Chamomile::Style.new.foreground(VERB_COLORS[route.verb] || "#999999").render(verb)
22
22
  "#{styled_verb} #{path}"
23
23
  end
24
24
  end
@@ -14,7 +14,7 @@ module LazyRails
14
14
  when :failed then "#ff6347"
15
15
  else "#999999"
16
16
  end
17
- Flourish::Style.new.foreground(color).render(text)
17
+ Chamomile::Style.new.foreground(color).render(text)
18
18
  end
19
19
  end
20
20
 
@@ -90,9 +90,9 @@ module LazyRails
90
90
 
91
91
  footer = "Enter continue | ! don't show again | #{scroll_hint}".strip
92
92
 
93
- box = Flourish::Style.new
93
+ box = Chamomile::Style.new
94
94
  .width(box_width)
95
- .border(Flourish::Border::ROUNDED)
95
+ .border(Chamomile::Border::ROUNDED)
96
96
  .border_foreground("#b48ead")
97
97
  .padding(0, 1)
98
98
  .render("#{content}\n\n#{footer}")
@@ -100,7 +100,7 @@ module LazyRails
100
100
  box_lines = box.lines
101
101
  if box_lines.any?
102
102
  title_text = " LazyRails "
103
- title_styled = Flourish::Style.new.foreground("#b48ead").bold.render(title_text)
103
+ title_styled = Chamomile::Style.new.foreground("#b48ead").bold.render(title_text)
104
104
  box_lines[0] = ViewHelpers.inject_title(box_lines[0], title_styled, title_text.length)
105
105
  end
106
106
 
data/lib/lazyrails.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "chamomile"
4
- require "petals"
5
- require "flourish"
6
4
  require "json"
7
5
  require "open3"
8
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazyrails-tui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Killilea
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-12 00:00:00.000000000 Z
11
+ date: 2026-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chamomile
@@ -16,42 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.2'
27
- - !ruby/object:Gem::Dependency
28
- name: chamomile-flourish
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '0.2'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '0.2'
41
- - !ruby/object:Gem::Dependency
42
- name: chamomile-petals
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.2'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.2'
26
+ version: '1.0'
55
27
  description: LazyRails gives Rails developers a fast, navigable TUI that surfaces
56
28
  everything the Rails CLI offers in a single split-pane interface.
57
29
  email: