Activity Feed

  Dennis Hackethal archived idea #4330 along with any revisions.
  Dennis Hackethal archived idea #859 along with any revisions.
  Dennis Hackethal addressed criticism #4330.

Redirects result in two additional requests, the first of which is a turbo-stream request that renders nothing, thus (presumably) prompting the browser to make another request for the same resource.

This? https://stackoverflow.com/a/74071278

#4330​·​Dennis HackethalOP, 8 months ago

Doesn't reproduce as of e71df95. In the app in test/dummy, a form whose action redirects takes one POST and one GET in a headless browser, which a system test now checks.

  Dennis Hackethal addressed criticism #859.

Could the errors around layouts be related to this?

#859​·​Dennis HackethalOP, almost 2 years ago

Probably, and they're fixed. Hiccdown used to force a layout (layout: true, then layout: !request.format.turbo_stream?), overriding the layout method turbo-rails relies on, and turbo-stream requests failed with "no default layout" (fef00cb). cf92f06, in version 1.5.2, stopped forcing a layout. As of c5ce76f and 4a087e4, to be released in version 1.6.0, tests check that frame requests keep Turbo's frame layout and that turbo streams get none, and the app in test/dummy shows it in a browser.

  Dennis Hackethal posted criticism #5847.

A helper method that calls another action's helper method by name can get another helper's. Rails mixes every helper into every view, so calling index from ItemsHelper#create runs whichever helper's index Rails included last, such as PagesHelper#index:

ruby
module ItemsHelper
def index
[:ul, @items.map { |i| [:li, i.name] }]
end
def create
index # PagesHelper#index, not ItemsHelper#index
end
end

Action names like index, show and edit are in many helpers, and the Readme encourages helper methods calling one another.

  Dennis Hackethal archived idea #5845 along with any revisions.
  Dennis Hackethal addressed criticism #5845.

On Rails 8.1, Hiccdown's capture hands keyword arguments to the block as key-value pairs rather than as keywords. capture(text: 'foo') { |text:| text } raises ArgumentError: missing keyword: :text instead of returning 'foo', and a block that takes them as a hash, { |options| … }, gets [:text, 'foo'] instead of {text: 'foo'}.

Earlier versions of Rails pass keywords on to the block as a hash, which Hiccdown leaves alone.

#5845​·​Dennis HackethalOP, 10 days ago​·​AI-assisted

Fixed as of 99b6280, to be released in version 1.6.0.

  Dennis Hackethal posted criticism #5845.

On Rails 8.1, Hiccdown's capture hands keyword arguments to the block as key-value pairs rather than as keywords. capture(text: 'foo') { |text:| text } raises ArgumentError: missing keyword: :text instead of returning 'foo', and a block that takes them as a hash, { |options| … }, gets [:text, 'foo'] instead of {text: 'foo'}.

Earlier versions of Rails pass keywords on to the block as a hash, which Hiccdown leaves alone.

  Dennis Hackethal archived idea #4329 along with any revisions.
  Dennis Hackethal commented on idea #4329.

Is there a way to teach user-built helpers how to process Hiccdown? Or maybe intercepting capture already took care of this?

#4329​·​Dennis HackethalOP, 8 months ago

Mostly, intercepting capture already took care of it: helpers of your own that pass a block on to Rails' helpers, or return Hiccdown, worked. Hiccdown given to Rails' helpers as content didn't, as in content_tag(:div, yield), tag.div([:span, 'foo']) or link_to([:span, 'foo'], path). As of 134deb9, to be released in version 1.6.0, it does.

  Dennis Hackethal archived idea #4328 along with any revisions.
  Dennis Hackethal commented on idea #4328.

Could the application layout live in ApplicationHelper#layout?

#4328​·​Dennis HackethalOP, 8 months ago

Yes. As of 4fd7a0e, to be released in version 1.6.0, the layout named X lives in XHelper#layout, just as it would in layouts/X.html.erb, so the application layout lives in ApplicationHelper#layout. yield and yield(:title) work as in an ERB layout, and layout files keep working for a gradual migration.

  Dennis Hackethal archived idea #5840 along with any revisions.
  Dennis Hackethal addressed criticism #5840.

Hiccdown finds an action's helper method through params[:action] rather than the controller's action_name. When a controller runs without the router, as in ProductsController.action(:show).call(env), params[:action] is nil and rendering raises NoMethodError: undefined method 'to_sym' for nil instead of calling ProductsHelper#show.

#5840​·​Dennis HackethalOP, 10 days ago​·​AI-assisted

Fixed as of 31cf174, to be released in version 1.6.0.

  Dennis Hackethal archived idea #5839 along with any revisions.
  Dennis Hackethal addressed criticism #5839.

Calling render with options only, such as render status: :not_found or render layout: 'admin', skips the action's helper method and looks for an ERB template instead. Without one, it raises ActionView::MissingTemplate:

ruby
class ProductsController < ApplicationController
def show
render status: :not_found # MissingTemplate, though ProductsHelper#show exists
end
end

Naming the action works around it: render :show, status: :not_found.

#5839​·​Dennis HackethalOP, 10 days ago​·​AI-assisted

Fixed as of 9c46c61, to be released in version 1.6.0.

  Dennis Hackethal posted criticism #5840.

Hiccdown finds an action's helper method through params[:action] rather than the controller's action_name. When a controller runs without the router, as in ProductsController.action(:show).call(env), params[:action] is nil and rendering raises NoMethodError: undefined method 'to_sym' for nil instead of calling ProductsHelper#show.

  Dennis Hackethal posted criticism #5839.

Calling render with options only, such as render status: :not_found or render layout: 'admin', skips the action's helper method and looks for an ERB template instead. Without one, it raises ActionView::MissingTemplate:

ruby
class ProductsController < ApplicationController
def show
render status: :not_found # MissingTemplate, though ProductsHelper#show exists
end
end

Naming the action works around it: render :show, status: :not_found.

  Dennis Hackethal archived idea #4333 along with any revisions.
  Dennis Hackethal addressed criticism #4333.

When an empty block is passed to render, it results in an empty tag '<>'

#4333​·​Dennis HackethalOP, 8 months ago

Fixed as of c36fa5c, version 1.5.2.

  Dennis Hackethal updated discussion ‘How Does Veritula Work?’.

The ‘About’ section changed as follows:

New to Veritula? Start here to get oriented.

  Dennis Hackethal archived idea #3974 along with any revisions.
  Dennis Hackethal addressed criticism #3974.

Undo/redo stack should preserve cursor position.

Steps to reproduce:

  1. Start with empty textarea.
  2. Type '('.
  3. Cursor is now inside '(|)'.
  4. Hit undo.
  5. Hit redo.
  6. Cursor is now behind '()|' but should be inside like in step 3.
#3974​·​Dennis HackethalOP, 9 months ago

Fixed as of ed8868b, version 1.3.1.

  Zelalem Mekonnen commented on criticism #5265.

There’s no need to single out corroboration or verisimilitude as special kinds of criticism.

Preference formation using either can easily be reduced to the method of counting pending criticisms:

Idea A fails to survive two tests.
Idea B fails to survive only one of the two.
Idea C says: I have only A and B; I don’t have time to create another; although both are false, I have to act; so for now I prefer B since at least it passes a test A doesn’t.

If idea C has no pending criticisms, then we should adopt it. (And thus ‘transitively’ adopt B.)

#5265​·​Dennis Hackethal, 2 months ago

This works if the tests are identical. What happens if idea A passes test 1 but fails test 2, while idea B passes test 2 but fails test 1?