# The bottom panel: Outline and AI

The bottom panel has **five pages**. The word on the left tells you **which one you are on**:

| Page | What it holds |
|---|---|
| **Problems** | Errors and warnings from compiling and checking — **tap one to jump to that line** |
| **Output** | What the program prints once it runs; if it needs keyboard input, a send box appears here |
| **Find** | Find and replace (case / whole word / regex toggles; replace-all is one undo step). The **scope** can be **this file** or **the whole project** |
| **Outline** | The functions and symbols in this file — **tap one to jump there** |
| **AI** | Ask about **this file**, or have it change the code |

The two on the far right: **⋮** is the page menu, **✕** closes the panel.
The terminal icon at the far right of the status bar **opens / closes the panel** (that is how you bring it back).

## The tabs give way by themselves

When the screen is narrow (**landscape especially**) the tab row cannot hold five icons — it puts
**the ones that do not fit into the `⋮` menu on the right**, and **when they all fit that `⋮` is not shown at all**.
The panel width is something you drag yourself, so this is computed from the **actual width**, not from
whether you are in portrait or landscape.

The name of the current page always stays on the **left**, so even if you do not recognise an icon
you still know where you are.

## Find: this file, or the whole project

The right-most icon on the **Find** page is the **scope** toggle — tap it to switch:

| Icon | Scope | What it lists |
|---|---|---|
| 📄 | **This file** (default) | Hits inside the current file. They are **highlighted** in the text; tap a row to jump there |
| 📁 | **Whole project** | Hits across **every file in the workspace**, each row shaped like `path:line　text`. **Tap a row to open that file and jump to that line** |

The "whole project" scope is for questions like "**where is this function called from?**" — no more opening
files one by one.

Two things to know:

- It uses **the same rules as the AI's search** (the same directories such as `node_modules` and `.git`
  are skipped), so anything that search cannot find, this cannot find either.
- The **whole word** and **case** toggles only take **approximate** effect in the "whole project" scope
  (they are folded into the search expression); in the "this file" scope they are applied strictly.

## Outline: function signatures at a glance

The **Outline** page lists the functions and types in this file, each with its **parameter list and
return type**:

```
ƒ add(int a, int b) → int        L1
ƒ main(void) → int               L20
```

Tap one to jump to that line — in a long file this beats scrolling by hand.
The text is **syntax-highlighted** with **the same colours as the code itself**, so keywords stand out
at a glance.

It scans **what is in the editor right now** (**unsaved edits included**), so a function you just wrote
is already there. It rescans only **when you switch to this page** — rescanning on every keystroke
would bog down on large files.

> ⚠ A file too large to edit opens **read-only**; there is nothing to analyse, and the page says so
> instead of showing you an empty list.

## AI: ask about this file, or have it edit

The **AI** page is a conversation that uses **the whole file** as context — you can **ask first, then change**:

- **Ask** — questions only. "What is this while loop doing?", "Where is this function called?"
- **Edit** — have it change the code. It first returns the **complete new file**, then shows you a **diff**:
  tap **Apply** to actually write it (**one undo step**), or **Cancel** to leave everything untouched.

The conversation is **kept per file**: switching to another file starts a new one, and switching back
brings the old one back.

> ⚠ It sends the **whole file** every time — very large files take longer.
> **Ask** and **Edit** are **two separate buttons**: you will never "only ask a question and get a diff".
> While it is working the buttons turn into **■ Stop**, so you can interrupt at any time.
