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 what we're working with.

  3. MiniMax Assistant

    Let me explore the vize_atelier_ssr crate, particularly the file mentioned in the issue.

  4. MiniMax Assistant

    Now let me explore how the SSR style rendering works and look at related test cases.

  5. MiniMax Assistant

    Let me look at the existing tests for v-show in the SSR crate.

  6. MiniMax Assistant

    Let me look at the test file to understand the format.

  7. MiniMax Assistant

    Let me look at the imports and structure of the file more carefully.

  8. MiniMax Assistant

    Let me create a reproduce script first to confirm the issue.

  9. MiniMax Assistant

    Let me create a temporary reproduction test file.

  10. MiniMax Assistant

    The bug is reproduced. Now let me look at the quoted_js_string helper and understand more.

  11. MiniMax Assistant

    Now I understand the bug. Let me implement the fix. First, let me understand the data structures better.

  12. MiniMax Assistant

    Now I'll implement the fix. Let me look at the exact lines I need to modify.

  13. MiniMax Assistant

    Now let me apply the fix step by step.

    Step 1: Add a has_v_show helper and modify process_element_attrs to skip static style when v-show is present.

  14. MiniMax Assistant

    Step 2: Now let me modify process_v_bind_on_element to skip :style when v-show is present.

  15. MiniMax Assistant

    The edit didn't go well. Let me view the affected section to understand the damage:

  16. MiniMax Assistant

    Let me revert the file and start over:

  17. MiniMax Assistant

    Now let me start over with a careful approach. First, let me check the current state of the file:

  18. MiniMax Assistant

    Let me re-apply changes carefully one at a time. First, the process_element_attrs:

  19. MiniMax Assistant

    Now I can see the file. Let me use edit instead:

  20. MiniMax Assistant

    Now let me look at the :style case in process_v_bind_on_element:

  21. MiniMax Assistant

    Now let me look at process_v_show_on_element:

  22. MiniMax Assistant

    I see an extra closing brace. Let me fix it:

  23. MiniMax Assistant

    Now let me verify the fix with the reproduction test:

  24. MiniMax Assistant

    The fix works. Now let me run all existing tests to ensure nothing is broken:

  25. MiniMax Assistant

    Let me verify a few more edge cases:

  26. MiniMax Assistant

    Let me also verify the component (root) case isn't affected by my changes:

  27. MiniMax Assistant

    The test failure was due to a faulty assertion. The actual output is correct (it has the escaped quotes). Let me verify with a corrected assertion:

  28. MiniMax Assistant

    Excellent! All edge cases pass. Let me run all the existing tests one more time to confirm:

  29. MiniMax Assistant

    Let me look at the current state of my changes to verify everything is correct:

  30. MiniMax Assistant

    Let me view the entire modified process_v_show_on_element function to make sure it's correct:

  31. MiniMax Assistant

    Let me also view the other changes:

  32. MiniMax Assistant

    Let me check if there are other places that process v-show:

  33. MiniMax Assistant

    There's an existing has_v_show function in transforms.rs. Let me look at it - I can potentially use it instead of defining my own.

    Looking at the import in element.rs:

    use super::{SsrCodegenContext, helpers::escape_html_attr, helpers::extract_destructure_params};
    

    And:

    use vize_carton::cstr;
    

    So I could potentially import has_v_show from the parent module. Let me check the lib.rs:

  34. MiniMax Assistant

    Good - has_v_show is exported as pub. Let me update my code to use that instead of redefining it.

    Actually wait, it's exposed as crate::has_v_show, not within codegen. Let me check how get_v_show_exp is used in element.rs:

  35. MiniMax Assistant

    Let me clean things up. I have two options:

    1. Use crate::has_v_show (already exported).
    2. Keep my local has_v_show_element helper.

    Option 1 is cleaner since it uses the existing function. Let me refactor.

    Wait, let me also check get_v_show_exp and get_v_model_exp usages:

  36. MiniMax Assistant

    Let me refactor to use the existing crate::has_v_show:

  37. MiniMax Assistant

    Let me simplify by removing the helper and inlining crate::has_v_show(el):

  38. MiniMax Assistant

    The file got broken again. Let me revert and try a different approach:

  39. MiniMax Assistant

    Let me try a different approach using sed to apply changes more reliably:

  40. MiniMax Assistant

    All 8 reproduction tests pass. Let me run all existing tests:

  41. MiniMax Assistant

    All 68 existing tests still pass. Let me also check the broader test suite to make sure I haven't broken anything in related crates:

  42. MiniMax Assistant

    Now let me view the final state of my changes:

  43. MiniMax Assistant

    Let me also check related tests in the broader repo:

  44. MiniMax Assistant

    These don't appear related. Let me also check that we have unit tests for the patterns at the higher level tests:

  45. MiniMax Assistant

    Let me verify my changes don't break this test project:

  46. MiniMax Assistant

    Let me also double-check no relevant test was missed:

  47. MiniMax Assistant

    Let me now look at the diff to confirm my changes:

  48. MiniMax Assistant

    Let me clean up the temporary reproduction file before submitting:

  49. MiniMax Assistant

    Now let me run the existing tests one more time to make sure everything still works:

  50. MiniMax Assistant

    All 68 tests pass. Let me also run a wider scope of tests to ensure I haven't broken anything else:

  51. MiniMax Assistant

    The entire workspace builds. Let me also run clippy to ensure no lints:

  52. MiniMax Assistant

    Clippy passes. Let me also do one more test by creating a quick reproduction test in a temporary location to verify the fix:

  53. MiniMax Assistant

    Let me clean up the temporary test files:

  54. MiniMax Assistant

    Let me also run the tests one final time to ensure everything is in order:

  55. MiniMax Assistant

    All 68 tests pass. Let me view the final modified function to confirm everything is in order:

  56. MiniMax Assistant

    The fix looks good. Now let me also verify the file size hasn't unexpectedly ballooned:

  57. MiniMax Assistant

    Let me run all the existing tests one final time to ensure everything is working:

  58. MiniMax Assistant

    All tests pass. Let me now also verify the diff is exactly what I expect:

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