Skip to content
TheChatArchiveThe Chat Archive
x-ai/grok-4.5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION fix(atelierssr): v-show on a non-root element with an existing style…

  1. User

    ISSUE DESCRIPTION

    fix(atelier_ssr): v-show on a non-root element with an existing style attr/:style binding emits a duplicate style attribute, breaking display:none hiding

    Location

    • crates/vize_atelier_ssr/src/codegen/element/plain.rs:490 (process_v_show_on_element unconditionally appends a standalone style="display: none;" chunk; its element param is unused)
    • crates/vize_atelier_ssr/src/codegen/element/plain.rs:245-254 (collect_element_directive_attr — the single-root/inherit_attrs path that correctly merges into one style binding via _mergeProps; reference for the fix)

    Problem

    process_v_show_on_element (used on every non-fallthrough-root element) emits a standalone style="display: none;" chunk instead of merging v-show into the element's existing style. When the element already has a static style attribute or a :style binding, the generated HTML contains TWO style attributes. The HTML parser keeps the FIRST, so display:none is dropped and v-show fails to hide the element (or, in the :style case, the display:none chunk renders first and the bound style is silently dropped). The sibling single-root path already merges correctly via _mergeProps, proving the element-level path is the buggy one.

    Reproduction

    <template>
      <div class="wrapper">
        <span style="color:red" v-show="ok">x</span>
      </div>
    </template>
    

    Actual

    <span style="color:red"${((_ctx.ok) ? "" : " style=\"display: none;\"")}>
    // when ok===false -> <span style="color:red" style="display: none;">x</span> ; browser keeps the first, display:none ignored
    

    <span v-show="ok" :style="{ color }"> likewise emits two style attributes.

    Expected

    Vue's SSR ssrTransformShow rewrites v-show into the single style binding (style=[existing, expr ? null : {display:'none'}]) so there is exactly one style attribute.

    Suggested direction

    In process_v_show_on_element (plain.rs:479-493), inspect the element for an existing static style attr or :style binding and merge (expr ? null : { display: 'none' }) into a single style binding, reusing the merge logic already present in the single-root path (collect_element_directive_attr, plain.rs:245-254).

    Interface

    No new interfaces are introduced.

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /vize, current file: none) bash-$

  2. Assistant

    I'll start by inspecting the relevant code around process_v_show_on_element and the reference merge path in collect_element_directive_attr.

  3. Assistant

    Next I'll inspect process_v_show_on_element and how element attributes/styles are generated.

  4. Assistant

    I'll look at how styles and v-show are handled across codegen and at related tests.

  5. Assistant

    I'll read the full element attribute processing and the v-show / style bind paths.

  6. Assistant

    Let me continue reading the process_element_attrs and process_v_bind functions.

  7. Assistant

    Let me look at how process_v_bind handles style, the existing test snapshots, and Vue's ssrTransformShow for reference.

  8. Assistant

    I'll check Vue's transform, the existing snapshots, and helper APIs for style merging.

  9. Assistant

    I'll look for Vue expected SSR output patterns and how has_dynamic_bind works.

  10. Assistant

    I'll reproduce the bug with the reported template and inspect has_dynamic_bind/related helpers.

  11. Assistant

    I'll write a quick reproduce script and inspect Vue's expected style-merge pattern.

  12. Assistant

    I'll reproduce the duplicate-style bug with a short test program.

  13. Assistant

    I'll run the reproduction from the main workspace instead.

  14. Assistant

    I'll look up how Vue's SSR compiler emits v-show with style.

  15. Assistant

    I'll check Vue's compiler-ssr output for the expected merge shape.

  16. Assistant

    I'll search for related notes and inspect how props merge/normalize handles duplicate style keys.

  17. Assistant

    I'll check how object v-bind interacts with style and whether tests cover that.

  18. Assistant

    I'll inspect helpers and string utilities next so the style-merge code matches existing patterns.

  19. Assistant

    I have a clear plan: skip bare style when merging is needed, fold v-show into :style, and emit one merged style from process_v_show_on_element otherwise.

  20. Assistant

    I'll jump to the target line and reapply the edit.

  21. Assistant

    Good, now I can edit.

  22. Assistant

    Next I'll update the :style and v-show processing to emit a single merged style binding.

  23. Assistant

    I'll update process_v_bind_on_element and process_v_show_on_element.

  24. Assistant

    I'll simplify the merge with merge_prop_values and update process_v_show_on_element.

  25. Assistant

    Now I'll replace process_v_show_on_element itself.

  26. Assistant

    Let me update process_v_show_on_element.

  27. Assistant

    I'll verify the reproduction cases and make sure the crate still compiles.

  28. Assistant

    All reproduction cases look correct. Running the SSR test suite next.

  29. Assistant

    I'll also run the crate's unit tests and a few more edge cases.

  30. Assistant

    I'll review the final diff and clean up temporary files.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.