Skip to content

Commit 492a487

Browse files
authored
fix(agent-tars): implement app drag functionality (close: #314) (#391)
1 parent 20465ea commit 492a487

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.header {
2+
-webkit-app-region: drag;
3+
}
4+
5+
.closeButton {
6+
-webkit-app-region: no-drag;
7+
}

apps/agent-tars/src/renderer/src/components/CanvasPanel/EventPlayer/index.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
EventType,
2323
} from '@renderer/type/event';
2424
import { renderPlatformPanel } from './renderPlatformPanel';
25+
import styles from './index.module.scss';
2526

2627
const StatusIcon = ({ status }: { status: ActionStatus }) => {
2728
switch (status) {
@@ -161,13 +162,15 @@ export function EventPlayer() {
161162
}}
162163
>
163164
{/* Header */}
164-
<div className="flex-shrink-0 flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800">
165+
<div
166+
className={`${styles.header} flex-shrink-0 flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800`}
167+
>
165168
<h2 className="text-lg font-semibold text-gray-900 dark:text-gray-100">
166169
My Computer
167170
</h2>
168171
<button
169172
onClick={() => setShowCanvas(false)}
170-
className="p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors"
173+
className={`${styles.closeButton} p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors`}
171174
>
172175
<FiX className="w-5 h-5" />
173176
</button>

apps/agent-tars/src/renderer/src/components/LeftSidebar/index.module.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,20 @@
2121

2222
&.collapsed {
2323
width: 56px;
24+
-webkit-app-region: drag;
2425
}
2526
}
2627

2728
.topbar {
2829
flex-shrink: 0;
29-
padding: 8px 12px 0;
30-
margin-top: 10px;
30+
padding: 30px 8px 12px 0;
31+
margin-top: -15px;
3132
margin-bottom: 10px;
3233
display: flex;
3334
justify-content: space-between;
3435
align-items: center;
3536
gap: 8px;
37+
-webkit-app-region: drag;
3638

3739
&.collapsed {
3840
margin-top: 0;
@@ -69,6 +71,7 @@
6971
transition: transform var(--transition-normal);
7072
color: var(--ai-color-text-tertiary);
7173
z-index: 10;
74+
-webkit-app-region: no-drag;
7275

7376
&:hover {
7477
background: var(--ai-color-bg-hover);

0 commit comments

Comments
 (0)