Skip to content

Suggest <show=condition> when the condition is a named attribute - #4068

Merged
LuLaValva merged 1 commit into
mainfrom
llavalva-M451495HWX-llm-show-cs43ox
Aug 30, 2026
Merged

Suggest <show=condition> when the condition is a named attribute#4068
LuLaValva merged 1 commit into
mainfrom
llavalva-M451495HWX-llm-show-cs43ox

Conversation

@LuLaValva

@LuLaValva LuLaValva commented Aug 30, 2026

Copy link
Copy Markdown
Member

I noticed that LLMs usually don't know that <show> exists, and also that when they find out they often try <show if=cond> instead of <show=cond>.

Remedied by adding to marko-best-practices and improving errors.

`<show if=cond>` reported only that a `value=` attribute was required, which
does not say what to write. Name the shorthand and point the code frame at the
offending attribute, matching the `<if>`/`<else>` wrong-attribute error.

Also adds `<show>` to the best-practices skill checklist. It was absent, so
agents editing `.marko` files reached for `<if>` for stateful toggles; the
cheat sheet covers it but only reaches them after a compile error, and `<if>`
for a toggle never errors.
@changeset-bot

changeset-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 828c940

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@marko/runtime-tags Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e4a6dd53-8ae3-4e54-a95c-0b0044721a87

📥 Commits

Reviewing files that changed from the base of the PR and between 867206f and 828c940.

⛔ Files ignored due to path filters (4)
  • packages/runtime-tags/src/__tests__/fixtures/error-show-wrong-attr/__snapshots__/error-compile-dom.debug.txt is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/error-show-wrong-attr/__snapshots__/error-compile-dom.txt is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/error-show-wrong-attr/__snapshots__/error-compile-html.debug.txt is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/error-show-wrong-attr/__snapshots__/error-compile-html.txt is excluded by !**/__snapshots__/** and included by **
📒 Files selected for processing (5)
  • .changeset/show-if-attr-error.md
  • packages/runtime-tags/src/__tests__/fixtures/error-show-wrong-attr/template.marko
  • packages/runtime-tags/src/__tests__/fixtures/error-show-wrong-attr/test.ts
  • packages/runtime-tags/src/translator/core/show.ts
  • skills/marko-best-practices/SKILL.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

The pull request improves <show> validation errors. When a non-value attribute is supplied, the compiler reports the error on that attribute and suggests <show=condition>. The test fixture now enables compiler-error handling and renders conditional content. A changeset records the diagnostic update. The best-practices guide explains when to use <show=cond> or <if>.

Merge Risk: ⚪ Minimal · up to 828c9

This change improves the <show> error guidance and updates the best-practices checklist without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the main user-facing change: suggesting <show=condition> for the relevant <show> syntax.
Description check ✅ Passed The description accurately covers both changes: improving <show> errors and adding <show> guidance to marko-best-practices.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch llavalva-M451495HWX-llm-show-cs43ox

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

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.78%. Comparing base (867206f) to head (828c940).

Files with missing lines Patch % Lines
packages/runtime-tags/src/translator/core/show.ts 50.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4068      +/-   ##
==========================================
- Coverage   90.78%   90.78%   -0.01%     
==========================================
  Files         424      424              
  Lines       20444    20447       +3     
  Branches     3871     3874       +3     
==========================================
+ Hits        18560    18562       +2     
+ Misses       1324     1323       -1     
- Partials      560      562       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LuLaValva
LuLaValva merged commit a0d1bc1 into main Aug 30, 2026
9 of 11 checks passed
@LuLaValva
LuLaValva deleted the llavalva-M451495HWX-llm-show-cs43ox branch August 30, 2026 21:22
@github-actions github-actions Bot mentioned this pull request Aug 30, 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