Add Category column to Global Variables table
Global variables lacked a visible Category column, forcing users to click into each variable to determine if it was a Terraform or Environment variable. Variable sets and workspace variables already displayed this information inline.
Changes:
- Added Category column to global variables table showing "terraform" or "env"
- Adjusted column widths: Key (30%), Value (30%), Category (15%), Actions (25%)
- Implemented sorting on Category column using displayed values
Implementation:
{
title: "Category",
dataIndex: "category",
key: "category",
width: "15%",
sorter: (a: Variable, b: Variable) => {
const categoryA = a.attributes.category === "TERRAFORM" ? "terraform" : "env";
const categoryB = b.attributes.category === "TERRAFORM" ? "terraform" : "env";
return categoryA.localeCompare(categoryB);
},
render: (_: any, record: Variable) => {
return record.attributes.category === "TERRAFORM" ? "terraform" : "env";
},
}
Display format matches workspace variables (Variables.tsx) and variable collections (CreateEditCollection.tsx) for consistency.
Original prompt
This section details on the original issue you should resolve
<issue_title>Global variables display differs from variables sets. You can't see type or description without clicking into them.</issue_title> <issue_description>### Bug description 🐞
Not a bug, but global vars should share the same style of UI as variable sets and workspace variables.
Steps to reproduce
Open global variables. Tell me what's a env and whats a tf var without clicking into it.
Expected behavior
Variable type should display just like it does for other variable UI in the app.
Example repository
No response
Anything else?
No response</issue_description>
<agent_instructions>Use the same UI style for global variables</agent_instructions>
Comments on the Issue (you are @copilot in this section)
- Fixes terrakube-io/terrakube#2788
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.