markdowndocs 0.11.3 → 0.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee414b6e508ae906b792f1abd65e21135a1439cf740998f69a1ad7cde743f1c1
4
- data.tar.gz: 55f37cb07e8d2e274ca25fdc73e3448075fb945a7d10e852e596203893643190
3
+ metadata.gz: 1f1cb7d3191ecb664710cd650b934dc133ba887db48cfd49ec9c7758fbcfaf69
4
+ data.tar.gz: 7a236c92a2b4d755c882b3c257b2b52b900ceae73312989433ff6ab93d35a1bd
5
5
  SHA512:
6
- metadata.gz: e0a49a7d046d2539060dd9bb4cab2f4d9d626c58020a41c898ee8627ae11eb99e2c28a9ff336291acbfd72b3903405e101abac33152fa99e3f0c2a6806d3be00
7
- data.tar.gz: 8a7ef92900c9e99f9702838b7ab68cc619509c84cace45e1c0f86c94085154e546cc8dd4b94cfc89af9fcbaed6691db4722b556439405320f3fb33ceb00a9db1
6
+ metadata.gz: '028f7855c0d94dc53fd363f2f8ac34d13c8e417a64f20753fa42aa9b3f07534f9d62f91ba7f1af137cbb9787ed28f5b4680d467fcf4850d30562e7ecca4ae79b'
7
+ data.tar.gz: 948e320c78060772faf7b4cba7ce6ee66936af28e71d702694d433f801937c872439a7e6becff8dd78c7d6a7573b1097df64b57ed19faf936951ed575bb8a1e2
data/CHANGELOG.md CHANGED
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [0.11.4] - 2026-09-23
11
+
12
+ Two search fixes. Neither changes an API, but the second one asks something of
13
+ apps that have overridden the docs index template.
14
+
15
+ ### Fixed
16
+
17
+ - **A query typed before the search index arrives is no longer dropped.**
18
+ `performSearch` returns through `showAll()` while `miniSearch` is still null,
19
+ and nothing re-read the input once the fetch resolved — so on a slow
20
+ connection the filter looked dead to anyone who started typing straight away.
21
+ The controller now re-runs the search as soon as the index is usable. Proved
22
+ by a browser spec in a host app rather than here: this repo has no
23
+ JavaScript test harness, and standing one up is tracked separately.
24
+
25
+ - **The docs index filter no longer hides every card.** `search_index` keys each
26
+ entry on `path_slug`, but the index template tagged each card with the bare
27
+ `slug`, and `docs_search_controller` matches a card by comparing the two. A
28
+ mode-scoped document therefore never matched its own index entry, so any query
29
+ emptied the page. Cards now carry `path_slug`. Apps that copied
30
+ `docs/index.html.erb` into their own `app/views/markdowndocs/docs/` need the
31
+ same change locally — a gem upgrade does not reach an override.
32
+
8
33
  ## [0.11.3] - 2026-09-03
9
34
 
10
35
  ### Accessibility
@@ -32,6 +32,12 @@ export default class extends Controller {
32
32
  }
33
33
  })
34
34
  this.miniSearch.addAll(docs)
35
+
36
+ // A query typed while the index was still loading was dropped:
37
+ // performSearch returns through showAll() while miniSearch is null, and
38
+ // nothing re-read the input once the fetch resolved, so the filter looked
39
+ // dead to anyone who started typing straight away (#42).
40
+ if (this.hasInputTarget && this.inputTarget.value.trim()) this.performSearch()
35
41
  } catch (e) {
36
42
  console.warn("Markdowndocs: failed to load search index", e)
37
43
  }
@@ -56,7 +56,12 @@
56
56
  md:grid-cols-2
57
57
  lg:grid-cols-3">
58
58
  <% docs.each do |doc| %>
59
- <div <% if @search_enabled %>data-docs-search-target="card" data-slug="<%= doc.slug %>"<% end %>>
59
+ <%# path_slug, NOT the bare slug: search_index keys every entry on
60
+ path_slug, and docs_search_controller matches a card by testing
61
+ this attribute against those ids. A mode-scoped document tagged
62
+ with its bare slug matches nothing, which hid every card on
63
+ every query (#40). %>
64
+ <div <% if @search_enabled %>data-docs-search-target="card" data-slug="<%= doc.path_slug %>"<% end %>>
60
65
  <%= render "markdowndocs/docs/card", doc: doc %>
61
66
  </div>
62
67
  <% end %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Markdowndocs
4
- VERSION = "0.11.3"
4
+ VERSION = "0.11.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdowndocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
4
+ version: 0.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Chmura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-04 00:00:00.000000000 Z
11
+ date: 2026-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails