fix(desktop): remove command text from approval rule buttons, fixing layout breakage#3700
Conversation
… layout breakage The 'Allow for session' and 'Always allow' buttons in the approval modal displayed the full bash command as inline code (e.g. Bash(cd ...)), which stretched the button elements and broke the card layout. The command is already visible in the card header meta area and the expandable Details section, so showing it again inside the action buttons is redundant. Removed the RuleActionLabel component, the rule-formatting helpers (approvalSessionRule, approvalPersistentRule, truncateSubject), and the unused CSS classes. Fixes esengine#3677
SivanCola
left a comment
There was a problem hiding this comment.
Approved. The PR is a focused and useful desktop UI fix: it removes the repeated command/rule text from approval action buttons, which addresses the long-command layout breakage while keeping the actual approval behavior unchanged.
I helped with the compile/lint follow-up by identifying that the failing lint job is the known staticcheck nil-check issue already fixed on current main-v2, and I reran CI to verify the rest of the PR jobs. I could not update the contributor fork directly because GitHub denied writes to the head repository, so the remaining stale lint failure should clear after the branch is synced with current main-v2.
The main contribution here is the author's UI fix; my part was only helping investigate and follow up on the compile/lint status.
… layout breakage (esengine#3700) The 'Allow for session' and 'Always allow' buttons in the approval modal displayed the full bash command as inline code (e.g. Bash(cd ...)), which stretched the button elements and broke the card layout. The command is already visible in the card header meta area and the expandable Details section, so showing it again inside the action buttons is redundant. Removed the RuleActionLabel component, the rule-formatting helpers (approvalSessionRule, approvalPersistentRule, truncateSubject), and the unused CSS classes. Fixes esengine#3677 Co-authored-by: wufengfan <wufengfan@wufengfandeMacBook-Air.local>
Bug
The "Allow for session" and "Always allow" buttons in the approval modal display the full bash command as inline code (e.g.
Bash(cd "xxx" && npm run build --target production --env staging...)). When the command is long, the button content overflows and breaks the card layout. The same root cause also triggers issue #3646 where option text pushes the card to fill the entire screen.Fix
The command is already visible in the card header meta area (
bash · cd "xxx" && npm run...) and the expandable Details section. Showing it again inside the action buttons is redundant.Removed:
RuleActionLabelcomponent (the<span><code>wrapper around the rule text)approvalSessionRule,approvalPersistentRule,truncateSubjecthelper functionsisFileMutationToolfunction (no longer referenced).approval-rule-label,.approval-rule-label code,.prompt-action:has(.approval-rule-label)Files
ApprovalModal.tsx<code>from action button labelsstyles.cssFixes #3677, fixes #3646