[Bug]: MCP App inline frames never go below 80px, so compact apps get blank space under them

Ouverte Adaptée aux débutants
#35,911 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
Une demi-journée
Accessibilité débutants
68/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
typescript
Domaine
frontend

Piste de recherche

Commence par clampMcpAppHeight dans packages/shared/src/mcpApp.ts, puis examine comment McpAppFrame.tsx et mcpAppInlineHeight côté mobile utilisent ce clamp. Vérifie les tests associés avant de modifier le comportement de la hauteur minimale. C'est terminé lorsqu'une hauteur signalée de 48px peut afficher des applications inline compactes sans le plancher actuel de 80px, et que la valeur par défaut s'applique toujours avant qu'une taille ne soit signalée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/web

Steps to reproduce
  1. Connect an MCP server whose tool declares an MCP App (_meta.ui.resourceUri → text/html;profile=mcp-app).
  2. Make the app render a compact single-row view (for example a one-line "receipt" of the tool call, about 40–50px tall) and report it after ui/notifications/initialized:
    { "jsonrpc": "2.0", "method": "ui/notifications/size-changed", "params": { "height": 48 } }
    
  3. Have the agent call the tool a few times in a row so several app cards stack in the timeline.
Expected behavior

The inline iframe follows the height the app reports (48px here), so a series of one-line cards stacks tightly, like normal tool-call rows.

Actual behavior

Every inline iframe is at least 80px tall. The app's content sits at the top and the rest stays blank, so each card carries roughly 30–40px of empty space under it and a run of tool calls is spread far apart.

The floor comes from clampMcpAppHeight in packages/shared/src/mcpApp.ts:

const MCP_APP_MIN_HEIGHT = 80;
export const MCP_APP_DEFAULT_HEIGHT = 320;

export function clampMcpAppHeight(height: number): number {
  if (!Number.isFinite(height)) return MCP_APP_DEFAULT_HEIGHT;
  return Math.round(Math.min(MCP_APP_MAX_HEIGHT, Math.max(MCP_APP_MIN_HEIGHT, height)));
}

McpAppFrame.tsx applies it to every size-changed (setHeight(clampMcpAppHeight(size.height))), and mobile's mcpAppInlineHeight uses the same clamp. The app has no way to get below 80px; centering the content in the frame only moves the blank space around.

A floor makes sense before the app has reported anything (the 320px default covers that). Once an app has measured itself, a small floor (or none beyond a positive height) would let compact apps render at their real size.

Impact

Cosmetic issue

Version or commit

Desktop 0.1.9; source checked at main @ 6f108e8

Environment

macOS, T3 Code desktop app 0.1.9

Workaround

None on the app side. Apps can only make their content at least 80px tall to fill the frame.

Langage dominant
TypeScript
Étoiles
24.8k
Forks
6.4k
Merge moyen
59 min
PR mergées (30 j)
418

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de pingdotgg/t3code

Toutes les issues de pingdotgg/t3code

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.