@devries-cameron20 / t3code-1 / commits / 688e594804
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

refactor(web): keep pending action labels private (#10075)

Julius Marminge committed Sep 5, 2026 at 01:57 UTC 688e5948046e14be7f2bfd48d1c91b7e94d79267
2 files changed +2 -92
apps/web/src/components/chat/ComposerPrimaryActions.test.tsx
+1 -91
@@ -15,7 +15,7 @@ vi.mock("../SidebarStageBackdrop", () => ({
15 useSidebarStageBackdropVariant: (enabled = true) => (enabled ? stageArtworkState.variant : null),
16 }));
17
18 -import { ComposerPrimaryActions, formatPendingPrimaryActionLabel } from "./ComposerPrimaryActions";
18 +import { ComposerPrimaryActions } from "./ComposerPrimaryActions";
19
20 function renderPendingActions(isRunning: boolean) {
21 return renderToStaticMarkup(
@@ -92,96 +92,6 @@ afterEach(() => {
92 stageArtworkState.variant = null;
93 });
94
95 -describe("formatPendingPrimaryActionLabel", () => {
96 - it("returns 'Submitting...' while responding", () => {
97 - expect(
98 - formatPendingPrimaryActionLabel({
99 - compact: false,
100 - isLastQuestion: false,
101 - isResponding: true,
102 - questionIndex: 0,
103 - }),
104 - ).toBe("Submitting...");
105 - });
106 -
107 - it("returns 'Submitting...' while responding regardless of other flags", () => {
108 - expect(
109 - formatPendingPrimaryActionLabel({
110 - compact: true,
111 - isLastQuestion: true,
112 - isResponding: true,
113 - questionIndex: 3,
114 - }),
115 - ).toBe("Submitting...");
116 - });
117 -
118 - it("returns 'Submit' in compact mode on the last question", () => {
119 - expect(
120 - formatPendingPrimaryActionLabel({
121 - compact: true,
122 - isLastQuestion: true,
123 - isResponding: false,
124 - questionIndex: 0,
125 - }),
126 - ).toBe("Submit");
127 - });
128 -
129 - it("returns 'Next' in compact mode when not the last question", () => {
130 - expect(
131 - formatPendingPrimaryActionLabel({
132 - compact: true,
133 - isLastQuestion: false,
134 - isResponding: false,
135 - questionIndex: 1,
136 - }),
137 - ).toBe("Next");
138 - });
139 -
140 - it("returns 'Next question' when not the last question", () => {
141 - expect(
142 - formatPendingPrimaryActionLabel({
143 - compact: false,
144 - isLastQuestion: false,
145 - isResponding: false,
146 - questionIndex: 0,
147 - }),
148 - ).toBe("Next question");
149 - });
150 -
151 - it("returns singular 'Submit answer' on the last question when it is the only question", () => {
152 - expect(
153 - formatPendingPrimaryActionLabel({
154 - compact: false,
155 - isLastQuestion: true,
156 - isResponding: false,
157 - questionIndex: 0,
158 - }),
159 - ).toBe("Submit answer");
160 - });
161 -
162 - it("returns plural 'Submit answers' on the last question when there are multiple questions", () => {
163 - expect(
164 - formatPendingPrimaryActionLabel({
165 - compact: false,
166 - isLastQuestion: true,
167 - isResponding: false,
168 - questionIndex: 1,
169 - }),
170 - ).toBe("Submit answers");
171 - });
172 -
173 - it("returns plural 'Submit answers' for higher question indices", () => {
174 - expect(
175 - formatPendingPrimaryActionLabel({
176 - compact: false,
177 - isLastQuestion: true,
178 - isResponding: false,
179 - questionIndex: 5,
180 - }),
181 - ).toBe("Submit answers");
182 - });
183 -});
184 -
95 describe("ComposerPrimaryActions", () => {
96 it("disables and labels the send button while feedback is uploading", () => {
97 const markup = renderSendButton("Sending feedback");
apps/web/src/components/chat/ComposerPrimaryActions.tsx
+1 -1
@@ -37,7 +37,7 @@ interface ComposerPrimaryActionsProps {
37 onImplementPlanInNewThread: () => void;
38 }
39
40 -export const formatPendingPrimaryActionLabel = (input: {
40 +const formatPendingPrimaryActionLabel = (input: {
41 compact: boolean;
42 isLastQuestion: boolean;
43 isResponding: boolean;