NixLabConnectionconnecting
CommitsCommit
web/dreamstop.openfp.net · commit

Plain pair note and description, two gaps, and quieter tab keys

SmSmartypants, 2026-12-06 20:484b232c75f0#40 · 20/20

parents: 842f67d587

Plain pair note and description, two gaps, and quieter tab keys

The pair note and the page description use the owner's plain wording, and
the menu's label is now Kinds of meaning. The Aspect and Phase ambiguous
examples, which were interface labels rather than prose, are now gaps.
Arrow, Home and End keys on a tab no longer scroll the page, and each tab
panel is focusable.

5 files changed

Diff

 dreamstop-openfp-net-web/ChangeLog.md        |  2 ++
 dreamstop-openfp-net-web/src/Site/Content.hs | 16 ++--------------
 dreamstop-openfp-net-web/src/Site/Page.hs    |  2 +-
 dreamstop-openfp-net-web/src/Site/View.hs    | 28 +++++++++++++++++++++++++---
 nix/site.nix                                 |  4 ++--
 5 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/dreamstop-openfp-net-web/ChangeLog.md b/dreamstop-openfp-net-web/ChangeLog.md
index de40132..ca95ffb 100644
--- a/dreamstop-openfp-net-web/ChangeLog.md
+++ b/dreamstop-openfp-net-web/ChangeLog.md
@@ -5,6 +5,8 @@
 - The front page now shows a clear ChangeLog entry from horizon-flake-parts, with the reading of each sentence under it.
 - The front page now has a menu of the nine codepoint layers in place of its colour legend and its separate verdict and modality examples. Each layer now shows a clear, an ambiguous and a nonsense example where a real one exists, each with its readings and what the layer's codes decide in it. Without JavaScript, every layer's examples are now shown one after another.
 - The front page now says that each kind of document has its own rules, each with examples. It no longer describes how a program marks up clauses or what the manual covers.
+- The page's description and preview card now say that dreamstop shows which sentences can be read more than one way, so authors can rewrite them.
+- The minimal pair's note now says in plain words that changing “moved” to “moves” leaves one reading.
  
 ## 0.2.3.0 — 2026-12-06
  
diff --git a/dreamstop-openfp-net-web/src/Site/Content.hs b/dreamstop-openfp-net-web/src/Site/Content.hs
index 254ff35..4bec976 100644
--- a/dreamstop-openfp-net-web/src/Site/Content.hs
+++ b/dreamstop-openfp-net-web/src/Site/Content.hs
@@ -198,24 +198,12 @@ layerExamples = \case
         [MkReading "[ASR·PFV] [ASR·HAB]/rel1" "the release added the console, and preserving bindings is what the console does"]
         "PFV against HAB: the adding is one event, and the preserving is standing behaviour."
         "From the Quality Control Handbook, CLG.ChooseEntryForms."
-    , example Ambiguous "Keep branch"
-        [ MkReading "[DIR·PFV]" "one act: choose not to delete the branch"
-        , MkReading "[DIR·PRG]" "a state kept up: hold the branch in place"
-        ]
-        "PFV or PRG: the codes decide whether the button is one act or a state to maintain."
-        "A button in the NixLab web interface."
     ]
   Phase ->
     [ example Clear "A project or group called `sw.js` is not yet refused."
         [MkReading "[ASR·HAB·EXP]" "not refused before the release or in it, and refusal is expected later"]
         "EXP: false before the release, false after it, and expected to change."
         "From the ChangeLog of nixlab-shell, release 0.98.0.0."
-    , example Ambiguous "The forge keeps this picture now."
-        [ MkReading "[ASR·HAB·INC]" "the forge did not keep it before, and keeps it from now on"
-        , MkReading "[ASR·HAB]" "the forge keeps the picture, with nothing said about before"
-        ]
-        "INC or no phase: the codes decide whether keeping the picture is new."
-        "A message in the NixLab web interface."
     , example Nonsense "Removed the legacy importer, which reads the old export format." []
         "Under the release action, the relative clause says the importer reads the format from this release on, but the same release removed it."
         "From the Quality Control Handbook, CLG.DescribeAddedThingsInPresent."
@@ -276,11 +264,11 @@ pair =
   , MkExample "Good" "Added the review store, which moves reviews and sign-offs out of SQLite." [storeMoves]
   ]
  
--- | The pair's question and its edit.
+-- | The pair's edit and the one reading it leaves.
 --
 -- @since 0.1.0.0
 pairSlot :: MisoString
-pairSlot = "Question: what does the store do? Edit: moved becomes moves, which leaves clause 2 only its HAB reading"
+pairSlot = "Changing “moved” to “moves” leaves one reading: what the store does."
  
 -- | The review-store relative clause read as what the store does.
 storeMoves :: Reading
diff --git a/dreamstop-openfp-net-web/src/Site/Page.hs b/dreamstop-openfp-net-web/src/Site/Page.hs
index 6b3f76e..88d5be0 100644
--- a/dreamstop-openfp-net-web/src/Site/Page.hs
+++ b/dreamstop-openfp-net-web/src/Site/Page.hs
@@ -57,4 +57,4 @@ tagline = "a language for disambiguating text"
 --
 -- @since 0.1.0.0
 description :: MisoString
-description = "dreamstop is a language for disambiguating text. A program marks up every clause with codepoints, and authors rewrite any sentence that is not clear."
+description = "dreamstop shows which sentences can be read more than one way, so authors can rewrite them."
diff --git a/dreamstop-openfp-net-web/src/Site/View.hs b/dreamstop-openfp-net-web/src/Site/View.hs
index c6f0dc5..443b6c7 100644
--- a/dreamstop-openfp-net-web/src/Site/View.hs
+++ b/dreamstop-openfp-net-web/src/Site/View.hs
@@ -12,12 +12,17 @@ module Site.View
   , app
   ) where
  
+import           Control.Monad      (unless, void, when)
 import           Data.Char          (isUpper)
 import           Data.Kind          (Type)
 import           Data.List          (groupBy)
 import           DesignKit.Brand    (fontDisplay, gradientText)
 import           DesignKit.Effects  (scrollProgressBar)
-import           Miso               (App, Effect, component, io_)
+import           Miso               (App, Component (subs), Effect, component,
+                                     io_)
+import           Miso.DSL           (FromJSVal (fromJSValUnchecked), isNull,
+                                     jsg, syncCallback1, (!), (#))
+import           Miso.Effect        (Sub)
 import           Miso.Event.Types   (KeyCode (KeyCode))
 import           Miso.FFI           (focus)
 import           Miso.Html.Element  (a_, blockquote_, button_, code_, div_,
@@ -58,7 +63,7 @@ data Action
 --
 -- @since 0.1.0.0
 app :: App Model Action
-app = component (MkModel minBound) update (const view)
+app = (component (MkModel minBound) update (const view)) {subs = [holdTabKeys]}
  
 update :: Action -> Effect parent props Model Action
 update = \case
@@ -73,6 +78,22 @@ update = \case
     go :: Layer -> Effect parent props Model Action
     go l = put (MkModel l) >> io_ (focus (tabId l))
  
+-- | Keeps the arrow, Home and End keys on a tab from scrolling the page: the
+-- menu uses them to move between tabs. Other keys keep their defaults.
+holdTabKeys :: Sub action
+holdTabKeys _ = do
+  document <- jsg "document"
+  listener <- syncCallback1 $ \event -> do
+    target <- event ! "target"
+    role <- target # "getAttribute" $ ("role" :: MisoString)
+    absent <- isNull role
+    unless absent $ do
+      r <- fromJSValUnchecked role :: IO MisoString
+      k <- fromJSValUnchecked =<< (event ! "key") :: IO MisoString
+      when (r == "tab" && k `elem` ["ArrowLeft", "ArrowRight", "Home", "End"]) $
+        void (event # "preventDefault" $ ())
+  void (document # "addEventListener" $ ("keydown" :: MisoString, listener))
+ 
 -- | The layer @n@ places along the menu, wrapping at either end.
 step :: Int -> Layer -> Layer
 step n l = toEnum ((fromEnum l + n) `mod` length layers)
@@ -131,7 +152,7 @@ view (MkModel selected) =
             [classList ["container"]]
             [ h2_ [classList ["section-title"], fontDisplay] ["Clear, ambiguous or nonsense"]
             , div_
-                [classList ["tabs"], role_ "tablist", aria_ "label" "Codepoint layers"]
+                [classList ["tabs"], role_ "tablist", aria_ "label" "Kinds of meaning"]
                 (map tab layers)
             , div_ [classList ["panels"]] (map panel layers)
             ]
@@ -201,6 +222,7 @@ view (MkModel selected) =
         [ role_ "tabpanel"
         , id_ (panelId l)
         , aria_ "labelledby" (tabId l)
+        , tabindex_ "0"
         , classList ["panel", if l == selected then "active" else "inactive"]
         ]
         [ h3_ [classList ["panel-title", layerClass l]] [text (layerName l)]
diff --git a/nix/site.nix b/nix/site.nix
index 6e53ee0..7e6b6f9 100644
--- a/nix/site.nix
+++ b/nix/site.nix
@@ -173,7 +173,7 @@ local:
  
       name = "dreamstop";
       title = "dreamstop — a language for disambiguating text";
-      description = "dreamstop is a language for disambiguating text. A program marks up every clause with codepoints, and authors rewrite any sentence that is not clear.";
+      description = "dreamstop shows which sentences can be read more than one way, so authors can rewrite them.";
       card = "https://dreamstop.openfp.net/og.png";
       forge = "https://nixlab.openfp.net";
       meta =
@@ -198,7 +198,7 @@ local:
         flakeLock = ../flake.lock;
         horizonVx = ../horizon.vx;
         expect = [
-          ''<div class="tabs" role="tablist" aria-label="Codepoint layers">''
+          ''<div class="tabs" role="tablist" aria-label="Kinds of meaning">''
           ''<a class="btn" id="manual" href="manual/dreamstop.pdf">Read the manual</a>''
           { absent = "Ithkuil"; }
           { absent = "Continuous Disambiguation"; }