Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/quiet-cobras-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nanocollective/nanocoder": minor
---

Add automatic collapsing and keyboard expand/collapse controls for long user messages in the conversation view. Messages exceeding 40 words or 300 characters are collapsed for display, while the original prompt remains intact.
6 changes: 5 additions & 1 deletion source/app/components/chat-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export interface ChatHistoryProps {
* the alt buffer has no scrollback for it to print into.
*/
fullscreen?: boolean;
/** Keep transcript components live for interactive inline controls. */
interactive?: boolean;
/**
* Whether PageUp/PageDown scrolling is active. Off while a modal
* (model selector, wizard, explorer) is open so those keys reach the
Expand Down Expand Up @@ -57,6 +59,7 @@ export const ChatHistory = React.memo(function ChatHistory({
renderLastQueuedComponentLive,
clearKey,
fullscreen = false,
interactive = false,
scrollActive = false,
}: ChatHistoryProps): React.ReactElement {
const {colors} = useTheme();
Expand Down Expand Up @@ -139,14 +142,15 @@ export const ChatHistory = React.memo(function ChatHistory({
queuedComponents,
renderLastQueuedComponentLive,
clearKey,
disableStatic: fullscreen,
disableStatic: fullscreen || interactive,
}),
[
frozenComponents,
queuedComponents,
renderLastQueuedComponentLive,
clearKey,
fullscreen,
interactive,
],
);

Expand Down
1 change: 1 addition & 0 deletions source/app/sections/interactive-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ export function InteractiveApp({
renderLastQueuedComponentLive={recallableSubmittedDraft}
clearKey={clearKey}
fullscreen={fullscreen}
interactive={true}
scrollActive={
!showModalSelectors &&
!appState.isExplorerMode &&
Expand Down
6 changes: 6 additions & 0 deletions source/components/user-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,12 @@ export default function UserInput({
return;
}

// Ink broadcasts input to every active handler. Once focus moves to a
// transcript control, leave ordinary input handling to that control.
if (!effectiveFocus) {
return;
}

// Ctrl+V: pull an image off the system clipboard as an attachment.
// Terminal paste of regular text arrives as a bracketed paste, not as
// Ctrl+V, so this binding is free to mean "paste image".
Expand Down
Loading
Loading