Mastersam07 / Mastersam07/kaisel

docs: make the chromeBuilder router-resolution rule harder to trip on

Open
#74 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation good first issue pkg:kaisel
Dominant language
Dart
Stars
69
Forks
2
Avg merge
18m
Merged PRs (30d)
9

Description

SHELLS.md already documents this and the reasoning is sound: each branchs `RouterScope` is installed *inside* its branch, which is a descendant of the chrome, and context lookups only walk upward — so `context.router()` cannot resolve from `chromeBuilder`.

What makes it easy to trip on anyway is that the neighbouring call **does** work: `context.router()` resolves fine from the chrome, because the main router sits above the shell. So within a few lines of the same builder, one typed router lookup succeeds and another fails — and the failure is a runtime lookup miss, not a compile error.

Building a bottom bar in the chrome that needs both "push a full screen on the root stack" (works) and "read the active branchs stack" (does not) is a natural thing to reach for.

## Suggestion

Either or both:

* make the assertion message name the fix directly — something like *"`context.router()` is not available in chromeBuilder; use `context.shell()` for branch state, or `context.router()` for the main stack"*;
* pass the shell controller into `chromeBuilder` as an explicit argument alongside `activeBranch` / `switchBranch`, so the correct accessor is in scope rather than something to remember.

The existing prose is accurate; this is about turning a documented gotcha into something the API or the error message prevents.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read SHELLS.md first, then inspect chromeBuilder and the existing typed router lookup and assertion path. Decide whether the API or assertion should make the branch-state accessor explicit, and verify that a chromeBuilder can still access the root router while the intended branch-state path is clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.