@@ -722,40 +722,31 @@ describe("ui rendering", () => {
722722 }
723723 });
724724
725- test("renderInputArea reuses stable TextInput handlers from the input controller", () => {
725+ test("renderInputArea returns a direct TextInput with stable handlers", () => {
726726 const state = createTestState();
727727
728728 try {
729729 const controller = createInputController(state);
730- const first = renderInputArea(state.theme, controller);
731- const second = renderInputArea(state.theme, controller);
730+ const firstInput = renderInputArea(state.theme, controller);
731+ const secondInput = renderInputArea(state.theme, controller);
732732
733- expect(first.type).toBe("vstack");
734- expect(second.type).toBe("vstack");
735- if (first.type !== "vstack" || second.type !== "vstack") {
736- throw new Error("Expected input area wrappers to be VStack nodes");
737- }
738-
739- const firstInput = first.children[0];
740- const secondInput = second.children[0];
741- expect(firstInput?.type).toBe("textinput");
742- expect(secondInput?.type).toBe("textinput");
743- if (!firstInput || !secondInput) {
744- throw new Error("Expected text input children to exist");
745- }
733+ expect(firstInput.type).toBe("textinput");
734+ expect(secondInput.type).toBe("textinput");
746735 if (firstInput.type !== "textinput" || secondInput.type !== "textinput") {
747- throw new Error("Expected text input child nodes");
736+ throw new Error("Expected direct TextInput nodes");
748737 }
749738
750739 expect(firstInput.props.placeholder?.props.fgColor).toBe(
751740 state.theme.mutedText,
752741 );
742+ expect(firstInput.props.padding).toEqual({ x: 1 });
753743 expect(firstInput.props.minHeight).toBe(2);
754744 expect(firstInput.props.maxHeight).toBe(10);
755745 expect(firstInput.props.onChange).toBe(controller.onChange);
756746 expect(firstInput.props.onFocus).toBe(controller.onFocus);
757747 expect(firstInput.props.onBlur).toBe(controller.onBlur);
758748 expect(firstInput.props.onKeyPress).toBe(controller.onKeyPress);
749+ expect(secondInput.props.padding).toEqual(firstInput.props.padding);
759750 expect(secondInput.props.minHeight).toBe(firstInput.props.minHeight);
760751 expect(secondInput.props.maxHeight).toBe(firstInput.props.maxHeight);
761752 expect(secondInput.props.onChange).toBe(firstInput.props.onChange);
@@ -906,7 +897,7 @@ describe("ui rendering", () => {
906897 expect(node.children).toHaveLength(4);
907898 expect(node.children[0]?.type).toBe("vstack");
908899 expect(node.children[1]?.type).toBe("text");
909- expect(node.children[2]?.type).toBe("vstack");
900+ expect(node.children[2]?.type).toBe("textinput");
910901 expect(node.children[3]?.type).toBe("hstack");
911902 } finally {
912903 state.db.close();