Class: Plutonium::Interaction::Async::RunDefinition::IndexPage

Inherits:
IndexPage
  • Object
show all
Includes:
Phlex::Rails::Helpers::TurboFrameTag
Defined in:
lib/plutonium/interaction/async/run_definition.rb

Overview

The index refreshes itself while any run is still working.

ONE frame around the collection, not one per row. A turbo-frame is not in the content model of tr, so a frame wrapping a row is hoisted out of the table by the HTML parser before Turbo ever sees it. A frame per CELL parses, but buys one poller per row for a single page.

The Stimulus controller sits INSIDE the frame, exactly as UI::Interaction::Async::RunProgress places it: a frame navigation replaces the frame's CONTENTS, not the frame element, so a controller on the tag itself could never be removed and the timer would never stop.

Constant Summary collapse

FRAME_ID =
"pu_async_runs_index"

Instance Method Summary collapse

Instance Method Details

#view_templateObject

Answers the frame's poll with the collection ALONE, for the reason spelled out on ShowPage: DynaFrameContent already wraps every response in a frame named by the inbound header, so emitting the page would nest the whole thing inside its own frame, and again on the next poll.



103
104
105
106
107
108
109
# File 'lib/plutonium/interaction/async/run_definition.rb', line 103

def view_template(&)
  return super unless answering_own_frame?

  DynaFrameContent() do
    render_default_content
  end
end