Skip to content

Focus newly created sessions immediately#193

Merged
PureWeen merged 3 commits intomainfrom
fix-session-focus-on-create
Feb 24, 2026
Merged

Focus newly created sessions immediately#193
PureWeen merged 3 commits intomainfrom
fix-session-focus-on-create

Conversation

@rmarinho
Copy link
Copy Markdown
Collaborator

@rmarinho rmarinho commented Feb 23, 2026

Summary

  • make session switch detection work when there was no previous active session
  • ensure newly created sessions get the same selection/focus behavior as resumed sessions

Implementation

  • updated RefreshState in Dashboard.razor
  • changed switch detection from requiring non-null previous session to active != _lastActiveSession
  • kept guard that active must exist in current sessions list before applying focus/expanded updates

Validation

  • built Mac Catalyst target successfully (dotnet build -f net10.0-maccatalyst)

PureWeen added a commit that referenced this pull request Feb 23, 2026
## Summary

Two changes to improve the Squad-based PR review workflow.

### How to use

1. Click **+** in the sidebar → select **PR Review Squad** from "📂 From
Repo"
2. Click the **orchestrator** session
3. Send: `Review PRs #194, #193, #191, #192, #190`
4. The orchestrator assigns 1 PR per worker, each worker dispatches 5
sub-agents across different models, and the orchestrator produces a
summary table with verdicts

The mode is automatically set to **Orchestrator** via `mode:
orchestrator` in `team.md` — no manual mode selection needed.

### Example output

The orchestrator produces a summary table like:

| PR | Verdict | Key Issues |
|----|---------|------------|
| #194 | ⚠️ Needs changes | cursor:pointer without click handler,
brittle test regex |
| #193 | ⚠️ Needs changes | Incomplete state sync → infinite unthrottled
renders |
| #191 | ✅ Ready to merge | Clean — concerns were pre-existing patterns
|
| #192 | ⚠️ Needs changes | GC-finalization test unreliable, flaky IP
test |
| #190 | ⚠️ Needs changes | Tests don't guard actual regression |

Each worker's detailed report includes only issues flagged by 2+ models
(consensus filter), with file:line references and severity ratings.

---

### 1. Restructure PR Review Squad for multi-model consensus

Replaces 5 specialized reviewers (bug-hunter, security-analyst, etc.)
with 5 generic reviewers that each independently perform a full
multi-model consensus review.

Each worker:
1. Fetches the PR diff via `gh pr diff` / `gh pr view`
2. Dispatches 5 parallel sub-agent reviews across different models:
   - 2× `claude-opus-4.6` (deep bug analysis + architecture review)
   - 1× `claude-sonnet-4.6` (correctness + edge cases)
   - 1× `gemini-3-pro-preview` (security focus)
   - 1× `gpt-5.3-codex` (code quality + logic errors)
3. Synthesizes findings using a consensus filter (2+ models must flag an
issue)
4. Produces a severity-ranked report with file:line references and a
verdict

### 2. Support `mode:` field in team.md

`SquadDiscovery` now reads an optional `mode:` line from `team.md` to
set the multi-agent mode automatically. Previously hardcoded to
`OrchestratorReflect`.

Supported values: `broadcast`, `sequential`, `orchestrator`,
`orchestrator-reflect`

```markdown
# My Team
mode: orchestrator
```

### Tests
- 6 new tests for `ParseMode` covering all modes + case insensitivity +
default behavior
- All tests pass

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho and others added 3 commits February 24, 2026 14:40
Detect session switches even when no previous active session exists so new sessions are selected and focused immediately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When the active session is closed (active becomes null) while
_lastActiveSession still holds the previous session name, the new
sessionSwitched condition (active != _lastActiveSession) evaluates to
true but the focus block is correctly guarded by 'active != null' and
never executes. This left _lastActiveSession stale, causing every
subsequent RefreshState call to see sessionSwitched=true and
permanently bypass the 2/sec render throttle.

Add an else-if branch to sync _lastActiveSession to null in this case,
so the throttle is restored on the next refresh cycle.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Guard 300ms render cooldown + scroll flag with active != null so
  closing the last session doesn't delay the empty-state render
- Clear expandedSession and _focusedInputId in the session-close branch
  so stale UI state from the defunct session doesn't linger

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen force-pushed the fix-session-focus-on-create branch from a0a9f1c to f215518 Compare February 24, 2026 20:41
@PureWeen PureWeen merged commit 8e650f4 into main Feb 24, 2026
@PureWeen PureWeen deleted the fix-session-focus-on-create branch February 24, 2026 22:21
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.

2 participants