Before submitting
Area
apps/web
Problem or use case
Most of the time when I am writing a prompt, I want to tell the model to look at a path. The @ symbol search works, but it is easier to simply copy the path from my file manager app and paste it into the prompt window. This way I don't have to memorize all my file names. Unfortunately, pasting paths does not work. Pasting a path into T3 code does nothing. I need to paste into a text editor, then copy the path again (this time copying as a text string rather than a path). This will result in successful pasting into T3 chat. Many text entry windows automatically turn pasted paths into text automatically. Currently the only things I can copy from files and paste into T3 are images. This is good, but it would be better if it defaulted to pasting the path if there is no attachable media instead of pasting nothing.
Proposed solution
T3 Code path paste fix
What this fixes
In the desktop app, pasting from a file manager currently only works for images.
This patch keeps image paste as-is, but if the clipboard contains pasted files and none are images, it inserts their filesystem paths into the composer as text instead of doing nothing.
Minimal code change
1. Expose Electron file-path resolution in preload
File: apps/desktop/src/preload.ts
- import
webUtils from electron
- add:
getPathForFile: (file) => webUtils.getPathForFile(file),
2. Add the bridge type
File: packages/contracts/src/ipc.ts
Add to DesktopBridge:
getPathForFile?: (file: File) => string;
It is optional so browser tests and non-desktop surfaces do not need churn.
3. Add a paste fallback in the composer
File: apps/web/src/components/ChatView.tsx
Inside onComposerPaste:
const files = Array.from(event.clipboardData.files);
if (files.length === 0) {
return;
}
const imageFiles = files.filter((file) => file.type.startsWith("image/"));
if (imageFiles.length > 0) {
event.preventDefault();
addComposerImages(imageFiles);
return;
}
const getPathForFile = window.desktopBridge?.getPathForFile;
if (!getPathForFile) {
return;
}
const pastedPaths = files
.map((file) => getPathForFile(file).trim())
.filter((path) => path.length > 0);
if (pastedPaths.length === 0) {
return;
}
event.preventDefault();
const snapshot = readComposerSnapshot();
applyPromptReplacement(
snapshot.expandedCursor,
snapshot.expandedCursor,
pastedPaths.join("\n"),
);
Files changed in my local test
packages/contracts/src/ipc.ts
apps/desktop/src/preload.ts
apps/web/src/components/ChatView.tsx
Notes
- This typechecked in
apps/web, apps/desktop, and packages/contracts.
- On Linux I had to compile
node-pty locally before the desktop app backend would start.
- If some OS/file-manager combinations do not put copied folders into
clipboardData.files, then folder support may need a larger desktop-specific clipboard fallback later.
Why this matters
This feature makes the prompt writing work-flow faster and more streamlined. It brings T3 up to date with other apps like chatGPT or VScode copilot chat.
Smallest useful scope
This fix is easy, with only a few changes across 3 files.
Alternatives considered
No response
Risks or tradeoffs
This change would need to be updated if you plan to allow pasting of more file types. But I like pasting paths and letting codex go explore.
Examples or references
No response
Contribution
Before submitting
Area
apps/web
Problem or use case
Most of the time when I am writing a prompt, I want to tell the model to look at a path. The @ symbol search works, but it is easier to simply copy the path from my file manager app and paste it into the prompt window. This way I don't have to memorize all my file names. Unfortunately, pasting paths does not work. Pasting a path into T3 code does nothing. I need to paste into a text editor, then copy the path again (this time copying as a text string rather than a path). This will result in successful pasting into T3 chat. Many text entry windows automatically turn pasted paths into text automatically. Currently the only things I can copy from files and paste into T3 are images. This is good, but it would be better if it defaulted to pasting the path if there is no attachable media instead of pasting nothing.
Proposed solution
T3 Code path paste fix
What this fixes
In the desktop app, pasting from a file manager currently only works for images.
This patch keeps image paste as-is, but if the clipboard contains pasted files and none are images, it inserts their filesystem paths into the composer as text instead of doing nothing.
Minimal code change
1. Expose Electron file-path resolution in preload
File:
apps/desktop/src/preload.tswebUtilsfromelectron2. Add the bridge type
File:
packages/contracts/src/ipc.tsAdd to
DesktopBridge:It is optional so browser tests and non-desktop surfaces do not need churn.
3. Add a paste fallback in the composer
File:
apps/web/src/components/ChatView.tsxInside
onComposerPaste:Files changed in my local test
packages/contracts/src/ipc.tsapps/desktop/src/preload.tsapps/web/src/components/ChatView.tsxNotes
apps/web,apps/desktop, andpackages/contracts.node-ptylocally before the desktop app backend would start.clipboardData.files, then folder support may need a larger desktop-specific clipboard fallback later.Why this matters
This feature makes the prompt writing work-flow faster and more streamlined. It brings T3 up to date with other apps like chatGPT or VScode copilot chat.
Smallest useful scope
This fix is easy, with only a few changes across 3 files.
Alternatives considered
No response
Risks or tradeoffs
This change would need to be updated if you plan to allow pasting of more file types. But I like pasting paths and letting codex go explore.
Examples or references
No response
Contribution