Skip to content

Add missing :key attributes to v-for loops in Tabs.vue #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jul 18, 2025

Description

This PR adds missing :key attributes to two v-for loops in the website/src/components/utils/Tabs.vue component, as requested in issue #778.

Changes Made

  • Added :key="mode" to the <a> element v-for loop (lines 23-28) that renders tab buttons
  • Added :key="mode" to the <template> element v-for loop (line 36) that renders tab content

Why This Matters

Missing :key attributes in v-for loops can lead to:

  • Incorrect DOM reuse when modeText is mutated or re-ordered
  • Subtle animation glitches during tab transitions
  • <keep-alive> cache issues with tab content

Implementation Details

Both loops iterate over (_, mode) in modeText where mode is the unique identifier (object key), making it the perfect choice for the :key attribute. This ensures Vue can properly track each tab and its content during re-renders.

Testing

  • ✅ Linting passes with no errors or warnings
  • ✅ Dev server starts successfully
  • ✅ Website loads correctly
![Playground loading correctly](https://github.com/user-attachments/assets/2a7cdc27-c161-420b-910c-4050a52a7d31)

Note: The playground shows loading errors due to missing ast-grep-wasm dependency, which is unrelated to these changes.

Fixes #778.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • plugins.dprint.dev
    • Triggering command: /home/REDACTED/work/ast-grep.github.io/ast-grep.github.io/node_modules/dprint/dprint check (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Add missing :key attributes to v-for loops in Tabs.vue Add missing :key attributes to v-for loops in Tabs.vue Jul 18, 2025
@Copilot Copilot AI requested a review from HerringtonDarkholme July 18, 2025 14:00
Copilot finished work on behalf of HerringtonDarkholme July 18, 2025 14:00
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.

Add missing :key attributes to v-for loops in Tabs.vue
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy