Skip to content

Commit 9da5bfb

Browse files
committed
Polish mobile text entry: commit button, keyboard-aware placement, code kind.
1 parent a318d7c commit 9da5bfb

8 files changed

Lines changed: 83 additions & 37 deletions

File tree

.efrocachemap

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### 1.8.0 (build 22988, api 9, 2026-08-19)
1+
### 1.8.0 (build 22989, api 9, 2026-08-19)
22
- Fully implemented asset packages (more on this soon)
33
- App-config committing (dirty-tracking, debounced disk writes, and
44
suspend/shutdown flushes) now lives fully in `babase` instead of routing

pconfig/projectconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"bauiv1lib": "buil"
2424
},
2525
"efrocache_repository_url": "https://files.ballistica.net/cache/ba1",
26-
"engine_build_number": 22988,
26+
"engine_build_number": 22989,
2727
"name": "BallisticaKit",
2828
"public": true,
2929
"python_paths": [
@@ -43,5 +43,5 @@
4343
"tests",
4444
"config"
4545
],
46-
"version": "1.8.0a93"
46+
"version": "1.8.0a94"
4747
}

src/assets/ba_data/python/babase/_stringedit.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ class StringEditKind(Enum):
3636
#: chrome around the field.
3737
CHAT = 'chat'
3838

39+
#: Source code or a command line. Edit UIs should turn off
40+
#: autocorrection, autocapitalization and smart punctuation, all of
41+
#: which corrupt code (smart quotes alone are a syntax error), and
42+
#: should treat their action key as 'run': a commit from it carries
43+
#: through to the target's return-press behavior, while a commit
44+
#: from tapping away just fills the value in.
45+
CODE = 'code'
46+
3947

4048
class StringEditSubsystem:
4149
"""Full string-edit state for the app.

src/assets/ba_data/python/babase/_ui.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from typing import TYPE_CHECKING, override
66

7-
from babase._stringedit import StringEditAdapter
7+
from babase._stringedit import StringEditAdapter, StringEditKind
88
import _babase
99

1010
if TYPE_CHECKING:
@@ -20,14 +20,25 @@ def __init__(self) -> None:
2020
max_length = None
2121
screen_space_center = None
2222
super().__init__(
23-
description, initial_text, max_length, screen_space_center
23+
description,
24+
initial_text,
25+
max_length,
26+
screen_space_center,
27+
kind=StringEditKind.CODE,
2428
)
2529

2630
@override
2731
def _do_apply(self, new_text: str) -> None:
2832
_babase.set_dev_console_input_text(new_text)
2933
_babase.dev_console_input_adapter_finish()
3034

35+
@override
36+
def _do_submit(self) -> None:
37+
# Runs after _do_apply, so the line we run is the one just
38+
# typed. Tapping away from the editor applies without
39+
# submitting, which fills the input in without running it.
40+
_babase.dev_console_exec()
41+
3142
@override
3243
def _do_cancel(self) -> None:
3344
_babase.dev_console_input_adapter_finish()

src/assets/ba_data/python/baenv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555

5656
# Build number and version of the ballistica binary we expect to be
5757
# using.
58-
TARGET_BALLISTICA_BUILD = 22988
59-
TARGET_BALLISTICA_VERSION = '1.8.0a93'
58+
TARGET_BALLISTICA_BUILD = 22989
59+
TARGET_BALLISTICA_VERSION = '1.8.0a94'
6060

6161

6262
@dataclass

src/ballistica/base/python/methods/python_methods_base_1.cc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,6 +1873,32 @@ static PyMethodDef PyDevConsoleInputAdapterFinishDef = {
18731873
":meta private:\n",
18741874
};
18751875

1876+
// -------------------------- dev_console_exec ---------------------------------
1877+
1878+
static auto PyDevConsoleExec(PyObject* self) -> PyObject* {
1879+
BA_PYTHON_TRY;
1880+
BA_PRECONDITION(g_base->InLogicThread());
1881+
auto* console = g_base->ui->dev_console();
1882+
BA_PRECONDITION(console);
1883+
console->Exec();
1884+
Py_RETURN_NONE;
1885+
BA_PYTHON_CATCH;
1886+
}
1887+
1888+
static PyMethodDef PyDevConsoleExecDef = {
1889+
"dev_console_exec", // name
1890+
(PyCFunction)PyDevConsoleExec, // method
1891+
METH_NOARGS, // flags
1892+
1893+
"dev_console_exec() -> None\n"
1894+
"\n"
1895+
":meta private:\n"
1896+
"\n"
1897+
"Run the dev console's current input, exactly as its Exec button\n"
1898+
"and the return key do. Used by the platform string editor to make\n"
1899+
"a submit-style commit run the line instead of just filling it in.\n",
1900+
};
1901+
18761902
// -------------------------- audio_shutdown_begin -----------------------------
18771903

18781904
static auto PyAudioShutdownBegin(PyObject* self) -> PyObject* {
@@ -2067,6 +2093,7 @@ auto PythonMethodsBase1::GetMethods() -> std::vector<PyMethodDef> {
20672093
PyGetDevConsoleInputTextDef,
20682094
PySetDevConsoleInputTextDef,
20692095
PyDevConsoleInputAdapterFinishDef,
2096+
PyDevConsoleExecDef,
20702097
PyAudioShutdownBeginDef,
20712098
PyAudioShutdownIsCompleteDef,
20722099
PyGraphicsShutdownBeginDef,

src/ballistica/shared/ballistica.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ auto main(int argc, char** argv) -> int {
5151
namespace ballistica {
5252

5353
// These are set automatically via script; don't modify them here.
54-
const int kEngineBuildNumber = 22988;
55-
const char* kEngineVersion = "1.8.0a93";
54+
const int kEngineBuildNumber = 22989;
55+
const char* kEngineVersion = "1.8.0a94";
5656
const int kEngineApiVersion = 9;
5757

5858
#if BA_MONOLITHIC_BUILD

0 commit comments

Comments
 (0)