feat: [] Make Closest Preview preview field configurable - #10728
Open
Mitch Goudy (mgoudy91) wants to merge 2 commits into
Open
feat: [] Make Closest Preview preview field configurable#10728Mitch Goudy (mgoudy91) wants to merge 2 commits into
Mitch Goudy (mgoudy91) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for configuring which field ID “Closest Preview” uses to determine whether an entry is previewable (defaulting to slug for backwards compatibility).
Changes:
- Add a “Preview field id” input to the Config Screen and persist it as an installation parameter.
- Use the configured field id when filtering eligible content types and when identifying “root” entries in the Sidebar.
- Extend mocks/tests to cover both default (
slug) and custom (e.g.url) field ids.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/closest-preview/src/locations/ConfigScreen.tsx | Adds UI + persistence for configurable preview field id and passes it into content type filtering. |
| apps/closest-preview/src/components/ContentTypeMultiSelect.tsx | Threads slugFieldId into content type filtering and updates effect deps/defaults. |
| apps/closest-preview/src/utils/livePreviewUtils.ts | Makes slug-field checks configurable in content type filtering + root entry detection. |
| apps/closest-preview/src/types.ts | Introduces installation parameter type and default slug field id constant. |
| apps/closest-preview/test/locations/ConfigScreen.spec.tsx | Expands tests to cover loading/saving custom preview field id and filtering behavior. |
| apps/closest-preview/test/locations/Sidebar.spec.tsx | Adds coverage for Sidebar behavior when preview field id is customized. |
| apps/closest-preview/test/mocks/mockSdk.ts | Adds installation parameters to the SDK mock. |
| apps/closest-preview/test/mocks/mockCma.ts | Adds url field + data to support custom field id tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Mitch Goudy (mgoudy91)
force-pushed
the
codex/closest-preview-configurable-slug-field
branch
from
March 20, 2026 19:20
325a060 to
0b04e62
Compare
Harika Kondur (harikakondur)
approved these changes
Mar 23, 2026
Joaquin (joaquincasal)
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a configurable installation parameter for the field id Closest Preview uses to identify previewable page entries, while keeping \ as the default so existing installs remain unchanged.
Staging link
Changes
Testing