Skip to content

Commit 5332f22

Browse files
committed
feat(ai-chat): flash keyboard shortcut hints on textarea focus
Show "Press Enter to send · Shift+Enter for new line" with styled kbd elements in the permission bar when the chat textarea receives focus. Hint fades in and auto-dismisses after 4 seconds, restoring the permission mode info text. Renamed .ai-permission-info to .ai-info and added min-height to prevent layout shift from kbd elements.
1 parent 5db9fda commit 5332f22

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

src/nls/root/strings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,6 +2086,7 @@ define({
20862086
"AI_CHAT_MODE_INFO_EDIT": "AI can edit files. Shell commands need approval",
20872087
"AI_CHAT_MODE_INFO_FULL_AUTO": "AI can edit files and run commands without approval",
20882088
"AI_CHAT_MODE_SWITCH_HINT": "(Shift+Tab to switch)",
2089+
"AI_CHAT_INPUT_HINT": "Press {0} to send · {1} for new line",
20892090
"AI_CHAT_BASH_CONFIRM_TITLE": "Allow command?",
20902091
"AI_CHAT_BASH_ALLOW": "Allow",
20912092
"AI_CHAT_BASH_DENY": "Deny",

src/styles/Extn-AIChatPanel.less

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,8 @@
17171717
display: flex;
17181718
align-items: center;
17191719
gap: 6px;
1720-
padding: 4px 8px;
1720+
padding: 6px 8px 0 8px;
1721+
min-height: 18px;
17211722
cursor: pointer;
17221723
user-select: none;
17231724

@@ -1751,7 +1752,7 @@
17511752
line-height: 1;
17521753
}
17531754

1754-
.ai-permission-info {
1755+
.ai-info {
17551756
display: none;
17561757
margin-left: auto;
17571758
font-size: 11px;
@@ -1761,13 +1762,36 @@
17611762
overflow: hidden;
17621763
text-overflow: ellipsis;
17631764
color: @project-panel-text-2;
1765+
transition: opacity 0.3s ease;
1766+
1767+
kbd {
1768+
display: inline-block;
1769+
padding: 1px 5px;
1770+
font-size: 10px;
1771+
font-family: inherit;
1772+
line-height: 1.2;
1773+
color: @project-panel-text-1;
1774+
background: rgba(255, 255, 255, 0.1);
1775+
border: 1px solid rgba(255, 255, 255, 0.15);
1776+
border-radius: 3px;
1777+
}
1778+
1779+
&.ai-info-flash {
1780+
display: inline;
1781+
animation: ai-info-flash-in 0.3s ease;
1782+
}
17641783
}
17651784

1766-
&:hover .ai-permission-info {
1785+
&:hover .ai-info {
17671786
display: inline;
17681787
}
17691788
}
17701789

1790+
@keyframes ai-info-flash-in {
1791+
from { opacity: 0; }
1792+
to { opacity: 1; }
1793+
}
1794+
17711795
.ai-chat-context-bar {
17721796
display: none;
17731797
flex-wrap: wrap;

0 commit comments

Comments
 (0)