Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,6 @@ jobs:
--generate-notes
)
if [[ "${GITHUB_REF_NAME}" == *-* ]]; then
args+=(--prerelease)
args+=(--prerelease --latest=false)
fi
gh "${args[@]}"
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

[English](CHANGELOG.md) · [Русский](CHANGELOG.ru.md) · [简体中文](CHANGELOG.zh-CN.md)

## 1.8.4

- Carry forward the evaluation hotfix: avoid redundant work at zoom limits and prevent terminal text from overlapping during DOM/WebGL renderer changes.
- Preserve every wheel event's pointer anchor and zoom limit when batching a burst into one camera update per frame. Direction reversals at a limit respond immediately, and newer direct navigation supersedes pending zoom.
- Keep the canvas from scrolling back to a focused window while the user pans away.
- Snap minimap rectangle edges to device pixels and use borders to avoid transient lines during movement.
- Block Linux middle-button PRIMARY paste during canvas navigation while preserving explicit keyboard and context-menu paste. The guard is disabled on macOS and Windows.
- Keep terminal input focused during renderer changes without taking focus back from another field.
- CanvasLink remains at the signed 1.0 release; no Android code or pairing protocol changes are included.

## 1.8.3.1 — evaluation hotfix

Technical version: `1.8.3-hotfix.1`. This is a prerelease for manual evaluation.

- Stop redundant scene work and camera drift when repeated zoom commands hit the 20% or 135% limit.
- Stop blending old and new terminal character grids during DOM/WebGL switches. Keep the new screen hidden behind the snapshot until it is ready, including transparent themes, and restore it on every cleanup path.
- The reported sustained 1 FPS and occasional crash were not reproduced in the bounded Linux probes; this release does not claim to resolve every performance issue.

## 1.8.3

- Added canvas Auto-sort by task, status, project or grid, with scoped movement and undo (#163, @BIackFIame).
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

[English](CHANGELOG.md) · [Русский](CHANGELOG.ru.md) · [简体中文](CHANGELOG.zh-CN.md)

## 1.8.4

- Включены исправления оценочного хотфикса: устранены лишние обновления на пределах зума и наложение текста при смене рендера DOM/WebGL.
- При объединении событий колёсика сохраняются позиция курсора и пределы каждого шага. Обратное направление на пределе срабатывает сразу; новое прямое перемещение камеры отменяет отложенный зум.
- Канвас больше не прокручивается обратно к окну в фокусе при перемещении камеры.
- Границы мини-карты привязаны к пикселям экрана; вместо внутренних теней используются рамки, чтобы убрать временные линии при движении.
- На Linux заблокирована вставка PRIMARY средней кнопкой при навигации; вставка клавиатурой и через контекстное меню сохранена. На macOS и Windows этот перехват выключен.
- При смене рендера сохраняется фокус ввода терминала; другое выбранное поле не теряет фокус.
- CanvasLink остаётся подписанной версией 1.0; код Android и протокол сопряжения не менялись.

## 1.8.3.1 — оценочный хотфикс

Техническая версия: `1.8.3-hotfix.1`. Предварительный выпуск для ручной проверки.

- Убраны лишние обновления сцены и дрейф камеры при повторных командах зума на пределах 20% и 135%.
- Убрано смешивание старой и новой сетки символов при переключении DOM/WebGL. Новый экран скрыт за снимком до готовности, в том числе в прозрачных темах; видимость восстанавливается при любом завершении перехода.
- Устойчивые просадки до 1 FPS и редкие падения в ограниченных Linux-прогонах не воспроизведены; исправление всех проблем производительности не заявляется.

## 1.8.3

- Автосортировка окон по задаче, состоянию, проекту или сетке с отменой перемещения: #163, @BIackFIame.
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

[English](CHANGELOG.md) · [Русский](CHANGELOG.ru.md) · [简体中文](CHANGELOG.zh-CN.md)

## 1.8.4

- 纳入评估热修复:避免缩放达到限制后的多余更新,并防止 DOM/WebGL 渲染器切换时终端文字重叠。
- 每帧合并滚轮事件时保留每一步的指针锚点和缩放限制。达到限制后反向滚动立即生效;新的直接导航会取消待处理缩放。
- 平移画布时,不再自动滚回获得焦点的窗口。
- 小地图矩形边缘对齐设备像素,使用边框替代内阴影,减少移动时的短暂线条。
- Linux 画布导航期间阻止中键 PRIMARY 粘贴,同时保留键盘和上下文菜单粘贴。macOS 和 Windows 不启用此拦截。
- 切换终端渲染器时保留输入焦点,不会从其他输入框抢回焦点。
- CanvasLink 保持已签名的 1.0 版本;不包含 Android 代码或配对协议变更。

## 1.8.3.1 — 评估热修复

技术版本:`1.8.3-hotfix.1`。用于手动评估的预发布版本。

- 重复缩放命令达到 20% 或 135% 限制时,不再触发多余的场景更新或相机漂移。
- DOM/WebGL 切换时不再混合新旧终端字符网格。新画面就绪前隐藏在快照后方,透明主题同样适用,并在所有清理路径恢复可见性。
- 有限的 Linux 测试未复现持续 1 FPS 或偶发崩溃;本版本不宣称解决所有性能问题。

## 1.8.3

- 新增按任务、状态、项目或网格自动排列窗口,并可撤销移动(#163,@BIackFIame)。
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "canvastty",
"version": "1.8.3",
"version": "1.8.4",
"private": true,
"description": "A spatial desktop for local AI agents and real terminal sessions.",
"desktopName": "CanvasTTY",
Expand Down
6 changes: 3 additions & 3 deletions scripts/verify-release-artifacts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import YAML from "yaml";

const [tag, directory = "release-artifacts"] = process.argv.slice(2);
const manifest = JSON.parse(await readFile(new URL("../package.json", import.meta.url), "utf8"));
if (!/^v\d+\.\d+\.\d+$/.test(tag ?? "") || tag.slice(1) !== manifest.version) {
throw new Error(`Release tag must equal package version v${manifest.version} and be stable`);
if (!/^v\d+\.\d+\.\d+(?:-hotfix\.\d+)?$/.test(tag ?? "") || tag.slice(1) !== manifest.version) {
throw new Error(`Release tag must equal package version v${manifest.version} and be stable or a hotfix prerelease`);
}
const names = await readdir(resolve(directory));
const version = manifest.version.replaceAll(".", "\\.");
Expand Down Expand Up @@ -65,4 +65,4 @@ if (!appcast.includes(`<sparkle:version>${manifest.version}</sparkle:version>`)
!appcast.includes("sparkle:edSignature=") || !appcast.includes("<!-- sparkle-signatures:")) {
throw new Error("Mac appcast has no signed feed and archive entry for this version");
}
console.log(`Verified stable ${tag} release artifacts`);
console.log(`Verified ${tag} release artifacts`);
27 changes: 12 additions & 15 deletions src/renderer/src/features/terminal/TerminalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ function TerminalCardView({
const fitRef = useRef<(() => void) | null>(null);
const rendererTransitionRef = useRef<{
snapshot: HTMLElement;
screen: HTMLElement;
opacity: string;
frame: number | null;
render: { dispose(): void } | null;
fallback: number | null;
animation: Animation | null;
visibilityCleanup: (() => void) | null;
} | null>(null);
const restoreRendererTransition = (): void => {
Expand All @@ -323,8 +324,8 @@ function TerminalCardView({
if (transition.fallback !== null) window.clearTimeout(transition.fallback);
transition.visibilityCleanup?.();
transition.render?.dispose();
transition.animation?.cancel();
transition.snapshot.remove();
transition.screen.style.opacity = transition.opacity;
};
const beginRendererTransition = (terminal: Terminal): HTMLElement | null => {
restoreRendererTransition();
Expand Down Expand Up @@ -359,43 +360,39 @@ function TerminalCardView({
return null;
}
element.append(snapshot);
const opacity = screen.style.opacity;
// Keep xterm's input focused while hiding the replacement renderer behind the snapshot.
screen.style.opacity = "0";
const onVisibilityChange = (): void => {
if (document.hidden) restoreRendererTransition();
};
document.addEventListener("visibilitychange", onVisibilityChange);
rendererTransitionRef.current = {
snapshot,
screen,
opacity,
frame: null,
render: null,
fallback: window.setTimeout(restoreRendererTransition, 250),
animation: null,
visibilityCleanup: () => document.removeEventListener("visibilitychange", onVisibilityChange)
};
return snapshot;
};
const revealRendererTransition = (terminal: Terminal, snapshot: HTMLElement): void => {
const transition = rendererTransitionRef.current;
if (!transition || transition.snapshot !== snapshot) return;
const fadeAfterPaint = (): void => {
const removeAfterPaint = (): void => {
if (rendererTransitionRef.current !== transition) return;
transition.frame = null;
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
restoreRendererTransition();
return;
}
transition.animation = snapshot.animate([{ opacity: 1 }, { opacity: 0 }], {
duration: 180, easing: "ease-out", fill: "forwards"
});
transition.animation.onfinish = () => {
if (rendererTransitionRef.current === transition) restoreRendererTransition();
};
// Different renderer cell grids must never be blended into double text.
restoreRendererTransition();
};
const ready = (): void => {
if (rendererTransitionRef.current !== transition || transition.frame !== null) return;
transition.render?.dispose();
transition.render = null;
transition.frame = requestAnimationFrame(() => {
transition.frame = requestAnimationFrame(fadeAfterPaint);
transition.frame = requestAnimationFrame(removeAfterPaint);
});
};
transition.render = terminal.onRender(ready);
Expand Down
10 changes: 6 additions & 4 deletions src/renderer/src/features/workspace/CanvasMinimap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
cameraWorldViewport,
minimapCameraForPointerDrag,
minimapAreaForBounds,
minimapPixelArea,
MINIMAP_SURFACE_SIZE,
minimapWorldBounds,
minimapWorldPoint
Expand Down Expand Up @@ -270,11 +271,12 @@ function CanvasMinimapView({
}

function areaStyle(area: { x: number; y: number; width: number; height: number }): CSSProperties {
const pixels = minimapPixelArea(area, window.devicePixelRatio);
return {
left: `${area.x * 100}%`,
top: `${area.y * 100}%`,
width: `${area.width * 100}%`,
height: `${area.height * 100}%`
left: pixels.x,
top: pixels.y,
width: pixels.width,
height: pixels.height
};
}

Expand Down
29 changes: 29 additions & 0 deletions src/renderer/src/features/workspace/middleButtonPaste.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** Chromium can dispatch PRIMARY paste after a cancelled middle-button gesture has ended. */
export function attachMiddleButtonPasteGuard(element: HTMLElement, platform: string): () => void {
if (platform !== "linux") return () => {};
// Observe before React's root capture handlers can stop the pointer event.
const document = element.ownerDocument;
const capture = { capture: true };
let middleButton = false;
const pointer = (event: MouseEvent): void => {
middleButton = event.button === 1 && element.contains(event.target as Node);
};
const explicitPasteIntent = (): void => { middleButton = false; };
const paste = (event: ClipboardEvent): void => {
if (!middleButton || !element.contains(event.target as Node)) return;
event.preventDefault();
event.stopImmediatePropagation();
};
document.addEventListener("pointerdown", pointer, capture);
document.addEventListener("mousedown", pointer, capture);
document.addEventListener("keydown", explicitPasteIntent, capture);
document.addEventListener("contextmenu", explicitPasteIntent, capture);
document.addEventListener("paste", paste, capture);
return () => {
document.removeEventListener("pointerdown", pointer, capture);
document.removeEventListener("mousedown", pointer, capture);
document.removeEventListener("keydown", explicitPasteIntent, capture);
document.removeEventListener("contextmenu", explicitPasteIntent, capture);
document.removeEventListener("paste", paste, capture);
};
}
10 changes: 10 additions & 0 deletions src/renderer/src/features/workspace/minimapGeometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ export interface NormalizedMinimapArea extends NormalizedMinimapPoint {
height: number;
}

/** Snap both edges together so moving one-pixel borders stay on the device-pixel grid. */
export function minimapPixelArea(area: NormalizedMinimapArea, pixelRatio = 1) {
const snap = (value: number): number => Math.round(value * pixelRatio) / pixelRatio;
const x = snap(area.x * MINIMAP_SURFACE_SIZE.width);
const y = snap(area.y * MINIMAP_SURFACE_SIZE.height);
const right = snap((area.x + area.width) * MINIMAP_SURFACE_SIZE.width);
const bottom = snap((area.y + area.height) * MINIMAP_SURFACE_SIZE.height);
return { x, y, width: right - x, height: bottom - y };
}

/**
* Fit all supplied bounds with one scale for both axes and a padded perimeter.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/src/features/workspace/rafAccumulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export interface RafAccumulator<T> {
dispose(): void;
}

export function createRafAccumulator<T>(
merge: (pending: T | null, next: T) => T,
export function createRafAccumulator<T, Input = T>(
merge: (pending: T | null, next: Input) => T,
commit: (value: T) => void,
schedule: (callback: () => void) => number = requestAnimationFrame,
cancel: (handle: number) => void = cancelAnimationFrame
): RafAccumulator<T> {
): RafAccumulator<Input> {
let frame: number | null = null;
let pending: T | null = null;

Expand All @@ -34,7 +34,7 @@ export function createRafAccumulator<T>(
};

return {
push(value: T): void {
push(value: Input): void {
pending = merge(pending, value);
if (frame === null) frame = schedule(flush);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
type CanvasMarqueeRect
} from "./canvasSelectionGesture";
import { EDGE_PAN_SPEEDS, createEdgePanLoop, edgePanVelocity } from "./edgePan";
import { attachMiddleButtonPasteGuard } from "./middleButtonPaste";

interface PanState {
pointerId: number;
Expand Down Expand Up @@ -250,6 +251,11 @@ export function useCanvasPointerNavigation({
return () => window.removeEventListener("blur", cancelPointerGesture);
}, [cancelPointerGesture]);

useEffect(() => {
const element = viewport.current;
if (element) return attachMiddleButtonPasteGuard(element, window.canvasTTY.window.platform);
}, [viewport]);

useEffect(() => () => {
edgePan.stop();
if (panState.current) window.canvasTTY.canvasNavigation.setPointerGestureActive(false);
Expand Down
Loading
Loading