Before

…lines 1–5 unchanged (5 lines)
6// This invisible UITextField becomes first responder immediately when the user
7// switches to the Search tab. This lets us show the keyboard *before*
8// SwiftUI’s searchable view finishes its expansion animation.
9//
10struct KeyboardHackField: UIViewRepresentable {
11 @Binding var shouldShow: Bool
12
13 class Coordinator {
14 let textField = UITextField()
15 }
16
17 func makeCoordinator() -> Coordinator {
18 Coordinator()
19 }
20
21 func makeUIView(context: Context) -> UIView {
22 let container = UIView(frame: .zero)
23 let tf = context.coordinator.textField
24 tf.isHidden = true
25 tf.keyboardType = .default
26 container.addSubview(tf)
27 return container
28 }
29
30 func updateUIView(_ uiView: UIView, context: Context) {
31 let tf = context.coordinator.textField
32 if shouldShow {
…lines 33–462 unchanged (430 lines)

After

…lines 1–6 unchanged (6 lines)
7// switches to the Search tab. This lets us show the keyboard *before*
8// SwiftUI’s searchable view finishes its expansion animation.
9//
10struct KeyboardHackField: UIViewRepresentable {
11 @Binding var shouldShow: Bool
12
13 // Capture Backspace/Enter on the hidden field and forward to JS.
14 class KeyboardHackTextField: UITextField {
15 var onKeyPress: ((String) -> Void)?
16
17 override func deleteBackward() {
18 super.deleteBackward()
19 onKeyPress?("backspace")
20 text = ""
21 }
22
23 override func insertText(_ text: String) {
24 super.insertText(text)
25 if text == "\n" {
26 onKeyPress?("enter")
27 }
28 self.text = ""
29 }
30 }
31
32 class Coordinator {
33 let textField = KeyboardHackTextField()
34 }
35
36 func makeCoordinator() -> Coordinator {
37 Coordinator()
38 }
39
40 func makeUIView(context: Context) -> UIView {
41 let container = UIView(frame: .zero)
42 let tf = context.coordinator.textField
43 tf.isHidden = true
44 tf.keyboardType = .default
45 tf.onKeyPress = { key in
46 LiquidTabsPlugin.shared?.notifyKeyboardHackKey(key: key)
47 }
48 container.addSubview(tf)
49 return container
50 }
51
52 func updateUIView(_ uiView: UIView, context: Context) {
53 let tf = context.coordinator.textField
…lines 54–484 unchanged (431 lines)

Before

source_file
import_declaration
import "import"
identifier
simple_identifier "SwiftUI"
import_declaration
import "import"
identifier
simple_identifier "UIKit"
comment "// MARK: - Hidden UITextField that forces the keyboard to ap"...
comment "//"
comment "// This invisible UITextField becomes first responder immedi"...
comment "// switches to the Search tab. This lets us show the keyboar"...
comment "// SwiftUI’s searchable view finishes its expansion animatio"...
comment "//"
class_declaration
struct "struct"
type_identifier "KeyboardHackField"
: ":"
inheritance_specifier
user_type
type_identifier "UIViewRepresentable"
class_body
{ "{"
property_declaration
modifiers
attribute
@ "@"
user_type
type_identifier "Binding"
value_binding_pattern
var "var"
pattern
simple_identifier "shouldShow"
type_annotation
: ":"
user_type
type_identifier "Bool"
class_declaration
class "class"
type_identifier "Coordinator"
class_body
{ "{"
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "textField"
= "="
call_expression
simple_identifier "UITextField"
call_suffix
value_arguments
( "("
) ")"
} "}"
function_declaration
func "func"
simple_identifier "makeCoordinator"
( "("
) ")"
-> "->"
user_type
type_identifier "Coordinator"
function_body
{ "{"
statements
call_expression
simple_identifier "Coordinator"
call_suffix
value_arguments
( "("
) ")"
} "}"
function_declaration
func "func"
simple_identifier "makeUIView"
( "("
parameter
simple_identifier "context"
: ":"
user_type
type_identifier "Context"
) ")"
-> "->"
user_type
type_identifier "UIView"
function_body
{ "{"
statements
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "container"
= "="
call_expression
simple_identifier "UIView"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "frame"
: ":"
prefix_expression
. "."
simple_identifier "zero"
) ")"
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "tf"
= "="
navigation_expression
navigation_expression
simple_identifier "context"
navigation_suffix
. "."
simple_identifier "coordinator"
navigation_suffix
. "."
simple_identifier "textField"
assignment
directly_assignable_expression
navigation_expression
simple_identifier "tf"
navigation_suffix
. "."
simple_identifier "isHidden"
= "="
boolean_literal
true "true"
assignment
directly_assignable_expression
navigation_expression
simple_identifier "tf"
navigation_suffix
. "."
simple_identifier "keyboardType"
= "="
prefix_expression
. "."
simple_identifier "default"
call_expression
navigation_expression
simple_identifier "container"
navigation_suffix
. "."
simple_identifier "addSubview"
call_suffix
value_arguments
( "("
value_argument
simple_identifier "tf"
) ")"
control_transfer_statement
return "return"
simple_identifier "container"
} "}"
function_declaration (+88 nodes collapsed)
} "}"
comment "// MARK: - Root Tabs View (dispatch to 26+ vs 16–25)"
class_declaration (+77 nodes collapsed)
comment "// MARK: - Shared selection helpers"
class_declaration (+21 nodes collapsed)
class_declaration (+210 nodes collapsed)
comment "// MARK: - iOS 26+ implementation using Tab(...) API + searc"...
class_declaration (+1452 nodes collapsed)
comment "// Search host for 26+ (unchanged)"
class_declaration (+327 nodes collapsed)
comment "// MARK: - iOS 16–25 implementation"
comment "// Classic TabView + .tabItem; Search tab shows a custom sea"...
class_declaration (+900 nodes collapsed)
class_declaration (+420 nodes collapsed)

After

source_file
import_declaration
import "import"
identifier
simple_identifier "SwiftUI"
import_declaration
import "import"
identifier
simple_identifier "UIKit"
comment "// MARK: - Hidden UITextField that forces the keyboard to ap"...
comment "//"
comment "// This invisible UITextField becomes first responder immedi"...
comment "// switches to the Search tab. This lets us show the keyboar"...
comment "// SwiftUI’s searchable view finishes its expansion animatio"...
comment "//"
class_declaration
struct "struct"
type_identifier "KeyboardHackField"
: ":"
inheritance_specifier
user_type
type_identifier "UIViewRepresentable"
class_body
{ "{"
property_declaration
modifiers
attribute
@ "@"
user_type
type_identifier "Binding"
value_binding_pattern
var "var"
pattern
simple_identifier "shouldShow"
type_annotation
: ":"
user_type
type_identifier "Bool"
comment "// Capture Backspace/Enter on the hidden field and forward t"...
class_declaration
class "class"
type_identifier "KeyboardHackTextField"
: ":"
inheritance_specifier
user_type
type_identifier "UITextField"
class_body
{ "{"
property_declaration
value_binding_pattern
var "var"
pattern
simple_identifier "onKeyPress"
type_annotation
: ":"
optional_type
tuple_type
( "("
tuple_type_item
function_type
tuple_type
( "("
tuple_type_item
user_type
type_identifier "String"
) ")"
-> "->"
user_type
type_identifier "Void"
) ")"
?
? "?"
function_declaration
modifiers
member_modifier
override "override"
func "func"
simple_identifier "deleteBackward"
( "("
) ")"
function_body
{ "{"
statements
call_expression
navigation_expression
super_expression
super "super"
navigation_suffix
. "."
simple_identifier "deleteBackward"
call_suffix
value_arguments
( "("
) ")"
call_expression
simple_identifier "onKeyPress"
?
? "?"
call_suffix
value_arguments
( "("
value_argument
line_string_literal
" "\""
line_str_text "backspace"
" "\""
) ")"
assignment
directly_assignable_expression
simple_identifier "text"
= "="
line_string_literal
" "\""
" "\""
} "}"
function_declaration
modifiers
member_modifier
override "override"
func "func"
simple_identifier "insertText"
( "("
parameter
simple_identifier "_"
simple_identifier "text"
: ":"
user_type
type_identifier "String"
) ")"
function_body
{ "{"
statements
call_expression
navigation_expression
super_expression
super "super"
navigation_suffix
. "."
simple_identifier "insertText"
call_suffix
value_arguments
( "("
value_argument
simple_identifier "text"
) ")"
if_statement
if "if"
equality_expression
simple_identifier "text"
== "=="
line_string_literal
" "\""
str_escaped_char "\\n"
" "\""
{ "{"
statements
call_expression
simple_identifier "onKeyPress"
?
? "?"
call_suffix
value_arguments
( "("
value_argument
line_string_literal
" "\""
line_str_text "enter"
" "\""
) ")"
} "}"
assignment
directly_assignable_expression
navigation_expression
self_expression
self "self"
navigation_suffix
. "."
simple_identifier "text"
= "="
line_string_literal
" "\""
" "\""
} "}"
} "}"
class_declaration
class "class"
type_identifier "Coordinator"
class_body
{ "{"
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "textField"
= "="
call_expression
simple_identifier "KeyboardHackTextField"
call_suffix
value_arguments
( "("
) ")"
} "}"
function_declaration
func "func"
simple_identifier "makeCoordinator"
( "("
) ")"
-> "->"
user_type
type_identifier "Coordinator"
function_body
{ "{"
statements
call_expression
simple_identifier "Coordinator"
call_suffix
value_arguments
( "("
) ")"
} "}"
function_declaration
func "func"
simple_identifier "makeUIView"
( "("
parameter
simple_identifier "context"
: ":"
user_type
type_identifier "Context"
) ")"
-> "->"
user_type
type_identifier "UIView"
function_body
{ "{"
statements
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "container"
= "="
call_expression
simple_identifier "UIView"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "frame"
: ":"
prefix_expression
. "."
simple_identifier "zero"
) ")"
property_declaration
value_binding_pattern
let "let"
pattern
simple_identifier "tf"
= "="
navigation_expression
navigation_expression
simple_identifier "context"
navigation_suffix
. "."
simple_identifier "coordinator"
navigation_suffix
. "."
simple_identifier "textField"
assignment
directly_assignable_expression
navigation_expression
simple_identifier "tf"
navigation_suffix
. "."
simple_identifier "isHidden"
= "="
boolean_literal
true "true"
assignment
directly_assignable_expression
navigation_expression
simple_identifier "tf"
navigation_suffix
. "."
simple_identifier "keyboardType"
= "="
prefix_expression
. "."
simple_identifier "default"
assignment
directly_assignable_expression
navigation_expression
simple_identifier "tf"
navigation_suffix
. "."
simple_identifier "onKeyPress"
= "="
lambda_literal
{ "{"
lambda_function_type
lambda_function_type_parameters
lambda_parameter
simple_identifier "key"
in "in"
statements
call_expression
navigation_expression
navigation_expression
simple_identifier "LiquidTabsPlugin"
navigation_suffix
. "."
simple_identifier "shared"
?
? "?"
navigation_suffix
. "."
simple_identifier "notifyKeyboardHackKey"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "key"
: ":"
simple_identifier "key"
) ")"
} "}"
call_expression
navigation_expression
simple_identifier "container"
navigation_suffix
. "."
simple_identifier "addSubview"
call_suffix
value_arguments
( "("
value_argument
simple_identifier "tf"
) ")"
control_transfer_statement
return "return"
simple_identifier "container"
} "}"
function_declaration (+88 nodes collapsed)
} "}"
comment "// MARK: - Root Tabs View (dispatch to 26+ vs 16–25)"
class_declaration (+77 nodes collapsed)
comment "// MARK: - Shared selection helpers"
class_declaration (+21 nodes collapsed)
class_declaration (+210 nodes collapsed)
comment "// MARK: - iOS 26+ implementation using Tab(...) API + searc"...
class_declaration (+1452 nodes collapsed)
comment "// Search host for 26+ (unchanged)"
class_declaration (+327 nodes collapsed)
comment "// MARK: - iOS 16–25 implementation"
comment "// Classic TabView + .tabItem; Search tab shows a custom sea"...
class_declaration (+900 nodes collapsed)
class_declaration (+420 nodes collapsed)