Skip to content

Add a View Cards app that shows a view as a card - #32466

Draft
FelixMalfait wants to merge 4 commits into
felix/wizardly-sagan-upeo1x-find-view-filtersfrom
felix/wizardly-sagan-upeo1x-show-view
Draft

FelixMalfait wants to merge 4 commits into
felix/wizardly-sagan-upeo1x-find-view-filtersfrom
felix/wizardly-sagan-upeo1x-show-view

Conversation

@FelixMalfait

@FelixMalfait FelixMalfait commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Stack (MCP Apps, Twenty as an MCP Apps server), merge in order: 1. runtime → 2. resources → 3. tool binding → 4. generic mode → 5. findMany through a view → 6. View Cards app.

What

Adds a public app, View Cards (packages/twenty-apps/public/view-cards). Its show-view tool, exposed over MCP as app_show_view, displays a view's first records as a card in Twenty's AI chat and in MCP Apps hosts such as Claude:

  • the view's visible columns, in order and at their width;
  • each value displayed as its field type is in the record table;
  • record chips that open the record in Twenty;
  • an "Open view" button.

How

  • The tool reads nothing; it only echoes the view id. The card loads the view with the reader's access, through view_id on REST find-many (Add Navbar on Application #5 in the stack), so the server applies the view's filters, search and sorts. The card shows only what that member can see.
  • No new components or UX patterns. The card is built from existing twenty-ui primitives (Chip, Avatar, Tag, Button, Skeleton, OverflowingTextWithTooltip) and laid out like the call recorder's meeting card. It follows DESIGN.md:
    • the canonical view icon;
    • dates without times;
    • compact counts;
    • +N for chip lists;
    • 14px icons in cells;
    • a single tertiary row for an empty table.
  • Nothing changes in core.

Verified end to end

I built the server and CLI from this stack and ran them locally the way the local CI job does. Results:

  • yarn test passes: it installs the app and checks that the tool is bound to a non-headless card.
  • Calling /mcp as a member:
    • tools/list shows app_show_view with _meta.ui.resourceUri;
    • resources/read returns the text/html;profile=mcp-app document with its CSP;
    • the session tool mints a token.
  • In an ext-apps AppBridge test host:
    • the card renders All Companies, All People and All Opportunities in light and dark themes and at 420px wide;
    • "Open view" opens /objects/companies?viewId=… and a record chip opens /object/company/{id} through openLink.
  • Unit tests (15), lint and typecheck pass.

Notes

  • Requires Twenty 2.68 (engines.twenty >=2.68.0), since it depends on the rest of the stack. The app pins the published 2.67.0 SDKs, as its siblings do. Its dockerhub-latest integration job will fail until 2.68 ships; the local job runs this branch.
  • Whether to pre-install the app on cloud workspaces is an ops decision and is not part of this PR.
  • Logic-function tool results are wrapped as { success, message, result }. The card therefore reads the tool input rather than the output, which also lets it start loading before the function returns.

https://claude.ai/code/session_01BC19MT31DvLYvxzeBBUKWi


Generated by Claude Code

The `show-view` tool, exposed over MCP as `app_show_view`, displays a
view's first records as a card in Twenty's AI chat and in MCP Apps
hosts such as Claude: the view's visible columns in order and at their
width, each value displayed as its field type is in the record table,
record chips that open the record in Twenty, and an "Open view" button.

- The tool reads nothing. The card loads the view with the access of
  the member reading it, through `view_id` on REST find-many, so the
  server applies the view's filters, search and sorts and the card only
  shows what that member can see.
- Built from existing twenty-ui primitives (Chip, Avatar, Tag, Button,
  Skeleton, OverflowingTextWithTooltip), laid out like the call
  recorder's meeting card, and following DESIGN.md: dates without
  times, compact counts, `+N` for chip lists, a single tertiary row
  for an empty table.
- Requires Twenty 2.68, which serves front components as MCP Apps and
  lets find-many read records through a view.
@socket-security

socket-security Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​types/​react@​19.3.31001007994100
Addednpm/​@​types/​node@​24.19.41001008195100
Addednpm/​twenty-ui@​2.67.09610090100100

View full report

Copy link
Copy Markdown
Member Author

view-cards (dockerhub-latest) fails as expected. The published image is 2.67, and the app requires 2.68, which the rest of this stack provides:

App apply failed: GRAPHQL_ERROR App requires Twenty server >=2.68.0 but this workspace has only completed the upgrade to 2.67.0.

That job will pass once 2.68 is on Docker Hub. The local job builds the server from this branch and is the one that exercises the app here. Stacked PRs don't get the main CI, so I dispatched CI Twenty Apps on this branch manually.


Generated by Claude Code

@twenty-ci-bot-public

twenty-ci-bot-public Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

🚀 Preview Environment Ready!

Your preview environment is available at: https://suse-elizabeth-tracking-princeton.trycloudflare.com

This environment will automatically shut down after 5 hours.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant