Skip to content

docs: use controllable pattern in components and reactivity doc#135

Closed
LuLaValva wants to merge 2 commits intomainfrom
components-and-reactivity-controllable
Closed

docs: use controllable pattern in components and reactivity doc#135
LuLaValva wants to merge 2 commits intomainfrom
components-and-reactivity-controllable

Conversation

@LuLaValva
Copy link
Copy Markdown
Member

No description provided.

@LuLaValva LuLaValva force-pushed the components-and-reactivity-controllable branch from 231f09d to 00bf9d4 Compare March 12, 2026 23:05
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5a55d6b2-de6f-4c1b-8b44-ba5bb2eb8f49

📥 Commits

Reviewing files that changed from the base of the PR and between 00bf9d4 and be6f55a.

📒 Files selected for processing (1)
  • docs/tutorial/components-and-reactivity.md

Walkthrough

The "Syncing State" section of the components and reactivity tutorial was rewritten to replace manual onInput handlers with two-way binding using the value:= shorthand and to introduce a string-first workflow via degFString. Examples parse degFString to a numeric degF (using parseFloat or unary +) and derive degC from that numeric value. All related code blocks and component examples (conditional rendering, gauge, reusable components) were updated to follow this pattern. Changes: +31 / -4.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a pull request description explaining the motivation for switching from onInput event handling to the controllable two-way binding pattern and its benefits.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately describes the main change: updating the components and reactivity documentation to demonstrate the controllable pattern for state binding.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch components-and-reactivity-controllable
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/tutorial/components-and-reactivity.md (2)

3-5: ⚠️ Potential issue | 🟡 Minor

Restructure TLDR into 2-4 bullet points.

The TLDR should contain 2-4 brief bullets as sentence fragments without periods, not a single prose sentence. As per coding guidelines, format as a bulleted list covering the tutorial's key concepts.

📝 Proposed restructure
 > [!TLDR]
 >
-> We build a simple example which introduces tag variables, conditionals, and components
+ > - Tag variables for state management
+ > - Two-way binding with `value:=` shorthand
+ > - Computed values with `<const>` tag
+ > - Building reusable components
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/tutorial/components-and-reactivity.md` around lines 3 - 5, Replace the
single-sentence TLDR under the [!TLDR] block with a 2–4 item bulleted list of
sentence fragments (no trailing periods) that each cover a key concept from the
tutorial (e.g., tag variables, conditionals, components, reactivity), ensure
items are concise fragments rather than full sentences, and keep overall length
to 2–4 bullets to match the coding guidelines.

110-110: ⚠️ Potential issue | 🟡 Minor

Shorten heading to 1-3 words.

The heading "Adding Styles and Visualization" has 4 words, exceeding the maximum of 3. As per coding guidelines, keep headings short.

✂️ Suggested alternatives
-## Adding Styles and Visualization
+## Styling the Gauge

or

-## Adding Styles and Visualization
+## Visual Styling
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/tutorial/components-and-reactivity.md` at line 110, Heading "Adding
Styles and Visualization" exceeds the 3-word limit; replace that heading with a
concise 1–3 word alternative (e.g., "Styling", "Visualization", or "Styles &
Visuals") in the docs/tutorial/components-and-reactivity.md file and update any
surrounding references or TOC entries that point to that exact heading text to
keep links and navigation working.
🧹 Nitpick comments (2)
docs/tutorial/components-and-reactivity.md (2)

42-42: Consider rephrasing to avoid repetitive sentence structure.

Three consecutive sentences begin with "This," which can impact readability. Consider rephrasing for variety.

✍️ Suggested rephrase
-This _seems_ to work at first glance, but you'll find out quickly that the value of the input isn't fully synchronized. This is because in HTML, `value=` actually refers to the [_default_ value](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#value) of the input and not its current value. This is why instead, we should leverage the [controllable](../reference/native-tag.md#change-handlers) pattern with `Change` handlers.
+This _seems_ to work at first glance, but you'll find out quickly that the value of the input isn't fully synchronized. In HTML, `value=` actually refers to the [_default_ value](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#value) of the input and not its current value. Instead, leverage the [controllable](../reference/native-tag.md#change-handlers) pattern with `Change` handlers.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/tutorial/components-and-reactivity.md` at line 42, Reword the three
consecutive sentences that start with "This" to improve readability: replace
"This _seems_ to work at first glance..." with a sentence that opens with the
observed behavior (e.g., "At first glance, the code appears to work..."), change
"This is because in HTML, `value=` actually refers..." to a clause that begins
with the cause (e.g., "In HTML, `value=` refers to the default value, not the
current value..."), and revise the final "This is why instead..." sentence to
start with the recommended action (e.g., "Use the controllable pattern with
`Change` handlers instead."). Keep the technical points intact (mention default
vs current value and recommend the controllable/Change handlers) and update the
three lines around the phrase "This _seems_ to work..." to avoid repetitive
openings.

66-66: Consider consistency in string-to-number conversion.

The tutorial shows parseFloat(degFString) on line 66, then switches to (+degFString) on line 76. While both work, the inconsistency might confuse learners unless there's a pedagogical reason for showing the progression.

If the intent is to demonstrate different approaches, consider adding a brief comment explaining the change. Otherwise, use one method consistently throughout (the unary + operator is more concise).

Also applies to: 76-76

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/tutorial/components-and-reactivity.md` at line 66, The tutorial is
inconsistent converting degFString to a number (uses parseFloat(degFString) at
one spot and (+degFString) later); either make both conversions use the same
approach (e.g., replace parseFloat(degFString) with +degFString or vice versa)
or add a short inline note where (+degFString) appears explaining it's a concise
alternative to parseFloat for clarity; update the occurrences referencing
degFString and degF to keep the examples consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/tutorial/components-and-reactivity.md`:
- Around line 3-5: Replace the single-sentence TLDR under the [!TLDR] block with
a 2–4 item bulleted list of sentence fragments (no trailing periods) that each
cover a key concept from the tutorial (e.g., tag variables, conditionals,
components, reactivity), ensure items are concise fragments rather than full
sentences, and keep overall length to 2–4 bullets to match the coding
guidelines.
- Line 110: Heading "Adding Styles and Visualization" exceeds the 3-word limit;
replace that heading with a concise 1–3 word alternative (e.g., "Styling",
"Visualization", or "Styles & Visuals") in the
docs/tutorial/components-and-reactivity.md file and update any surrounding
references or TOC entries that point to that exact heading text to keep links
and navigation working.

---

Nitpick comments:
In `@docs/tutorial/components-and-reactivity.md`:
- Line 42: Reword the three consecutive sentences that start with "This" to
improve readability: replace "This _seems_ to work at first glance..." with a
sentence that opens with the observed behavior (e.g., "At first glance, the code
appears to work..."), change "This is because in HTML, `value=` actually
refers..." to a clause that begins with the cause (e.g., "In HTML, `value=`
refers to the default value, not the current value..."), and revise the final
"This is why instead..." sentence to start with the recommended action (e.g.,
"Use the controllable pattern with `Change` handlers instead."). Keep the
technical points intact (mention default vs current value and recommend the
controllable/Change handlers) and update the three lines around the phrase "This
_seems_ to work..." to avoid repetitive openings.
- Line 66: The tutorial is inconsistent converting degFString to a number (uses
parseFloat(degFString) at one spot and (+degFString) later); either make both
conversions use the same approach (e.g., replace parseFloat(degFString) with
+degFString or vice versa) or add a short inline note where (+degFString)
appears explaining it's a concise alternative to parseFloat for clarity; update
the occurrences referencing degFString and degF to keep the examples consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0e6d531a-e15d-4f3a-b38e-037b72cc4d06

📥 Commits

Reviewing files that changed from the base of the PR and between 8531eb2 and 231f09d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json and included by **
📒 Files selected for processing (1)
  • docs/tutorial/components-and-reactivity.md

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docs/tutorial/components-and-reactivity.md (1)

62-77: Use one numeric-conversion style across examples

Line 66 and Line 76 use different coercion styles (parseFloat vs unary +) for the same teaching step. Pick one and keep it consistent to reduce tutorial friction.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/tutorial/components-and-reactivity.md` around lines 62 - 77, The
examples use two different numeric coercion styles for the same teaching
point—change them to a single consistent approach; update both occurrences of
<const/degF=...> (the first using parseFloat and the later using unary +) so
they use the same conversion (choose either parseFloat(degFString) or
+(degFString)), and ensure the related <const/degC=(degF - 32) * 5 / 9> and the
<input value:=degFString> example continue to work with the chosen numeric
conversion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/tutorial/components-and-reactivity.md`:
- Around line 62-77: The examples use two different numeric coercion styles for
the same teaching point—change them to a single consistent approach; update both
occurrences of <const/degF=...> (the first using parseFloat and the later using
unary +) so they use the same conversion (choose either parseFloat(degFString)
or +(degFString)), and ensure the related <const/degC=(degF - 32) * 5 / 9> and
the <input value:=degFString> example continue to work with the chosen numeric
conversion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e16e299d-f509-4a32-9b5f-916b90985866

📥 Commits

Reviewing files that changed from the base of the PR and between 231f09d and 00bf9d4.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json and included by **
📒 Files selected for processing (1)
  • docs/tutorial/components-and-reactivity.md

@LuLaValva LuLaValva closed this Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant