Fabricator

Live preview

Use the preview pane to watch your app change as Copilot works, see it on this computer or as published, preview it as other people, and handle busy preview ports.

The preview pane shows your Rayfin app while you build: your app running on this computer, with its own backend and data, and once the app is published, your published app.

The preview toolbar above the running app: back, forward and reload, the app's address, and the toolbar's buttons on the right.

What the preview shows

The preview shows your app as it runs on this computer. See Your app on this computer. Once the app is published, Local and Published switch between it and your published app.

A published app that this computer can't run previews against its published backend instead, with two preview sources. See What runs only on Fabric.

  1. The local preview, at a localhost address: your app's pages from this computer, when the project has Vite installed under node_modules. Fabricator starts the project's own Vite server directly. It doesn't need an npm run dev script. While Publish after each chat turn is off, the default, the local preview runs whenever the app is open, and reloads when a turn that changed your app ends. While it's on, the local preview runs only while Copilot is working. See Publish after each chat turn.
  2. The published app, when the local preview isn't running. After a successful turn, Fabricator publishes the changes when Publish after each chat turn is on, and reloads the preview. The app's state, such as live, publishing or failed, is on the publish control in the app bar.

The local preview uses the published app's VITE_* configuration, so it runs against the published app's backend: frontend changes show as Copilot makes them, and changes to data, permissions or functions work once you publish them. If the project has no local Vite installation, Fabricator keeps showing the published app instead.

A team app's preview works the same way: your app on this computer, and once the team has published it, Local and Published, where Published is the published app that everyone on the team uses. A team app that this computer can't run uses the team's deployment of it in Fabric instead. See Work on a team app.

Your app on this computer

The preview shows your app as it runs on this computer, at a localhost address, with its own backend and data. Copilot's edits show up as it saves them. When the backend rebuilds something the page uses, such as the data model or the functions, the page loads again, after Copilot's turn when one is running. See Develop on this computer.

The preview of Contoso Expenses running on this computer: the toolbar with Local and Published, the Running status, Preview as You and localhost:5173, and Output open below the app with Restart, Copy and the latest lines from rayfin-local and Vite.

The toolbar adds:

  • Local and Published, once the app is published, with an info button beside them, About Local and Published. See Switch between Local and Published.
  • Preview as, to choose who the app signs in as. See Preview as someone else.
  • Output, which shows and hides the output of your app's backend, Vite and functions, in the Output tab of the terminal below your project. While your app runs as it should, the button has no dot. A blinking dot means your app is starting, and a red dot that it couldn't start. When your app runs but its latest change didn't apply, it shows an amber dot and the number of problems, such as 1 problem, and Output starts with what's wrong, for example "Your app’s latest data model change couldn’t be read, so it still uses the previous data model."

Output shows the latest output of your app's backend, Vite and functions, with the time and source of each line, warnings in yellow and errors in red, and the newest at the bottom. It follows new lines unless you scroll up. Select Copy output to copy it, for example for a bug report, or Restart app to stop your app's backend and Vite and start them again. See Your app's output.

While the app starts, the preview says what it's doing, such as "Reading your app’s data model", "Updating its database" or "Building its functions". If the app stopped, select Start.

Point & Edit works here, also while Copilot is working, so you can pick what to change next. Your app on this computer has no Fabric view: that's for published apps that need the Fabric portal. See Use the toolbar.

When your app doesn't start

When a problem stops your app on this computer, the preview says what went wrong and offers what helps:

You seeWhat helps
"Your app’s packages aren’t installed"Install dependencies installs them, with npm's output in Output, and starts your app again.
"This app is already running"Another program runs the app on this computer, such as rayfin-local in a terminal. Stop the other one stops it and runs your app here.
"Node.js isn’t installed" or "Node.js needs an update"Set up Node.js opens setup.
"This change would delete local data"Review the change opens the dialog. See When a data model change would delete local data.
"Your app couldn’t start on this computer", because Windows or macOS blocked the local backendLearn how to allow it opens the steps.

Every problem also offers Try again, View output, and Find out why, which opens Help to explain what happened. See Your app doesn't start on this computer.

Switch between Local and Published

Once an app is published, the toolbar has Local and Published:

  • Local shows your app on this computer, with its local data. The preview starts here.
  • Published shows your published app on Microsoft Fabric, with its data. Your changes reach it when you publish them.

Switching turns Point & Edit off, and your picks stay in the chat composer. In Published, Point & Edit works on the published app, and an app that works only inside the Fabric portal has Fabric, which shows it in the Fabric portal shell.

An app you published before it ran on this computer starts with empty local data, and its published app keeps its data. Until you select it or look at Published, the info button beside Local and Published is blue: select it for a short note on how the two differ.

When this computer can't run a published app, for example because it uses a KQL database connector, its preview uses the published app's backend and says why, and there's no Local and Published switch. See What runs only on Fabric.

Preview as someone else

Preview as chooses who your app on this computer signs in as in the preview: you, a test user, or no one. Use it to check what each person can see and do.

The Preview as menu open over Contoso Expenses on this computer: You, with the Microsoft Entra account it signs in as, two test users, Signed out, and Add test user…

  1. In the preview toolbar, select Preview as. The button shows who the app signs in as now: You, a test user's name, or Signed out.
  2. Choose who to sign in as:
    • You: your Microsoft Entra account from the Azure CLI or, when the Azure CLI isn't signed in, the Fabric account in use. When neither is signed in, a local account, developer@example.com.
    • A test user, under Test users.
    • Signed out: no one is signed in.
  3. To add a test user, select Add test user…, type an email address in Test user’s email, and select Add. The preview signs in as the new user.

Switching clears the preview's browser storage and reloads it, so the app signs in again as the person you chose. An app that doesn't sign in by itself shows its own sign-in button, such as Sign in with Microsoft: its sign-in window signs in as the person you chose without asking for a password, and closes. With Signed out, that window asks who to sign in as: a local account, a new one, or your own account.

Test users have no password: they sign in only here, through Preview as. They're local users of your app on this computer, so Blueprint's Data explorer lists them under Local users, where you can delete them. See See your app's local data.

Preview as is there in Local while your app runs and no chat turn is running.

Use the toolbar

The preview toolbar gives you browser-like controls and Fabricator-specific tools:

  • Back, Forward and Reload navigate the preview history.
  • The address shows what the preview is showing: your published app's, or localhost for an app running on this computer. Select it to open the page in your default browser.
  • For a team app, Published has a status label, such as Published, which says Publishing… while the team pipeline updates the published app. The preview of a team app that this computer can't run is marked Published data while it uses the published app's data.
  • Desktop, Tablet and Phone show your app at other screen widths. Desktop fills the pane, Tablet previews at 820 CSS pixels, and Phone previews at 390 by 844 CSS pixels inside a phone outline.
  • Point & Edit lets you pick parts of your app and clip screenshots of it, to show Copilot what to change. While the published app in the preview is publishing, it waits until publishing is done. See Point & Edit.
  • Fabric is there only for an app that works only inside the Fabric portal: one that reads semantic models through a fabric.yaml file, the classic way to connect them, whose models load only there, or one whose rayfin/rayfin.yml hosts it to open only inside Fabric. It switches the published app between the direct view and the Fabric portal shell, and such an app switches to the Fabric view the first time it's published. It's turned off when the published app has no portal link, and while a local preview runs. Other apps, including ones that connect to Fabric data through Rayfin connectors, don't need it, so they don't have the button, and neither does your app on this computer.
  • Focus hides the chat and gives the preview more room. Exit focus shows the chat again.

Note

Browser devtools are available from the native preview's webview, not as a separate toolbar button in the current PreviewPane source.

Zoom and display scale

The preview tracks Fabricator's UI scale and the browser surface's pixel ratio. That matters when you move Fabricator between monitors or change display scaling: the native preview is resized and repositioned to stay aligned with its pane.

The Tablet and Phone widths account for Fabricator's UI scale, so they still represent the app's CSS width instead of the physical monitor width.

Sign in inside the preview

Signing in to the published app is separate from Fabricator's Fabric CLI session. The app preview has its own browser session and cookies. If the app opens a Fabric or Microsoft Entra sign-in popup, Fabricator lets the preview browser handle that popup.

In apps created from the Universal App template, a preview at a localhost address signs you in automatically when the app uses sign-in, so a chat turn doesn't stop at the app's sign-in page:

  • Your app on this computer signs in as the person you chose in Preview as: you, to start with.
  • The local preview of a published app that this computer can't run signs in with the Fabric account that Fabricator publishes with.

The published app doesn't include this and still asks you to sign in. Rayfin describes how it works in Local automatic sign-in.

Older apps need Rayfin 1.36 or newer for this. See Rayfin versions. To add it to an older app, paste this prompt:

PromptSign in automatically in the local preview
Make the local preview sign me in automatically with my Rayfin CLI account. Add @microsoft/rayfin-local-dev at the same version as the app's other Rayfin packages, register rayfinLocalDev({ autoLogin: true }) in vite.config.ts, and set externalEntraExchange: true under services.auth.fabric in rayfin/rayfin.yml. When the app starts in development without a saved session, get the local session token and sign in with signInWithBrokeredToken(). Keep that code behind import.meta.env.DEV with a dynamic import so production builds don't include it.

Refreshing Fabricator's Fabric authentication affects the Rayfin CLI credentials Fabricator publishes with. It does not sign the preview browser in or out.

When every preview port is busy

A local preview of an app that this computer can't run uses the app's backend in Fabric: the published app's, or for a team app, the team's deployment of it. It must use a localhost port your app accepts for sign-in. Fabricator first tries the registered http://localhost:N ports from rayfin/rayfin.yml.

If another app's local backend holds the port and Copilot isn't working on that app, Fabricator stops that backend and uses the port. The backend starts again when you open that app. Otherwise, you see a dialog titled like "Your live preview needs localhost:5173". It says in plain words what is using the port, and offers one-click choices:

  1. Stop that preview, Stop the earlier preview, Stop the dev server, Stop with the name of an app or a program, or Stop that program when Fabricator can't tell which program it is. Fabricator stops it, then uses the original port. Stopping a preview or a dev server loses nothing. Stopping a program, such as node.exe, loses anything unsaved in it.
  2. Use localhost:N instead. Fabricator adds http://localhost:N to rayfin/rayfin.yml. If the app is already published, it also pushes the sign-in setting to Fabric without rebuilding the app. Otherwise, the port is registered for sign-in the next time you publish.
  3. Skip live preview. Fabricator skips the local Vite preview for this turn. You can keep chatting, and the published app shows in the preview after the turn.

Fabricator marks a choice that loses nothing as Recommended. The process it found is under Technical details.

If switching ports would require a push while Copilot is already working, the dialog explains that it can't happen during the turn and asks you to skip for now.

For recovery steps, see All preview ports are busy.

Something wrong on this page?Edit this pageReport an issue with this page

Fabricator is a personal project by Sachin Patney. It is not a Microsoft product and is not affiliated with, endorsed by, sponsored by, or supported by Microsoft.

GitHubMIT LicenseReleasesYouTubeDocumented for Fabricator 1.67.2

On this page