# What Does `display: true` vs `display: false` Do in i-have-adhd Custom Messages?

> Understand display: true vs display: false in i-have-adhd custom messages. Learn how to control message visibility for users and internal logic to optimize your chatbot.

- Repository: [Ayoub Ghriss/i-have-adhd](https://github.com/ayghri/i-have-adhd)
- Tags: deep-dive
- Published: 2026-08-19

---

**In the `i-have-adhd` repository, `display: true` makes a custom message visible to the user, while `display: false` keeps it internal for agent logic and never renders it in chat.**

The `i-have-adhd` project, as implemented in `ayghri/i-have-adhd`, lets agents emit custom messages during conversations using structured objects defined in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts). Each message carries a boolean `display` property that the runtime evaluates to decide whether the text reaches the end-user. Understanding this flag is critical for separating user-facing dialogue from silent internal bookkeeping.

## How the `display` Property Controls Visibility

According to the source code in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts), the agent evaluates the `display` field before pushing content to the outbound message queue.

### `display: true` Sends Text to the User

When a custom message has `display: true`, the runtime includes it in the visible conversation. The source logic checks the flag with a simple conditional:

```ts
if (msg.display) {
  // push the text onto the outbound message queue
  output.push(msg.text);
}

```

Because the value is truthy, `msg.text` is appended to `output` and eventually delivered to the user interface.

### `display: false` Suppresses Output for Internal Use

When `display` is set to `false`, the condition fails and the text is withheld from the outbound queue. The message object remains in the agent’s internal state, so it can still influence branching, logging, or later decisions, but it never appears in the chat window.

## Practical Examples of Custom Message Configuration

Below are concrete configurations showing how the flag affects behavior in `i-have-adhd` custom messages.

### Silent Internal Message

Use `display: false` when the text is meant only for agent tracking. In [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts), a hidden reminder is defined as:

```ts
{
  id: "reminder-break",
  text: "Take a short break now 🧘‍♀️",
  display: false,   // ← will not appear unless you set this to true
}

```

Another internal-only tracker uses the same flag:

```ts
{
  id: "track-focus",
  text: "User has been focused for 45 minutes.",
  display: false,   // Not sent to the user
}

```

In both cases, the record exists internally but the user never sees it.

### Visible User-Facing Message

Use `display: true` when the agent should explicitly communicate with the user:

```ts
{
  id: "encourage-break",
  text: "You’ve been working hard—how about a 5-minute stretch break?",
  display: true,    // Shown to the user
}

```

This message is pushed to `output` and rendered in the chat.

### Runtime Toggle

You can also flip the flag dynamically based on conversation state:

```ts
// Suppose we decide to make a reminder visible after a certain condition
const reminder = customMessages.find(m => m.id === "track-focus");
if (reminder) {
  reminder.display = true;           // Now it will be shown
}

```

After this change, subsequent evaluations pass the `if (msg.display)` check and expose the text.

## Key Source Files in the Repository

The custom-message behavior is defined in the following files within `ayghri/i-have-adhd`:

- **[`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts)** — Defines the custom-message objects and implements the `if (msg.display)` evaluation that controls the outbound queue.
- **[`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md)** — Documents the ADHD-friendly response rules and how custom messages factor into agent behavior.
- **[`README.md`](https://github.com/ayghri/i-have-adhd/blob/main/README.md)** — Describes repository setup and explains how custom messages integrate with the agent’s conversation loop.

## Summary

- **`display: true`** in `i-have-adhd` custom messages adds the message text to the outbound queue, making it visible to the user in chat.
- **`display: false`** keeps the message object internal, preventing it from reaching the user while still allowing agent-side logic to reference it.
- The runtime filter lives in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts) and uses a truthy check on `msg.display` before calling `output.push(msg.text)`.
- You can toggle this flag at runtime to change a message from silent tracking to visible feedback.

## Frequently Asked Questions

### Can a message with `display: false` ever become visible later?

Yes. If you update the property to `true` at runtime—such as by finding the message object and setting `reminder.display = true`—the next evaluation will pass the `if (msg.display)` check. Once the flag is truthy, the agent pushes the text into the outbound queue. The user then sees the message in the conversation.

### Does `display: false` delete the message from the agent's memory?

No. Setting `display: false` only blocks the text from being added to the output array. The full message object remains in the agent's state and can still be queried, logged, or modified by other logic in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts). It simply never reaches the chat window.

### What happens if I omit the `display` property entirely?

Because the runtime checks `if (msg.display)`, omitting the property produces an `undefined` value. In TypeScript, `undefined` is falsy, so the behavior matches `display: false`. The message stays internal unless you explicitly set the flag to `true`.

### Where is the `display` logic implemented in the source code?

The flag evaluation lives in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts). Inside that file, the code iterates over custom messages and conditionally runs `output.push(msg.text)` only when `msg.display` is truthy. This single check determines whether a message reaches the user.