Skip to content

Commit 130674c

Browse files
committed
Remove concerns
1 parent 7b33a8f commit 130674c

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

lib/minigun/hud/flow_diagram.rb

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module Minigun
66
module HUD
77
# Renders pipeline DAG as animated ASCII flow diagram with boxes and connections
88
class FlowDiagram
9-
attr_reader :width, :height, :diagram_width
109

1110
def initialize(width, height)
1211
@width = width
@@ -24,11 +23,11 @@ def resize(width, height)
2423

2524
# Calculate layout and return diagram dimensions
2625
def prepare_layout(stats_data)
27-
return { width: 0, height: @height, diagram_height: 0 } unless stats_data && stats_data[:stages]
26+
return { width: 0, diagram_height: 0 } unless stats_data && stats_data[:stages]
2827

2928
stages = stats_data[:stages]
3029
dag = stats_data[:dag]
31-
return { width: 0, height: @height, diagram_height: 0 } if stages.empty?
30+
return { width: 0, diagram_height: 0 } if stages.empty?
3231

3332
# Filter out router stages (internal implementation details)
3433
visible_stages = stages.reject { |s| s[:type] == :router }
@@ -47,7 +46,7 @@ def prepare_layout(stats_data)
4746
end
4847

4948
# Return diagram dimensions
50-
{ width: @diagram_width, height: @height, diagram_height: @diagram_height }
49+
{ width: @diagram_width, diagram_height: @diagram_height }
5150
end
5251

5352
# Render the flow diagram to terminal at given position
@@ -377,8 +376,6 @@ def render_fanout_connection(terminal, from_pos, target_positions, stage_data, x
377376
to_y = to_pos[:y]
378377

379378
((split_y + 1)...to_y).each do |y|
380-
next if y < 0 || y >= @height
381-
382379
char = if active
383380
offset = (@animation_frame / 4) % Theme::FLOW_CHARS.length
384381
phase = (y - split_y + offset) % Theme::FLOW_CHARS.length
@@ -418,8 +415,6 @@ def render_fanin_connection(terminal, source_positions, to_pos, stage_data, x_of
418415
source_data.each do |source|
419416
# Vertical line from source to turn point
420417
(source[:y]...merge_y).each do |y|
421-
next if y < 0 || y >= @height
422-
423418
char = if active
424419
offset = (@animation_frame / 4) % Theme::FLOW_CHARS.length
425420
phase = (y - source[:y] + offset) % Theme::FLOW_CHARS.length
@@ -491,8 +486,6 @@ def render_connection_line(terminal, from_pos, to_pos, stage_data, x_offset, y_o
491486
if from_x == to_x
492487
# Straight vertical line
493488
(from_y...to_y).each do |y|
494-
next if y < 0 || y >= @height
495-
496489
char = if active
497490
offset = (@animation_frame / 4) % Theme::FLOW_CHARS.length
498491
phase = (y - from_y + offset) % Theme::FLOW_CHARS.length
@@ -526,8 +519,6 @@ def render_connection_line(terminal, from_pos, to_pos, stage_data, x_offset, y_o
526519

527520
# Second vertical segment (drop to target)
528521
((mid_y + 1)...to_y).each do |y|
529-
next if y < 0 || y >= @height
530-
531522
char = if active
532523
offset = (@animation_frame / 4) % Theme::FLOW_CHARS.length
533524
phase = (y - mid_y + offset) % Theme::FLOW_CHARS.length

0 commit comments

Comments
 (0)