GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(mobile): keep feed inputs below the real thread header · pingdotgg/t3code@703f28f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/mobile/src/features
    • keyboard
      • chatKeyboardFeedInput.test.tsx
    • threads
      • ThreadFeed.tsx
  • patches
    • [email protected]
  • pnpm-lock.yaml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/mobile/src/features/keyboard/chatKeyboardFeedInput.test.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/keyboard/chatKeyboardFeedInput.test.tsx
+32-9Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,19 @@ const { useChatKeyboard } = (await import(
5959
)) as typeof import("react-native-keyboard-controller/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/index.ios");
6060

6161
type LiftBehavior = NonNullable<KeyboardChatScrollViewProps["keyboardLiftBehavior"]>;
62+
type Header = Pick<KeyboardChatScrollViewProps, "contentInset" | "obscuredStartInset">;
6263

63-
// Header inset 80, composer padding 80, and a 300pt keyboard over a 678pt feed.
64+
// The header props ThreadFeed passes: a native top inset on iOS 26+, a list-header spacer before.
65+
const nativeInset = (top: number): Header => ({ contentInset: { top }, obscuredStartInset: top });
66+
const headerSpacer = (top: number): Header => ({ obscuredStartInset: top });
67+
68+
// Composer padding 80 and a 300pt keyboard over a 678pt feed.
6469
// The feed input sits at `inputTop` on screen while the feed rests at `restOffset`.
6570
function renderFeed(
6671
restOffset: number,
6772
inputTop: number,
6873
keyboardLiftBehavior: LiftBehavior = "whenAtEnd",
74+
header: Header = nativeInset(80),
6975
) {
7076
native.scroll.value = restOffset;
7177
let focused = INPUT_TAG;
@@ -81,7 +87,8 @@ function renderFeed(
8187
blankSpace: { value: 0 } as never,
8288
extraContentPadding: { value: 80 } as never,
8389
adjustedInsetCompensation: 0,
84-
adjustedStartInsetCompensation: 80,
90+
adjustedStartInsetCompensation: 0,
91+
...header,
8592
});
8693
chat.onLayout({} as LayoutChangeEvent);
8794
contentOffsetY = chat.contentOffsetY;
@@ -135,14 +142,30 @@ it.each(liftBehaviors)(
135142
},
136143
);
137144

138-
it.each(liftBehaviors)(
139-
"returns the feed to its offset after moving a partly hidden input down below the header (%s)",
140-
(behavior) => {
141-
using feed = renderFeed(1322, 60, behavior);
142-
143-
expect([feed.open(), feed.hide()]).toEqual([1302, 1322]);
145+
it.each([
146+
...liftBehaviors.flatMap((behavior) =>
147+
[nativeInset(80), headerSpacer(80)].map((header) => ({
148+
name: `moves a partly hidden input below the header (${behavior}, ${header.contentInset ? "native inset" : "header spacer"})`,
149+
behavior,
150+
header,
151+
restOffset: 1322,
152+
inputTop: 60,
153+
expected: [1302, 1322],
154+
})),
155+
),
156+
{
157+
name: "leaves a feed resting at its top inset alone for an input in view",
158+
behavior: "whenAtEnd" as const,
159+
header: nativeInset(100),
160+
restOffset: -100,
161+
inputTop: 150,
162+
expected: [-100, -100],
144163
},
145-
);
164+
])("$name, then returns the feed to its offset", (row) => {
165+
using feed = renderFeed(row.restOffset, row.inputTop, row.behavior, row.header);
166+
167+
expect([feed.open(), feed.hide()]).toEqual(row.expected);
168+
});
146169

147170
it("returns the feed to its offset when focus moves from an unlifted composer to a feed input", () => {
148171
using feed = renderFeed(500, 500);
Collapse file

‎apps/mobile/src/features/threads/ThreadFeed.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadFeed.tsx
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3669,6 +3669,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
36693669
contentInsetEndAdjustment={props.contentInsetEndAdjustment}
36703670
keyboardOffset={props.keyboardOffset}
36713671
{...(usesNativeAutomaticInsets ? { contentInset: { top: anchorTopInset } } : {})}
3672+
obscuredStartInset={anchorTopInset}
36723673
freeze={props.freeze}
36733674
maintainScrollAtEnd={jumpReady ? false : THREAD_FEED_MAINTAIN_SCROLL_AT_END}
36743675
maintainVisibleContentPosition

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.