<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Leon</title>
    <description>The latest articles on DEV Community by Leon (@laconicleon).</description>
    <link>https://dev.to/laconicleon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4059719%2F41d9b1c3-d318-4507-a4d7-64357dba5687.png</url>
      <title>DEV Community: Leon</title>
      <link>https://dev.to/laconicleon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/laconicleon"/>
    <language>en</language>
    <item>
      <title>Why an SVG round-trip check needs both structure and rendered pixels</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Sat, 28 Nov 2026 09:45:47 +0000</pubDate>
      <link>https://dev.to/laconicleon/why-an-svg-round-trip-check-needs-both-structure-and-rendered-pixels-1ih6</link>
      <guid>https://dev.to/laconicleon/why-an-svg-round-trip-check-needs-both-structure-and-rendered-pixels-1ih6</guid>
      <description>&lt;p&gt;A rendered image tells you what the reader sees. It cannot tell you whether the text is still editable, whether an image points to a missing path, or whether an object you can select has become part of a flat image. For an SVG round trip, I keep a structural check next to the render comparison.&lt;/p&gt;

&lt;p&gt;Start with a small diagnostic copy rather than an important file. Add one native text element and a distinct shape. If your actual workflow depends on clipping or an external bitmap, add those as separate features so you can diagnose each one independently. Keep the original file and a known rendering environment.&lt;/p&gt;

&lt;p&gt;After saving and reopening, inspect the SVG for the feature you need. For an XML-aware check, compare the SVG namespace, root dimensions and intended element types. Check effective image references rather than just counting image nodes, and check for actual text nodes before promising editability. Then render both versions at the same dimensions and compare decoded pixels. A different XML serialization or PNG checksum alone cannot tell you that the drawing changed.&lt;/p&gt;

&lt;p&gt;If only structure differs, decide whether editability or portability is affected. If only the rendered pixels differ, look at the fonts, rendering engine and export settings before blaming the round trip. The small recorded FOSS Desk Inkscape test is a concrete starting point. It does not establish interoperability with Illustrator or complex production SVGs.&lt;/p&gt;

&lt;p&gt;I maintain FOSS Desk. AI drafted this article from the documented test and the accompanying diagnostic method.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://fossdesk.com/adobe-alternatives/#inkscape-test" rel="noopener noreferrer"&gt;Recorded Inkscape round-trip results and limitations&lt;/a&gt;&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>softwaredevelopment</category>
      <category>testing</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A saved-list test needs a second browser context</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Sat, 28 Nov 2026 06:52:18 +0000</pubDate>
      <link>https://dev.to/laconicleon/a-saved-list-test-needs-a-second-browser-context-5epd</link>
      <guid>https://dev.to/laconicleon/a-saved-list-test-needs-a-second-browser-context-5epd</guid>
      <description>&lt;p&gt;A browser-local shortlist and an account-backed library can look almost identical in a screenshot. The difference becomes visible when you change the storage boundary. A test that saves an item and immediately reads it back proves less than its name may suggest.&lt;/p&gt;

&lt;p&gt;I work on &lt;a href="https://riddlelist.com/" rel="noopener noreferrer"&gt;Riddle List&lt;/a&gt;, a puzzle directory with browser-local saved entrances. This is a standalone test-design note, prepared with AI assistance. It is not a report that new production tests or features were deployed today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Name the storage boundary in the expectation
&lt;/h2&gt;

&lt;p&gt;Before writing an assertion, state which browser profile, origin and session you intend to preserve. Reloading a page in one context asks whether the item survives a reload. Opening a second isolated context asks whether a different visitor starts with an empty local state. Those are complementary checks, not contradictory outcomes.&lt;/p&gt;

&lt;p&gt;Use a fixture containing two catalog items with stable identities. Keep their titles distinct enough that a failed assertion tells you which one disappeared. The test should start with an explicit clean state for that fixture, without clearing a real person's browser data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exercise four journeys
&lt;/h2&gt;

&lt;p&gt;First, save one item and reload within the same context. Check the saved state and the saved-list view. If the interface has both a sidebar and a drawer, verify that the two presentations agree.&lt;/p&gt;

&lt;p&gt;Second, open the same directory in a fresh isolated context. Check that the first context's shortlist has not appeared there. A failure can reveal a leaky test fixture, not necessarily an unexpected sync feature.&lt;/p&gt;

&lt;p&gt;Third, return to the first context and remove the saved item. Reload again. This checks deletion persistence rather than only creation persistence.&lt;/p&gt;

&lt;p&gt;Fourth, keep an unrelated saved item while adding and removing the fixture item. A test that clears the entire list before every assertion can miss an implementation that accidentally overwrites all previous entries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep publisher progress outside this contract
&lt;/h2&gt;

&lt;p&gt;Following an official play link should not be described as transferring a game's guesses or streak. A directory bookmark and the publisher's own state belong to different products. Verify the outbound destination independently; do not treat a familiar title as proof that it opens the intended publisher.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" rel="noopener noreferrer"&gt;MDN localStorage reference&lt;/a&gt; documents origin-specific storage and its access limitations. A test plan should also cover unavailable storage if the application promises a fallback. That is separate from the normal empty-list case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the test name honest
&lt;/h2&gt;

&lt;p&gt;“Saved item survives a reload in the same context” is a useful claim. “Saved items work everywhere” is not supported by that journey. Keep the larger promise out of the test name unless you actually exercise the additional contexts, devices or account service.&lt;/p&gt;

&lt;p&gt;The result is a narrower test suite with clearer failures: retention, isolation, deletion and preservation of unrelated items each have their own observable outcome.&lt;/p&gt;

</description>
      <category>testing</category>
    </item>
    <item>
      <title>Keep visible counts and accessible labels in the same grammar</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Fri, 27 Nov 2026 12:37:14 +0000</pubDate>
      <link>https://dev.to/laconicleon/keep-visible-counts-and-accessible-labels-in-the-same-grammar-5fac</link>
      <guid>https://dev.to/laconicleon/keep-visible-counts-and-accessible-labels-in-the-same-grammar-5fac</guid>
      <description>&lt;p&gt;A category can look fine in a screenshot while its accessible name still says “1 games.” The count and its sentence often come from different expressions. Fixing one expression leaves the other untouched.&lt;/p&gt;

&lt;p&gt;I work on &lt;a href="https://riddlelist.com/" rel="noopener noreferrer"&gt;Riddle List&lt;/a&gt;, a daily-puzzle directory. A recent count-label correction is a useful reminder to treat the visible count and the control’s accessible name as one output contract. The example below is standalone teaching code, not another change to the live site. This post and the example were prepared with AI assistance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Return the two labels together
&lt;/h2&gt;

&lt;p&gt;This helper deliberately supports nonnegative integer counts and English wording only. It rejects an invalid count rather than hiding a catalog-data problem behind a label.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;categoryLabels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'string'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TypeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'A category name is required'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isSafeInteger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RangeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Count must be a nonnegative safe integer'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sb"&gt;`${count} ${count === 1 ? 'game' : 'games'}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;visible&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;accessible&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`Browse ${name} (${amount})`&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;code&gt;categoryLabels('Spatial', 1)&lt;/code&gt;, the visible label is &lt;code&gt;1 game&lt;/code&gt; and the accessible name is &lt;code&gt;Browse Spatial (1 game)&lt;/code&gt;. A count of zero produces &lt;code&gt;0 games&lt;/code&gt;. Do not add a second pluralization expression when rendering the mobile drawer; pass the same result into both presentations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the control, not just a string in isolation
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-label" rel="noopener noreferrer"&gt;MDN reference for aria-label&lt;/a&gt; explains that it supplies an accessible name. That does not mean every button needs an added &lt;code&gt;aria-label&lt;/code&gt;. If its visible text already gives it an adequate name, prefer that native text. The helper is for an interface that already requires a more descriptive accessible name, such as a count beside a category title.&lt;/p&gt;

&lt;p&gt;A useful rendered check has two parts: inspect the count that a sighted visitor sees, and inspect the same control’s accessible name. Run that check for a singleton and for a plural category in each responsive navigation layout. A correct desktop sidebar is not evidence that a separate mobile drawer uses the same formatter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the scope of the fix small
&lt;/h2&gt;

&lt;p&gt;Changing a label should not remove a category, change a route, or clear a saved game. Those are separate behaviors with their own acceptance criteria. For a live directory, first establish the category buttons and their filters still exist; then verify the changed wording on the public page.&lt;/p&gt;

&lt;p&gt;The short helper is intentionally not an internationalization library. If the interface adds other languages, use locale-specific plural rules and translated messages. The &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules" rel="noopener noreferrer"&gt;Intl.PluralRules reference&lt;/a&gt; is a starting point for that broader problem. Extending an English singular/plural expression by guessing other languages would repeat the same mistake at a larger scale.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>How I checked a RawTherapee batch preset across three RAW formats</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Fri, 27 Nov 2026 11:52:56 +0000</pubDate>
      <link>https://dev.to/laconicleon/how-i-checked-a-rawtherapee-batch-preset-across-three-raw-formats-1l59</link>
      <guid>https://dev.to/laconicleon/how-i-checked-a-rawtherapee-batch-preset-across-three-raw-formats-1l59</guid>
      <description>&lt;p&gt;A preset can affect three photos without producing the same look across cameras. I wanted to verify something more modest: did the same saved profile reach each input, and could I reproduce the batch?&lt;/p&gt;

&lt;p&gt;I ran RawTherapee 5.13 on one CR2, one ARW and one DNG using its own CLI. I exported a comparison run without passing the PP3 explicitly, then applied the same saved PP3 to the whole directory and ran it again. I kept those exports in separate directories and verified the input digests before and after.&lt;/p&gt;

&lt;p&gt;Each applied JPEG decoded fully and differed from its corresponding comparison export. The six accompanying PP3s from the two applied runs recorded the same tested exposure, contrast and saturation settings (+0.5, 5 and 10), plus highlight compression at 30. The three cameras still need individual judgement. The comparison run is simply what the CLI did without that explicit PP3, not a neutral color reference.&lt;/p&gt;

&lt;p&gt;If you try this, put a single copy of each RAW format in a test directory. Choose a separate output directory for each run, use the CLI help for the installed release, and check an exported profile as well as the finished JPEG. This test does not cover GUI copy and paste, large libraries or matching another RAW developer's rendering.&lt;/p&gt;

&lt;p&gt;I maintain FOSS Desk. AI helped draft this article.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://fossdesk.com/lightroom-alternative/#hands-on" rel="noopener noreferrer"&gt;RAW processing results and observed limits&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cli</category>
      <category>photography</category>
      <category>tools</category>
    </item>
    <item>
      <title>Test Morse timing as data before playing audio</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Thu, 26 Nov 2026 02:56:06 +0000</pubDate>
      <link>https://dev.to/laconicleon/test-morse-timing-as-data-before-playing-audio-pid</link>
      <guid>https://dev.to/laconicleon/test-morse-timing-as-data-before-playing-audio-pid</guid>
      <description>&lt;p&gt;An audio button for a Morse letter looks simple: make a short tone for a dot and a longer one for a dash. The silence between those tones matters just as much.&lt;/p&gt;

&lt;p&gt;A useful way to build the control is to calculate its timing first, then pass that schedule to the audio layer. This gives you something small and deterministic to test before you listen to the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with one character
&lt;/h2&gt;

&lt;p&gt;In International Morse, a dot takes one time unit, a dash takes three, and the gap between marks within a character takes one. The &lt;a href="https://www.itu.int/rec/R-REC-M.1677-1-200910-I/en" rel="noopener noreferrer"&gt;ITU's International Morse code recommendation&lt;/a&gt; also distinguishes the longer gaps between characters and words.&lt;/p&gt;

&lt;p&gt;For a single letter, keep the problem small. This helper accepts a dot-and-dash pattern and returns a list of tone intervals:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;planCharacter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unitMs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!/^&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;$&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RangeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Use dots and dashes for one character"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isFinite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;unitMs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;unitMs&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RangeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"The time unit must be positive"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;marks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;cursorMs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;symbol&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;durationMs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;unitMs&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;symbol&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"."&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;marks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;startMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cursorMs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;durationMs&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;cursorMs&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;durationMs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cursorMs&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;unitMs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;marks&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;durationMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cursorMs&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;code&gt;A&lt;/code&gt;, which is &lt;code&gt;.-&lt;/code&gt;, &lt;code&gt;planCharacter(".-")&lt;/code&gt; returns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;marks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;startMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;durationMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;startMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;240&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;durationMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;360&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;durationMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second mark starts at 240 ms because the dot is followed by 120 ms of silence. There is no extra trailing gap in this result. A caller that plays a sequence of letters should add the appropriate character or word spacing separately; this function only plans one character.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the schedule before the sound
&lt;/h2&gt;

&lt;p&gt;Some useful fixtures are easy to reason about:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Tone durations&lt;/th&gt;
&lt;th&gt;Total, including internal gaps&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;120 ms&lt;/td&gt;
&lt;td&gt;120 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;360 ms&lt;/td&gt;
&lt;td&gt;360 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.-&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;120, 360 ms&lt;/td&gt;
&lt;td&gt;600 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;120, 120, 120 ms&lt;/td&gt;
&lt;td&gt;600 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;---&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;360, 360, 360 ms&lt;/td&gt;
&lt;td&gt;1320 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Also check that empty patterns, spaces inside a pattern, and non-positive time units fail visibly. Silently dropping an unexpected symbol can make a wrong pattern sound plausible.&lt;/p&gt;

&lt;p&gt;This helper validates the pattern's syntax. It does not check whether that pattern is assigned to a letter. Keep the alphabet mapping as a separate, reviewable table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep playback predictable
&lt;/h2&gt;

&lt;p&gt;When connecting the schedule to Web Audio, convert milliseconds to seconds once and schedule against the audio context's clock. Start playback from a user action, and decide what a second click should do: stop the current letter, queue the next one, or wait until playback finishes. That decision belongs in the control's behavior and its tests.&lt;/p&gt;

&lt;p&gt;For the interface, use a native button with a clear name such as “Play A.” Keep the letter and its written pattern visible, so the sound supplements a reference that works without audio. A print view should retain those two pieces of information and remove controls that cannot be used on paper.&lt;/p&gt;

&lt;p&gt;I maintain Txtopia, which has a &lt;a href="https://txtopia.com/morse-code-alphabet/" rel="noopener noreferrer"&gt;free A–Z Morse alphabet reference with individual letter audio and a printable chart&lt;/a&gt;. The helper above is a standalone teaching example, rather than a claim about the application's internal implementation. It illustrates a boundary that is useful in small browser tools: calculate the behavior as data, then connect it to the browser API.&lt;/p&gt;

&lt;p&gt;The timing fixtures make a good first check. Listening, keyboard use, repeated clicks, and the printed page still need separate checks.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Treat unavailable localStorage differently from an empty shortlist</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Mon, 23 Nov 2026 12:51:31 +0000</pubDate>
      <link>https://dev.to/laconicleon/treat-unavailable-localstorage-differently-from-an-empty-shortlist-5h94</link>
      <guid>https://dev.to/laconicleon/treat-unavailable-localstorage-differently-from-an-empty-shortlist-5h94</guid>
      <description>&lt;p&gt;I build &lt;a href="https://riddlelist.com/" rel="noopener noreferrer"&gt;Riddle List&lt;/a&gt;, a daily-puzzle discovery directory with a browser-local shortlist. That makes a small UI distinction important: “there is nothing saved” and “the browser could not read storage” should not mean the same thing.&lt;/p&gt;

&lt;p&gt;This is a standalone educational example, not a copy of the site's production storage format. Do not paste it over an existing application's keys or migrate real users without a separate compatibility plan. This article and example were prepared with AI assistance and reviewed and tested during the project work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four read states, not one empty array
&lt;/h2&gt;

&lt;p&gt;A helper that catches every exception and returns &lt;code&gt;[]&lt;/code&gt; is convenient until another effect writes that empty array back. A failed read can then look like an intentional empty shortlist. The same problem occurs if an old payload uses an unsupported schema version.&lt;/p&gt;

&lt;p&gt;The reader below returns an explicit status:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;missing&lt;/code&gt;: the key does not exist.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ok&lt;/code&gt;: the version and every ID are valid, including an intentionally empty array.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;invalid&lt;/code&gt;: the key exists, but the data cannot be understood.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;unavailable&lt;/code&gt;: accessing storage threw an exception.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reading never writes, repairs or deletes the original value. The caller can show a recovery option for invalid data and keep the current in-memory list when persistence is unavailable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Standalone educational example, not Riddle List application source.&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;loadShortlist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;raw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'unavailable'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'missing'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
        &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;every&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'string'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'invalid'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'ok'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'invalid'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;saveShortlist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;every&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'string'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'invalid'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'saved'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'unavailable'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Keep persistence out of the hydration effect
&lt;/h2&gt;

&lt;p&gt;Load once into a result object. Do not immediately save &lt;code&gt;result.ids&lt;/code&gt; on every result status. A missing key can initialize an empty list; an &lt;code&gt;ok&lt;/code&gt; result can hydrate a list; an invalid or unavailable result needs a separate UI decision.&lt;/p&gt;

&lt;p&gt;Likewise, the save function returns &lt;code&gt;saved&lt;/code&gt; only after &lt;code&gt;setItem&lt;/code&gt; succeeds. An app can continue working with an in-memory shortlist after an unavailable result, but should tell the user it could not persist the change. Silently displaying “saved” would promise durability the code has not established.&lt;/p&gt;

&lt;p&gt;Deduplication preserves the first occurrence's order. It does not rename IDs or map them to a new catalog. Stable identity and route migrations deserve their own compatibility tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I checked
&lt;/h2&gt;

&lt;p&gt;The standalone module passed six Node test cases using fake storage objects: missing versus stored-empty, a blocked read, malformed/wrong-version/wrong-type payloads, ordered deduplication without overwriting bad data, a failed write, and valid-write round trips with invalid-input protection. These are unit checks of the example, not a claim that every browser storage policy was exercised.&lt;/p&gt;

&lt;p&gt;To exercise the real UI, also check a reload in the same browser, an environment where persistence is unavailable, and the message shown when saving fails. Keep a disposable key for demonstrations. Never use another site's live storage as a test fixture.&lt;/p&gt;

&lt;h2&gt;
  
  
  The product boundary matters too
&lt;/h2&gt;

&lt;p&gt;A directory bookmark and a game's progress are different records. Saving a game in Riddle List means adding it to that browser's shortlist. It does not save the publisher's puzzle attempt or create cloud synchronization. Keeping that boundary visible in the interface is as useful as catching the exception in code.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API" rel="noopener noreferrer"&gt;MDN Web Storage API documentation&lt;/a&gt; explains availability checks and storage operations. Use the browser's actual behavior as the evidence for the message you display.&lt;/p&gt;

</description>
      <category>browser</category>
      <category>frontend</category>
      <category>javascript</category>
      <category>ui</category>
    </item>
    <item>
      <title>What a Penpot backup check can tell you after reimport</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Fri, 20 Nov 2026 03:51:24 +0000</pubDate>
      <link>https://dev.to/laconicleon/what-a-penpot-backup-check-can-tell-you-after-reimport-4a45</link>
      <guid>https://dev.to/laconicleon/what-a-penpot-backup-check-can-tell-you-after-reimport-4a45</guid>
      <description>&lt;p&gt;A Penpot file that opens after reimport has passed the first part of a backup check. For a document I need to keep editing, I also want a list of the objects that came back and a way to compare their positions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the source and test the copy
&lt;/h2&gt;

&lt;p&gt;For this check we exported a synthetic Penpot document through the GUI. The archive was 93,430 bytes. Its ZIP records passed a CRC check, and we computed a SHA-256 digest so we could identify that exact file later. The digest identifies the archive; it does not verify the contents of a restored project.&lt;/p&gt;

&lt;p&gt;We imported the archive into a separate file and checked that its file ID differed from the source. The source remained available. Only then did we compare the archived document with the imported copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compare by object ID
&lt;/h2&gt;

&lt;p&gt;The fixture had seven pages and 56 objects, including page roots. We compared page names and IDs, object ID sets, object names, types, and the x, y, width and height fields. Match the sets of IDs before comparing geometry. Otherwise a difference in traversal order can make two unchanged objects look like a mismatch.&lt;/p&gt;

&lt;p&gt;Some archive and API type names differ. In this fixture we mapped frame to board, rect to rectangle, and circle to ellipse. For one path we compared its stored bounding rectangle. We reloaded the browser and read the imported copy again to confirm that the checked fields persisted.&lt;/p&gt;

&lt;p&gt;The GUI round trip worked for this fixture; the plugin API backup export still returned an error. We did not verify full rich text, fonts, fills, libraries, interaction behavior, version history or cross-version recovery. The &lt;a href="https://fossdesk.com/figma-alternative/#hands-on" rel="noopener noreferrer"&gt;Penpot backup test and its limits&lt;/a&gt; include the exact test scope. I maintain FOSS Desk. AI drafted this article from the recorded test evidence.&lt;/p&gt;

</description>
      <category>design</category>
      <category>testing</category>
      <category>tools</category>
    </item>
    <item>
      <title>How I checked a Shotcut cut after reopening the MLT project</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Fri, 20 Nov 2026 03:35:29 +0000</pubDate>
      <link>https://dev.to/laconicleon/how-i-checked-a-shotcut-cut-after-reopening-the-mlt-project-566g</link>
      <guid>https://dev.to/laconicleon/how-i-checked-a-shotcut-cut-after-reopening-the-mlt-project-566g</guid>
      <description>&lt;p&gt;A video export can have the expected duration and still cut a frame early. To make that mistake visible, I used two synthetic clips with a source label burned into each frame. I wanted to check whether a small Shotcut project would keep its edit after a full restart.&lt;/p&gt;

&lt;h2&gt;
  
  
  Put a label on both sides of the cut
&lt;/h2&gt;

&lt;p&gt;Each clip was 150 frames at 25 fps. I kept source frames A025 through A124, then appended all of B. For an inclusive trim, the first segment is &lt;code&gt;124 − 25 + 1 = 100&lt;/code&gt; frames. That makes the join output frames 99 and 100, even though the corresponding source labels are A124 and B000.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Output frame (zero-based)&lt;/th&gt;
&lt;th&gt;Expected source label&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;A025&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;99&lt;/td&gt;
&lt;td&gt;A124&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;B000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;249&lt;/td&gt;
&lt;td&gt;B149&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Check the two frames around the join. Checking only the first and last frames can miss a boundary mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify the saved edit and the output separately
&lt;/h2&gt;

&lt;p&gt;I saved the native MLT file, exported, quit Shotcut, reopened the file and exported again. Both saved projects recorded the same two playlist entries. Both exports had 250 decoded frames, 1280 × 720 resolution, 25 fps and no audio stream. FFmpeg decoded both files without error, and the four sampled labels matched the table in each export.&lt;/p&gt;

&lt;p&gt;A first pass at trimming raced the seek operation and landed on the wrong range. Waiting for the seek to finish, then checking the saved playlist before exporting, caught it. I also had to select the export controls again after restarting. Keep a record of the export settings separately from the edit.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://fossdesk.com/adobe-alternatives/#premiere" rel="noopener noreferrer"&gt;Shotcut test notes and side-by-side frame captures&lt;/a&gt; show the setup and result. The test used Shotcut 26.11.15 on Windows and one silent synthetic project. It did not cover Premiere import, missing-media relinking, effects, audio or hardware encoding.&lt;/p&gt;

&lt;p&gt;Disclosure: I maintain FOSS Desk. AI assisted with drafting this article from the recorded test evidence.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>tools</category>
    </item>
    <item>
      <title>Test a Salon Tip Calculator With One Receipt</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Thu, 19 Nov 2026 12:45:54 +0000</pubDate>
      <link>https://dev.to/laconicleon/test-a-salon-tip-calculator-with-one-receipt-5ha0</link>
      <guid>https://dev.to/laconicleon/test-a-salon-tip-calculator-with-one-receipt-5ha0</guid>
      <description>&lt;p&gt;A salon receipt is a useful test for a tip calculator. One receipt can contain a service, a discount, a retail purchase, and tax. If the UI takes a single number called “total,” two calculations can produce different answers while both look plausible.&lt;/p&gt;

&lt;p&gt;Consider this sample receipt. These amounts are an example, not a salon's policy.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Receipt line&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hair service&lt;/td&gt;
&lt;td&gt;$100.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service discount&lt;/td&gt;
&lt;td&gt;−$10.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Take-home product&lt;/td&gt;
&lt;td&gt;$25.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tax shown on receipt&lt;/td&gt;
&lt;td&gt;$7.50&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If the customer chooses to tip 20% on the discounted service alone, the base is $90.00 and the tip is &lt;strong&gt;$18.00&lt;/strong&gt;. The amount due, including the other lines, is &lt;strong&gt;$140.50&lt;/strong&gt;. Applying 20% to the entire $122.50 before gratuity instead gives $24.50. Show the selected base so users can tell which choice they made.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the tip base visible
&lt;/h2&gt;

&lt;p&gt;Here's a small JavaScript fixture. The amounts are integer cents. Basis points let the same example represent 18.5% as 1850 as well as 20% as 2000.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;serviceCents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10_000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;discountCents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1_000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;retailCents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2_500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;taxCents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;750&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;serviceAfterDiscount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;serviceCents&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;discountCents&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;subtotal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;serviceAfterDiscount&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;retailCents&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;taxCents&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tipRateBps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2_000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tipCents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;serviceAfterDiscount&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;tipRateBps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;10_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;serviceAfterDiscount&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;9_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subtotal&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;12_250&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tipCents&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1_800&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subtotal&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tipCents&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;14_050&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This fixture accepts an already itemized receipt. In the UI, parse and validate each input at the boundary. Check that a discount does not take the service amount below zero. Display the tip base and the before-tip total separately. If there is an option to include tax, show exactly which taxable lines contribute to that base.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test two different kinds of split
&lt;/h2&gt;

&lt;p&gt;If the salon tells you to allocate a single $18.00 gratuity across staff, it might be $15.00 for the stylist and $3.00 for the assistant in this example. That split still totals $18.00. If two people are paying the bill equally, their payment amounts are $70.25 each. Those operations use different totals, so they should have distinct labels and assertions.&lt;/p&gt;

&lt;p&gt;Try changing the discount to $9.99, or using an odd-cent total and splitting it among three payers. Check that the pieces add back to the exact amount you are dividing. The same receipt makes a useful regression case for percentage rounding, excluded products, and split totals.&lt;/p&gt;

&lt;p&gt;For more examples involving discounts, products and assistants, see the &lt;a href="https://calculator-toolkit.com/how-much-to-tip-hairdresser/" rel="noopener noreferrer"&gt;hairdresser tipping guide with sample salon receipts&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Disclosure: This article links to a guide from my Calculator Toolkit project. An AI agent drafted this article from the project’s published guide and verified the arithmetic in the example.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Two Lightroom XMP sidecars in darktable: what survived, and what did not</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Mon, 16 Nov 2026 03:09:01 +0000</pubDate>
      <link>https://dev.to/laconicleon/two-lightroom-xmp-sidecars-in-darktable-what-survived-and-what-did-not-15jn</link>
      <guid>https://dev.to/laconicleon/two-lightroom-xmp-sidecars-in-darktable-what-survived-and-what-did-not-15jn</guid>
      <description>&lt;p&gt;The exposure values survived this small Lightroom Classic-to-darktable test. The rendered images still differed, and a red color label became purple.&lt;/p&gt;

&lt;p&gt;Those results came from two RAW files and their genuine Adobe XMP sidecars, tested on November 13, 2026. They do not establish compatibility for a complete Lightroom catalog.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the test actually moved
&lt;/h2&gt;

&lt;p&gt;The inputs were two CC0 samples from raw.pixls.us: a Canon EOS 5D Mark IV &lt;code&gt;983.CR2&lt;/code&gt; and a Sony ILCE-7M3 &lt;code&gt;2414.ARW&lt;/code&gt;. Lightroom Classic 16.0 was used to create the edits and save metadata through its graphical interface.&lt;/p&gt;

&lt;p&gt;Both photos received four stars, a red color label and two ordinary keywords: &lt;code&gt;CC0&lt;/code&gt; and &lt;code&gt;fossdesk-migration&lt;/code&gt;. The Canon photo received +0.75 EV and a crop. The Sony photo received -0.50 EV and remained uncropped. The Adobe XMP files were generated by Lightroom, rather than written by hand to imitate its output.&lt;/p&gt;

&lt;p&gt;In darktable 5.6.2, a fresh configuration and database were used. The RAW folder was imported with the matching Adobe &lt;code&gt;&amp;lt;basename&amp;gt;.xmp&lt;/code&gt; files alongside the images. Each photo was then opened in darkroom to trigger the Lightroom adjustment import.&lt;/p&gt;

&lt;p&gt;darktable wrote its own sidecars, named &lt;code&gt;&amp;lt;basename&amp;gt;.&amp;lt;RAW-extension&amp;gt;.xmp&lt;/code&gt;. The CLI exports used those darktable-generated sidecars. Passing an Adobe sidecar directly to a CLI command would not have established that this GUI migration route worked.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fields that survived
&lt;/h2&gt;

&lt;p&gt;Both photos retained their four-star rating and both ordinary keywords. The imported exposure instances displayed +0.750 and -0.500 EV. The Canon crop produced enabled crop-related processing; the Sony photo remained uncropped.&lt;/p&gt;

&lt;p&gt;The original RAW files and the retained Adobe sidecars had unchanged SHA-256 hashes in the recorded checks. darktable created separate processing sidecars.&lt;/p&gt;

&lt;p&gt;These checks were deliberately narrow. Ordinary keywords are not evidence for hierarchical keyword compatibility, and a preserved exposure-module value is not evidence for identical rendering across two processing engines.&lt;/p&gt;

&lt;h2&gt;
  
  
  The red label became purple
&lt;/h2&gt;

&lt;p&gt;The Lightroom source GUI showed red. The Adobe sidecars contained a Chinese label value and a red Photoshop label-color value. In the target configuration, both images had color-label ID 4, identified as purple in the recorded target checks.&lt;/p&gt;

&lt;p&gt;This was a mismatch in one Chinese-source/English-target setup. Its root cause was not established. It would be misleading to call it a proven translation bug, or to claim every red label migrates incorrectly.&lt;/p&gt;

&lt;p&gt;If color labels drive your workflow, check their meaning after a trial import rather than relying on the presence of a label field alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  The exported dimensions differed
&lt;/h2&gt;

&lt;p&gt;Lightroom reference JPEGs were exported through its GUI at quality 90 in sRGB. The migrated and no-sidecar baseline JPEGs were exported through darktable's CLI at quality 90 with an explicit sRGB profile and no requested downscaling.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sample&lt;/th&gt;
&lt;th&gt;Lightroom reference&lt;/th&gt;
&lt;th&gt;darktable with migrated edits&lt;/th&gt;
&lt;th&gt;darktable without the Adobe sidecar&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Canon &lt;code&gt;983.CR2&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;4912 × 3181&lt;/td&gt;
&lt;td&gt;4929 × 3195&lt;/td&gt;
&lt;td&gt;6744 × 4500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sony &lt;code&gt;2414.ARW&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;6000 × 4000&lt;/td&gt;
&lt;td&gt;6048 × 4024&lt;/td&gt;
&lt;td&gt;6048 × 4024&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Canon result showed a roughly similar cropped composition, with different output dimensions. The Sony result shows why a size difference should not automatically be attributed to a failed crop import: the migrated export and the no-sidecar baseline had the same dimensions, while the Lightroom reference differed.&lt;/p&gt;

&lt;p&gt;The recorded images also differed visibly in color and brightness. No extra matching color adjustments were applied to make them look closer. The results do not support a claim of lossless migration or a ranking of highlight-recovery quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  An exit code was not enough
&lt;/h2&gt;

&lt;p&gt;An initial darktable launch exited before adjustment import was complete. A later attempt with &lt;code&gt;--disable-opencl&lt;/code&gt; succeeded, but the original exit's cause was not diagnosed. That does not prove a GPU fault.&lt;/p&gt;

&lt;p&gt;One CLI export attempt also returned exit code 0 while placing output at an unexpected path when backslashes were used. The failed-attempt evidence was retained, and the corrected run used forward-slash paths. The expected outputs were then checked for existence, successful decoding, dimensions and hashes.&lt;/p&gt;

&lt;p&gt;Those were two separate problems. Neither should be hidden behind a single green “migration passed” label.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means for a trial migration
&lt;/h2&gt;

&lt;p&gt;Make copies of a few photos that use the metadata and adjustments you depend on. Preserve the source RAW files and Adobe sidecars, and record what you changed before importing. Check stars, keyword contents, label meanings, adjustment values and the resulting image separately.&lt;/p&gt;

&lt;p&gt;Export reference images from both applications, inspect their dimensions and appearance, and reload the target application before trusting the result. Keep failures alongside successful outputs.&lt;/p&gt;

&lt;p&gt;This test did not import a &lt;code&gt;.lrcat&lt;/code&gt; catalog or cover collections, virtual copies, full edit history, presets, AI masks, GPS, hierarchical keywords, other operating systems or other versions.&lt;/p&gt;

&lt;p&gt;The test was recorded for &lt;a href="https://fossdesk.com/" rel="noopener noreferrer"&gt;FOSS Desk&lt;/a&gt;, which I maintain. The &lt;a href="https://fossdesk.com/lightroom-alternative/" rel="noopener noreferrer"&gt;Lightroom-to-darktable guide&lt;/a&gt; includes the scoped results and limitations. This is an independent report, unaffiliated with Adobe or the listed projects.&lt;/p&gt;

&lt;p&gt;AI assistance was used to organize and draft this article from recorded project evidence. It does not add new migration experiments or establish causes that were not measured.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>testing</category>
    </item>
    <item>
      <title>A Figma-to-Penpot import kept all 10 objects. What else needed checking?</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Mon, 16 Nov 2026 01:37:04 +0000</pubDate>
      <link>https://dev.to/laconicleon/a-figma-to-penpot-import-kept-all-10-objects-what-else-needed-checking-3p67</link>
      <guid>https://dev.to/laconicleon/a-figma-to-penpot-import-kept-all-10-objects-what-else-needed-checking-3p67</guid>
      <description>&lt;p&gt;Ten objects went into a small Figma migration fixture, and ten came out in Penpot. That count was a useful first check. It did not tell us whether text stayed editable, a component instance still followed its source, or the layout behaved after resizing.&lt;/p&gt;

&lt;p&gt;This note describes one recorded test from November 13, 2026. It uses a deliberately small fixture and reports the differences as well as the successful checks. It is not a general compatibility verdict.&lt;/p&gt;

&lt;h2&gt;
  
  
  The file and the actual import path
&lt;/h2&gt;

&lt;p&gt;The source contained a 600 × 420 board, two native Inter text objects, a fixed 400 × 80 horizontal auto-layout row with 12 px padding and a 16 px gap, two 120 × 40 rectangles, and a simple 100 × 48 component with a linked instance. There were ten non-root objects and one component definition.&lt;/p&gt;

&lt;p&gt;The fixture was created through the Figma plugin API. Its properties and component links were read back before export. Penpot Exporter v0.26.3 then exported all pages to a &lt;code&gt;.penpot&lt;/code&gt; archive of 13,699 bytes. The archive was imported through Penpot's cloud interface and opened as a separate copy.&lt;/p&gt;

&lt;p&gt;This was an exporter-to-native-archive workflow. It did not test opening a &lt;code&gt;.fig&lt;/code&gt; file directly in Penpot.&lt;/p&gt;

&lt;h2&gt;
  
  
  The surprising layout difference
&lt;/h2&gt;

&lt;p&gt;The horizontal Figma row became a Penpot Flex layout with &lt;code&gt;row-reverse&lt;/code&gt;. The child order also reversed.&lt;/p&gt;

&lt;p&gt;Reading only the direction field would make this look like an immediate ordering failure. The measured positions told a different story: rectangle A remained at (36, 132), rectangle B at (172, 132), and both stayed 120 × 40. The horizontal gap was still:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;172 - (36 + 120) = 16 px
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The visible order and spacing survived this conversion. The underlying layout representation changed.&lt;/p&gt;

&lt;p&gt;A separate behavior check widened the fixed row from 400 to approximately 480 through the Penpot plugin API. The two fixed-size rectangles kept their recorded positions, dimensions and gap; the row was then restored to 400. This covers one fixed row. It says nothing about nested layouts, fill or hug sizing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Text survived, with different measurements
&lt;/h2&gt;

&lt;p&gt;Both strings remained native text objects. Inter, weight 400 and the two recorded font sizes, 28 and 16, were retained. Their bounds changed:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Text&lt;/th&gt;
&lt;th&gt;Figma&lt;/th&gt;
&lt;th&gt;Penpot&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Heading&lt;/td&gt;
&lt;td&gt;280 × 34&lt;/td&gt;
&lt;td&gt;281 × 34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Body&lt;/td&gt;
&lt;td&gt;312 × 19&lt;/td&gt;
&lt;td&gt;309 × 20&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;To check editing, the heading was temporarily changed through the Penpot plugin API. Its width changed to 412, after which the original text was restored. That establishes an actual edit in this fixture, rather than just the presence of a text string in an exported structure.&lt;/p&gt;

&lt;p&gt;The dimension differences also mean this was not a pixel-identical migration. Other fonts, mixed styles and CJK text were outside the test.&lt;/p&gt;

&lt;h2&gt;
  
  
  A component link needed a behavior check too
&lt;/h2&gt;

&lt;p&gt;The imported main object and instance pointed to the same component definition. A temporary change to the main rectangle's fill, from &lt;code&gt;#1A66B2&lt;/code&gt; to &lt;code&gt;#2D8C51&lt;/code&gt;, propagated to the instance. Restoring the original fill propagated as well.&lt;/p&gt;

&lt;p&gt;This tested one same-file rectangle fill. It did not cover variants, overrides, cross-file libraries or design tokens.&lt;/p&gt;

&lt;p&gt;After reloading the Penpot file, a further read-back confirmed the ten objects, original strings, restored 400 px row, 16 px gap, original color and component links.&lt;/p&gt;

&lt;h2&gt;
  
  
  A separate export failed
&lt;/h2&gt;

&lt;p&gt;The Penpot MCP &lt;code&gt;export_shape&lt;/code&gt; request for a PNG preview returned HTTP 500 / ResourceRequest timeout. The design was visible in the browser, and editor screenshots were saved, but those screenshots do not establish that server-side PNG export worked.&lt;/p&gt;

&lt;p&gt;The native archive import and the preview export are separate operations. The first succeeded in this fixture; the second failed. The failure's cause was not established.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small migration check worth repeating on your own file
&lt;/h2&gt;

&lt;p&gt;Start with a copy containing a few features you depend on. Record source counts, text, dimensions, positions and component relationships. Export and import through the documented route, then inspect both the structure and visible geometry.&lt;/p&gt;

&lt;p&gt;Next, make a reversible edit: change text, resize a layout container or change a component property. Check the result, restore the original state, reload, and check again. Test image export separately from import.&lt;/p&gt;

&lt;p&gt;This fixture did not cover complex components, prototypes, collaboration, self-hosting, large production files or other versions. A successful small-file check is a starting point for deciding what to test next.&lt;/p&gt;

&lt;p&gt;The experiment was recorded for &lt;a href="https://fossdesk.com/" rel="noopener noreferrer"&gt;FOSS Desk&lt;/a&gt;, which I maintain. The &lt;a href="https://fossdesk.com/figma-alternative/" rel="noopener noreferrer"&gt;Figma-to-Penpot guide&lt;/a&gt; includes these scoped results and their limits. The separate &lt;a href="https://github.com/fossdesk/awesome-adobe-alternatives" rel="noopener noreferrer"&gt;public software list and read-only release checker&lt;/a&gt; covers release metadata; it does not contain this migration fixture or its private evidence archive.&lt;/p&gt;

&lt;p&gt;AI assistance was used to organize and draft this article from recorded project evidence. The experiment's results and limitations are identified above.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>webdev</category>
      <category>design</category>
      <category>testing</category>
    </item>
    <item>
      <title>Testing React Page Titles Before JavaScript Runs and After Navigation</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Mon, 02 Nov 2026 03:08:02 +0000</pubDate>
      <link>https://dev.to/laconicleon/what-an-ai-rap-video-generator-taught-me-about-crawlable-react-pages-2026-8b7</link>
      <guid>https://dev.to/laconicleon/what-an-ai-rap-video-generator-taught-me-about-crawlable-react-pages-2026-8b7</guid>
      <description>&lt;p&gt;Disclosure: I build &lt;a href="https://myairap.video/" rel="noopener noreferrer"&gt;MyAIRap.video&lt;/a&gt;. This development case study was written with AI assistance and checked against the project's release records and a production test.&lt;/p&gt;

&lt;p&gt;The MyAIRap.video homepage looked complete in Chrome. It had examples, pricing, and a link to the video creator. A raw HTTP request returned a heading, two paragraphs, and a link to the creator. The pricing link I could see in Chrome was missing from the initial HTML.&lt;/p&gt;

&lt;p&gt;We already had a Python prerender step. It wrote a short summary for each public route, while React rendered the full page in the browser. That meant we maintained two versions of the content for the same URL. We also found a separate problem on &lt;code&gt;/pricing&lt;/code&gt;. The initial HTML had a pricing title, but the browser could show the homepage title after React took over.&lt;/p&gt;

&lt;h2&gt;
  
  
  Replace the hand-written summaries with rendered React components
&lt;/h2&gt;

&lt;p&gt;Here is the complete &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; from the old homepage build artifact, reformatted for readability:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;AI RAP VIDEO Generator&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Make your photo rap.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Create AI rap videos from your photos with MyAIRap.video. Go solo, rap with a friend, or let your pet take the mic. Pick a style and make it yours.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/create"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Create original Rap&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We changed the build to render the existing React components for the homepage, pricing, tutorial, and articles. Python still assembled the page document around that output. The rendering happened at build time. Account balances and orders stayed behind authentication.&lt;/p&gt;

&lt;p&gt;These are two excerpts from the new homepage artifact, with the surrounding markup omitted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/pricing"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Pricing&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"hero-display"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;AI RAP VIDEO Generator&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"hero-description"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Your face. Your words. A whole new energy. Turn a photo into an original Rap video.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Route&lt;/th&gt;
&lt;th&gt;Previous build artifact&lt;/th&gt;
&lt;th&gt;November 1 build artifact&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;/&lt;/td&gt;
&lt;td&gt;1,175 bytes&lt;/td&gt;
&lt;td&gt;29,099 bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/pricing&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1,065 bytes&lt;/td&gt;
&lt;td&gt;13,077 bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The new artifacts matched the SHA-256 hashes of the production responses captured during release verification. The byte counts helped spot unexpectedly small responses. The checks that mattered were more specific: the homepage contained a real link to &lt;code&gt;/pricing&lt;/code&gt;, and the pricing HTML contained amounts from the product catalog.&lt;/p&gt;

&lt;h2&gt;
  
  
  A correct &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; in the response can still become stale in the browser
&lt;/h2&gt;

&lt;p&gt;The old pricing artifact already had a route-specific title:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Pricing &lt;span class="ni"&gt;&amp;amp;amp;&lt;/span&gt; credits | MyAIRap.video&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A test that only fetched &lt;code&gt;/pricing&lt;/code&gt; could therefore pass while the browser still showed the wrong title. We put the metadata for each public route in a shared definition used by the build and by client-side navigation. The November 1 pricing artifact contained:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;AI Rap Video Pricing: One-Time Credits, No Subscription&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"canonical"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://myairap.video/pricing"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The title copy changed in a later release. On November 3, 2026, I ran the following check against production using &lt;code&gt;playwright-core&lt;/code&gt; and headless Edge. The code below uses a normal package import in place of the machine-specific path used to load &lt;code&gt;playwright-core&lt;/code&gt; in the test environment. The expected title came from the current route configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;assert&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;node:assert/strict&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;chromium&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;playwright-core&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://myairap.video&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/pricing&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;expected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;AI Rap Video Generator Pricing 2026 | MyAIRap.video&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;raw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class="se"&gt;([^&lt;/span&gt;&lt;span class="sr"&gt;&amp;lt;&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;*&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="sr"&gt;&amp;lt;&lt;/span&gt;&lt;span class="se"&gt;\/&lt;/span&gt;&lt;span class="sr"&gt;title&amp;gt;/i&lt;/span&gt;&lt;span class="p"&gt;)?.[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;chromium&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;msedge&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;headless&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;home&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;notEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;home&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__titleCheck&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;locator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;a[href="/pricing"]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;waitForURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;waitForFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sameDocument&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__titleCheck&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sameDocument&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;home&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;url&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
      &lt;span class="nx"&gt;sameDocument&lt;/span&gt;
    &lt;span class="p"&gt;}));&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;})().&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exitCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The run returned:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"raw"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AI Rap Video Generator Pricing 2026 | MyAIRap.video"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"home"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AI Rap Video Generator 2026 from Photos | MyAIRap.video"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AI Rap Video Generator Pricing 2026 | MyAIRap.video"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://myairap.video/pricing"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sameDocument"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;window&lt;/code&gt; marker was there to make the test discriminate between a client-side route change and a full page load. Without it, the title assertion could pass after a full load simply because the server had already sent the correct title. The marker survived the click, and the title changed from the homepage value to the pricing value in the same document.&lt;/p&gt;

&lt;p&gt;This is the pair of checks I would keep on another React site. Fetch an important route and assert something specific about its raw response. Then reach it through an in-app link and check the browser state. These checks establish what the server sent and what the app did with it. Search indexing needs its own evidence.&lt;/p&gt;

</description>
      <category>react</category>
      <category>seo</category>
      <category>startup</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
