Skip to content

Support targets with both active and inactive nodes in LHStackNode - #7

Merged
artyom-stv merged 2 commits into
masterfrom
feature/jm/IOS-11268-mixed-target-deactivation
Oct 19, 2026
Merged

artyom-stv merged 2 commits into
masterfrom
feature/jm/IOS-11268-mixed-target-deactivation

Conversation

@artyom-stv

Copy link
Copy Markdown
Contributor

Сейчас LHStackNode поддерживает target, у которого одновременно заданы activeNodes и inactiveNodes, только в узком случае: после снятия неактивных узлов вершиной стека должен оказаться сам активируемый узел. Например, [main, modal] + active = {main}, inactive = {modal}. В остальных случаях updateChildrenState: возвращает LHNodeUpdateResultInvalid. Кроме того, с вершины стека снимается ровно один узел, даже если неактивных узлов там несколько.

В данном PR такой target обрабатывается в два шага:

  1. С вершины стека снимается непрерывная серия узлов из inactiveNodes, каждый узел из множества — не более одного раза. Например, [root, a, b, c, b] с inactiveNodes = {b, c, d} превращается в [root, a, b]. Если на вершине нет неактивного узла, стек не меняется.
  2. Путь к активируемому узлу считается от новой вершины стека по обычным правилам, включая route hint.

Таким образом, [root, a, picker] с active = {result}, inactive = {picker} превращается в [root, a, result] за одно обновление. UINavigationController получает один setViewControllers:animated:, без отдельной анимации pop.

Обработка target'ов только с activeNodes или только с inactiveNodes не изменилась.

Добавлены тесты на новое поведение.

Artem Starosvetskiy added 2 commits October 19, 2026 17:12
Deactivate the contiguous run of inactive nodes at the top of the stack (each node once), then calculate the path to the active node from the new top.
@artyom-stv
artyom-stv merged commit a3f4acb into master Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant