Skip to content

feat(trellis): choose where previews listen in Settings → Trellis - #23

Merged
Andrey170170 merged 4 commits into
dev_v2from
trellis-v2/c-preview-host
Oct 3, 2026
Merged

Andrey170170 merged 4 commits into
dev_v2from
trellis-v2/c-preview-host

Conversation

@Andrey170170

Copy link
Copy Markdown
Owner

Trellis v1 Stage C, Lane T3 step 3 part 2 (previews): choose where previews listen.

Change

  • Details: trellis.getDetails decodes preview_host {setting, bind, url_host} from /v1/status (Trellis Refresh upstream state after branch checkout and invalidate git queries pingdotgg/t3code#46). It defaults to null from an older Trellis, and then the section is hidden.
  • New RPC trellis.setPreviewHost {previewHost} (operate scope) calls PUT /v1/settings/previews with lan, tailscale or an IP address. It returns the new host and any previews that could not be bound again.
  • Settings → Trellis → Previews:
    • A select offers This machine (127.0.0.1), Local network, Tailnet, or Address… (an IP field).
    • The description says what each address means, including that the local network or tailnet exposes workspace servers with no T3 sign-in in front.
    • A save's answer shows at once; reads bring changes made elsewhere; an untouched address field never saves; a refused address reverts.
    • Rebind failures are listed in a warning toast. The success toast notes that previews already open keep their old address.
  • docs/user/trellis.md: one paragraph.

Limit

Previews already open in a browser panel keep the URL they resolved to; reopening them uses the new address. Re-resolving open tabs would need preview-panel work beyond this slice.

Checks

  • End-to-end against /trellis/dev-t3 (Trellis 479b13f):
    • This machine → Tailnet: binds 100.67.121.9, opened as peter-the-great.tail583f31.ts.net.
    • A change to lan made outside T3 showed after a refresh.
    • not-an-ip was refused, and the row went back to Local network.
    • Local network was saved and showed at once.
    • Address… with 127.0.0.1 was saved and shows as This machine.
    • The dev root is back on 127.0.0.1. Screenshots are kept locally in /tmp/stagec-ph/.
  • Tests: Trellis.test.ts covers decoding a status with preview_host, a set with rebind errors, and a refusal. TrellisSettings.logic.test.ts covers mapping between settings and choices.
  • Local CI: knip:check, vp check, vpr typecheck and release-smoke pass. t3 tests fail only on the known CodexInstallation and AcpSessionRuntime.processTree failures. Package tests fail only on the known desktop libsecret and snapshot file-mode failures; client-runtime, relay and mobile pass when run separately. build:desktop fails on the known libsecret helper.
  • Reviews:
    • Codex gpt-6.1-sol found stale controls after an external change, a refused address left showing, and the exposure wording; all fixed. It also found that open tabs keep the old address, which is left as the limit above.
    • Codex gpt-6-astra found a saved value reverting until the refresh and an untouched field overwriting an external change; both fixed.

🤖 Generated with Claude Code

Andrey170170 and others added 3 commits October 2, 2026 19:34
Trellis reports preview_host in /v1/status and changes it without a restart
(PUT /v1/settings/previews); Settings shows it and offers this machine,
the local network, the tailnet or an address, through a new
trellis.setPreviewHost RPC (operate scope).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…a refused address; say what LAN exposure means

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… field never saves

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T02:27:30.797075Z 29a99f9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Oct 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 29a99f961f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/user/trellis.md Outdated
the workspace is stopped), the preview shows an error rather than loading the host's port.
**Settings** > **Trellis** > **Previews** sets where those published ports listen: this machine
only (the default), the local network, the tailnet, or a given address, so other devices can open
them. Open previews move to the new address at once, under the same ports.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the documented behavior of open previews

This tells users that open previews move to the new address automatically, but the implemented flow explicitly leaves an open browser panel on its old URL and instructs the user to reopen it (TrellisSettings.tsx:494-497). After changing the bind address, that old URL can stop responding, so the guide should state that only newly opened or reopened previews use the new address.

AGENTS.md reference: AGENTS.md:L75-L75

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid: the guide now says Trellis moves its published ports at once while a preview already open keeps its old address until opened again, matching the toast. Fixed in 8db84c5.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Andrey170170
Andrey170170 merged commit 81d3ebd into dev_v2 Oct 3, 2026
8 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant