All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Entries for unreleased work are not written here directly. Each issue drops a
fragment in changelog.d/; the fragments are assembled
into a version section at release. See that README for the format and for when a
change warrants an entry at all.
[0.1.0] 2026-11-26
The first release of riddler_live_view, the Phoenix LiveView face of
riddler. It renders what riddler presents for one step of a Journey as plain
semantic HTML, a function component for each element kind and the
RiddlerLiveView.Journey LiveComponent a host embeds, and it owns no state
and steps nothing: the host's engine steps the Journey, and the host decides
who may see it. It requires riddler ~> 0.9 and phoenix_live_view ~> 1.2.
Added
RiddlerLiveView.Componentsrenders a presented screen as plain semantic HTML:frame/1draws the screen with its title, and progress where the host supplied it, around its elements, andheading/1andtext/1render theheadingandtextelements, each with aclassand stabledata-riddler-*attributes and no stylesheet.RiddlerLiveView.JourneyasksRiddler.Journey.Access.check/4of the host'saccessmodule on mount, on every refresh, before every submit and before every back, and again when thejourney,host,accessoractorassign changes, and draws one refusal, carryingdata-riddler-refusedand the newrefused_text, alike for a Journey the host does not have and one the actor may not see; a membership revoked after the mount refuses the next submit or back.RiddlerLiveView.JourneyraisesArgumentErrorwhen it mounts without anaccessmodule, or with one that is not a loaded module exportingmember?/2.- A host callback or access module that raises, throws or exits, a host answer outside
Riddler.Journey.Host, an answer not of a shapeRiddler.Journey.present/3gives (a waiting answer'sretry_after_msthat is not an integer of 0 or more among them), and an answer or findings whose markup raises when rendered no longer crash the LiveView: the component draws the refusal on present and on the access check, keeps what is drawn on submit and back, and logs one line naming the callback and the kind of failure, never the event's parameters. RiddlerLiveView.Journeywaits at most 4294967295 milliseconds, about 49.7 days, before asking the host again after a waiting answer: a longerretry_after_mswaits that long.RiddlerLiveView.Journey, the LiveComponent a host's LiveView embeds: given the host's name for a Journey and itsRiddler.Journey.Hostmodule, it draws the screen the host presents, hands the host each submit and back request built from the presented answer, draws the host's findings beside the questions they name, draws waiting and asks the host again after the answer'sretry_after_ms, and draws done; an outcome the moves did not list, a back request the moves did not offer, a form from another screen and a screen with an element nothing draws are refused without calling the host.- Every component that derives an
idtakesid_prefix, so two screens or two Journeys on one page carry noidtwice. RiddlerLiveView.Components.frame/1takesrefusals, a count of refused submits, so focus moves to the first finding again on every refusal.RiddlerLiveView.Components.secret_question/1names its inputriddler-password[and the question's key and]unless the host passes aname, so Phoenix's default:filter_parameterskeeps the value out of the line LiveView logs for each event.RiddlerLiveView.Components.image/1,divider/1andlink/1render theimage,dividerandlinkelements: an image is animgwhosealtis always drawn,alt=""for a decorative image, with its size and fit carried asdata-riddler-sizeanddata-riddler-fit; a divider is anhr; a link is a plaina hrefthat submits no form and raises no outcome, with its style carried asdata-riddler-style.elements/1draws all three, so a screen carrying them is no longer blocked as one with a kind the package does not draw.RiddlerLiveView.Components.text/1draws a text's style as a class,riddler-text-captionfor a caption andriddler-text-bodyotherwise.- Every component draws an element's
accessible_labelas thearia-labelof the node a visitor reaches, and itsaccessible_descriptionas hidden text that node names last in itsaria-describedby; a text, whose paragraph takes no name, draws only the description, and an element that carries neither draws the markup it drew before. RiddlerLiveView.Components.heading/1,text/1,image/1,divider/1,link/1andbutton/1take anid_prefix, whichelements/1passes them, for theidof the description they draw.RiddlerLiveView.Components.choice_question/1names its help in thearia-describedbyof a<select>or a search input as well as of its fieldset.RiddlerLiveView.Components.text_question/1draws a question of thedateortimeformat as the browser's own date or time input, carrying its presentedminandmax, and submits a value in riddler's shape for the format; a time input carriesstep="1"where its presented value or a bound carries seconds; a question of thedatetimeformat stays a plain text input.RiddlerLiveView.Components.text_question/1draws themultilinehint as atextareaunder no format or thepatternformat, and under theintegerornumberformat thesliderhint as a range input, only where itsminandmaxare both numbers, and thestepperhint as a number input, each carrying its bounds andstep, and underintegeronly where every numeric bound is a whole number; it draws a hint it does not draw for the question as the question with no hint; the hint is carried asdata-riddler-style.RiddlerLiveView.Components.choice_question/1draws thechipshint as the question's radio buttons or checkboxes, each markedriddler-chip, and asearchablequestion underselectone as a text input bound to adatalistof the options, carryingdata-riddler-styleanddata-riddler-searchable.RiddlerLiveView.Components.choice_question/1draws an option'sdescriptionwith anidderived from the option's and names it in that option'saria-describedby: after the option's label beside a radio button or a checkbox, and in a description list after aselector adatalist.RiddlerLiveView.Components.button/1renders abuttonelement as a submit button whose name and value carry its outcome, drawn only where the answer's moves list that outcome; a button that does not validate carriesformnovalidateanddata-riddler-validates="false".back/1draws the Back control only where the moves say back, and pushes riddler's back request, the screen's key andbacktrue with no outcome.RiddlerLiveView.Components.text_question/1andsecret_question/1render thetext_questionandsecret_questionelements as a labelled input with its help: the text question's input takes its type from the format and draws the presented value, and the secret question's password input setsautocomplete="off", never carries a value and says when a value is held.- The question components and
RiddlerLiveView.Components.frame/1take a refused submit'sfindings, asRiddler.Findingstructs or their wire form: a question draws each finding whoseelement_keyis its key beside its input, names it in the input'saria-describedbyahead of the help and setsaria-invalid="true", the frame draws the findings that name no question of the screen, and focus moves to the first finding when they appear; a finding shows itsauthor_messagewhere the author wrote one and otherwise the package's own text for its code, which a host replaces throughfinding_text, and never itsmessage. RiddlerLiveView.Journeytakes atime_zoneassign, the visitor's time zone as a name the host's time zone database resolves; with it a question of thedatetimeformat is drawn as a datetime-local input, its presentedmin,maxand value drawn as wall times in that zone, and the zone's offset is added to the submitted wall time so riddler validates an instant.RiddlerLiveView.Components.text_question/1andelements/1take the sametime_zoneattribute. Without one a datetime question stays a plain text input.RiddlerLiveView.Components.choice_question/1andboolean_question/1render thechoice_questionandboolean_questionelements: a choice question is a fieldset whose legend is its label, drawing radio buttons or a dropdown underselectone and checkboxes or a multiple select under many, with the presented selection chosen and its selection bounds carried as data attributes, and a boolean question is a lone labelled checkbox, ticked where the answer presents true.RiddlerLiveView.Components.elements/1draws every element of a screen through the component for its kind and a host's own kinds through a component map,components, that names the host's function component for each; an element of a kind nothing draws is not drawn, a notice whose text the host replaces throughunknown_textis drawn above the elements, and every button is drawn disabled and names the notice, through the newblocked_byattribute ofbutton/1;unknown_kinds/2answers those kinds so a host refuses a submit of that screen.
Changed
- The package requires riddler
~> 0.9, the first release that presents the image, divider and link elements and a text's style.