Skip to content
TheChatArchiveThe Chat Archive
MiniMaxminimax/minimax-m3· 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. MiniMax Assistant

    Let me start by exploring the repository structure to understand the codebase.

  3. MiniMax Assistant

    Now let's look at how process_v_show_on_element is called from the rest of the codebase. Let me search for it.

  4. MiniMax Assistant

    Let me look at the process_element_attrs function:

  5. MiniMax Assistant

    Now let me look at the v-bind processing for style to understand how it currently processes:

  6. MiniMax Assistant

    Let me look at the _ssrRenderStyle helper and how v-show should be transformed.

  7. MiniMax Assistant

    Now let me check how Vue's actual SSR ssrTransformShow works to understand the expected behavior:

  8. MiniMax Assistant

    Let me look at related helper functions and the has_dynamic_bind function.

  9. MiniMax Assistant

    Let me look at the props.rs to understand the related structures:

  10. MiniMax Assistant

    Let me look at the snapshots for v-bind style:

  11. MiniMax Assistant

    Let me check existing tests around v-bind with static style:

  12. MiniMax Assistant

    Let me also check how cstr! works for code formatting:

  13. MiniMax Assistant

    Let me check push_string_part_static and push_string_part_dynamic:

  14. MiniMax Assistant

    Let me first try to build and verify the current behavior:

  15. MiniMax Assistant

    Now let me create a small reproduction test:

  16. MiniMax Assistant

    Let me create a small example:

  17. MiniMax Assistant

    Let me look at how component_props_object handles multiple style entries:

  18. MiniMax Assistant

    Let me look at the existing quoted_js_string and process_v_bind_on_element more carefully:

  19. MiniMax Assistant

    Let me look at the helpers again and what other helpers exist:

  20. MiniMax Assistant

    Good. Now I have everything I need. Let me write the fix:

  21. MiniMax Assistant

    Now let me implement the fix. First, modify process_element_attrs to detect v-show:

  22. MiniMax Assistant

    I see duplicate continue; lines. Let me fix that:

  23. MiniMax Assistant

    I have a duplicate push_string_part_static(" ");. Let me fix that:

  24. MiniMax Assistant

    The edits are messy. Let me restart with a clean replacement of the section:

  25. MiniMax Assistant

    I see the file is in a broken state. Let me just check what the current line 127 looks like. The issue is on line 127 there's still no if (...) { line, it's just continue;. Let me look at line 126-127.

  26. MiniMax Assistant

    I see the file is corrupted. Let me restore it and try again:

  27. MiniMax Assistant

    Good. Now let me edit properly:

  28. MiniMax Assistant

    The edit overwrote some lines. Let me restore and rewrite cleanly:

  29. MiniMax Assistant

    Now let me do replace properly to add has_v_show:

  30. MiniMax Assistant

    Now process_element_attrs is correctly updated. Let me update process_v_show_on_element to properly handle the merge cases:

  31. MiniMax Assistant

    Now I need to update process_v_bind_on_element for the :style case to merge v-show if present:

  32. MiniMax Assistant

    Now let me build to confirm everything compiles:

  33. MiniMax Assistant

    Now let me run my reproduction script to see if it works:

  34. MiniMax Assistant

    Excellent! All cases now produce exactly ONE style attribute! Let me test the original repro case from the issue:

  35. MiniMax Assistant

    The exact case from the issue now produces a single style attribute with merged display:none. Let me now think about edge cases:

    1. What if v-show is on an element without a closing space before it? Like <div v-show="ok">. Let me check.
    2. What about the order of props in the template? Let me check various orderings.
    3. What about custom directives on the same element?
  36. MiniMax Assistant

    The duplicate style attribute case is a syntax error which is fine. Let me also test the root element case (<div v-show="ok" style="color:red">x</div>) to make sure the inherit_attrs path also works.

  37. MiniMax Assistant

    All non-root cases work correctly. Now let me check the root element case:

  38. MiniMax Assistant

    All root-level cases produce a single style attribute via the _mergeProps path. Let me run the existing tests to verify nothing is broken:

  39. MiniMax Assistant

    All 68 tests pass. Let me also check the final result:

  40. MiniMax Assistant

    Now let me run the broader workspace tests:

  41. MiniMax Assistant

    Let me check if the failing test is related to my changes:

  42. MiniMax Assistant

    The failing test is pre-existing and unrelated to my fix. Let me verify the v-show tests specifically still pass and double check that the existing v-show test snapshot is still correct:

  43. MiniMax Assistant

    Good. The existing v-show tests still produce the same output as before since they don't have any style attribute. Let me also check the v-bind style snapshot still has the same output:

  44. MiniMax Assistant

    Let me also test the class case to make sure my changes don't accidentally affect it:

  45. MiniMax Assistant

    Good. The class behavior is unchanged. Now let me also verify that my fix doesn't affect anything else when :style has modifiers or non-standard arg:

  46. MiniMax Assistant

    Let me also test the component case to make sure I don't break that:

  47. MiniMax Assistant

    All component cases work correctly with _mergeProps. Now let me make sure I haven't broken anything else with a wider test run:

  48. MiniMax Assistant

    All tests pass. Now let me also examine the line numbers in my changes:

  49. MiniMax Assistant

    Now let me clean up the example file (since it was a temporary test, not a real test):

  50. MiniMax Assistant

    Good. Now let me also look at the final state and any clippy issues:

  51. MiniMax Assistant

    No clippy issues. Let me now do a final test with the full SSR snapshot test suite to make sure everything is working:

  52. MiniMax Assistant

    All 108 tests pass (40 lib + 68 snapshot tests). Let me look at the final state of the diff once more to confirm what I've changed:

  53. MiniMax Assistant

    Let me also run the whole workspace tests except for the pre-existing failing test:

  54. MiniMax Assistant

    Those failures are pre-existing (Pkl server missing) and unrelated to my changes. Let me confirm:

  55. MiniMax Assistant

    Same number of failures (8 failed) with and without my changes - confirmed pre-existing. My changes don't break anything.

    Let me also verify the SSR tests one more time:

  56. MiniMax Assistant

    All 108 SSR tests pass. Let me verify my fix once more with a quick reconstruction test using a temp file (already removed):

  57. MiniMax Assistant

    The exact issue case now produces a single style attribute with the merged display: none. Let me verify cleanup:

  58. MiniMax Assistant

    Only the plain.rs file is modified. Let me review my final changes once more:

  59. MiniMax Assistant

    Let me do a final pass to confirm my changes work and the tests are passing:

  60. MiniMax Assistant

    All 108 tests in vize_atelier_ssr pass.

    Now let me write up my checklist reasoning:

    Checklist:

    1. If an error was reported in the issue description, I have successfully reproduced it.

      • ✅ YES. I created a temporary example script that compiled the reproduction case <span style="color:red" v-show="ok"> and confirmed the buggy output with two style attributes. After my fix, the output is now a single merged style attribute via _ssrRenderStyle.
    2. If an error was reported in the issue description, I have confirmed that my fix resolves the error.

      • ✅ YES. After the fix, all the cases produce a single style attribute:
        • <span v-show="ok"> → existing standalone chunk (correct fallback)
        • <span style="color:red" v-show="ok"> → _ssrRenderStyle(["color:red", (ok ? null : {display:"none"})])
        • <span :style="{color}" v-show="ok"> → _ssrRenderStyle([{color}, (ok ? null : {display:"none"})])
        • <span style="color:red" :style="{background}" v-show="ok"> → _ssrRenderStyle(["color:red", {background}, (ok ? null : {display:"none"})])
    3. I have thought about edge cases and made sure my fix handles them as well.

      • ✅ YES. Edge cases considered and tested:
        • :class is unaffected (verified).
        • v-bind="obj" without arg is unaffected (uses _ssrRenderAttrs).
        • :style with array literal e.g. [base, extra] works: _ssrRenderStyle([[base, extra], vShowExpr]).
        • Reverse attribute order <span v-show="ok" style="..."> works correctly.
        • Root element (using inherit_attrs=true path via _mergeProps) was already working and remains working.
        • Component elements (<MyComp v-show="ok">) use _mergeProps and work correctly with the existing collect_element_directive_attr logic.
    4. I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.

      • ✅ YES. All 108 existing tests in vize_atelier_ssr pass: 40 lib tests + 68 snapshot tests. The pre-existing failing tests in vize_atelier_sfc (Pkl server missing) and vize (template syntax quirks test) are unrelated to my changes—they fail both before and after.

    Let me do a final review of my code one more time:

  61. MiniMax Assistant

    All looks good. Let me also check the helper trait functions:

  62. MiniMax Assistant

    Good. The helpers are accessible via crate::has_v_show and crate::get_v_show_exp (matching the existing pattern in the file).

    Let me also check the lib.rs exports to be sure:

  63. MiniMax Assistant

    Let me also do one more sanity check with :class and v-show together since they could possibly interact with my change in process_v_bind_on_element:

  64. MiniMax Assistant

    All edge cases work correctly:

    • :class with v-show: still produces correct class + standalone display:none
    • Multiple attributes with v-show: handles each correctly
    • Boolean attribute with v-show: works correctly

    Now let me clean up the example directory:

  65. MiniMax Assistant

    Only the expected file is modified. Let me do one final test pass to confirm:

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