Skip to content

Frames v2: name a Frame after its source folder - #32795

Merged
davidebbo merged 1 commit into
mainfrom
frames-v2-name-projection
Sep 21, 2026
Merged

davidebbo merged 1 commit into
mainfrom
frames-v2-name-projection

Conversation

@davidebbo

@davidebbo davidebbo commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

First of five PRs making the source folder the single definition of a Frames v2 name.

A Frame's file is its manifest, so fileName is always manifest.json and the display name has to come from somewhere else. Today it comes from two places that can disagree: the file explorer labels a Frame with its source folder, while getFileDisplayName, Poke and the share page read useCaseMetadata.frameName, a copy of manifest.name that only publish refreshes.

This derives the name from the folder holding the manifest, at every point of use, and stores nothing. Deriving is what makes the two views agree by construction: the name cannot drift from the folder, and it follows a Frame that moves without anything having to refresh it.

getFileDisplayName now reads mountFilePath instead of the stored copy — four of its five callers already pass a FileResource, and the fifth (PodFrameSheet) is handed the Frame's path as a prop.

Contracts: adds frame-name-is-the-source-folder and frame-name-is-one-path-segment.

@vercel

vercel Bot commented Sep 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
playground Ignored Ignored Preview Sep 21, 2026 1:07pm UTC
storybook Ignored Ignored Preview Sep 21, 2026 1:07pm UTC

Request Review

@davidebbo
davidebbo requested a review from flvndvd September 21, 2026 10:20
@davidebbo

Copy link
Copy Markdown
Contributor Author

r? @flvndvd First PR for the rename change

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cc-verify: violations found!

  • frame-name-is-the-source-folder: Manifest naming and rename drift
  • frame-name-is-one-path-segment: Name limits bypassed

Findings and notifications outside the PR diff:

Source: front/lib/resources/file_resource.ts:1155

Pre-existing setActiveFramePublication violates the new frame-name-is-the-source-folder contract on getFrameV2NameFromMountFilePath (front/lib/api/frames/frame_name.ts): activation still passes descriptor.value.manifest.name into this write. Publishing a Frame registered from folder Health with manifest name Status overwrites its name to Status, undoing the new folder projection.


Source: front/types/api/frame_manifest.ts:74

The pre-existing required name field conflicts with the new frame-name-is-the-source-folder contract on getFrameV2NameFromMountFilePath (front/lib/api/frames/frame_name.ts), which forbids names in manifests. Registration and publication reject otherwise valid nameless manifests, making packages that follow the contract unusable.


Source: front/lib/api/projects/context.ts:722

The pre-existing Pod-folder rename path violates the new frame-name-is-the-source-folder contract on getFrameV2NameFromMountFilePath (front/lib/api/frames/frame_name.ts): renameMountFile changes mountFilePath without refreshing frameName. Renaming a registered Frame's source folder therefore leaves its displayed and shared name at the old folder name.

Comment thread front/lib/resources/file_resource.ts Outdated
{
status: "ready",
...(needsName
? { useCaseMetadata: { ...this.useCaseMetadata, frameName } }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

frame-name-is-one-path-segment on validateFrameV2Name (front/lib/api/frames/frame_name.ts) limits Frame names to 128 characters, but registration persists the folder basename here without validation. An otherwise valid manifest under a 129-character folder passes registration and stores an overlength frameName; the new validator is never called.

Comment thread front/lib/resources/file_resource.ts Outdated
useCaseMetadata: destUseCaseMetadata ?? null,
useCaseMetadata:
destUseCaseMetadata && frameName
? { ...destUseCaseMetadata, frameName }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

updateMount bypasses frame-name-is-one-path-segment on validateFrameV2Name (front/lib/api/frames/frame_name.ts): moveFrameV2Source accepts a 129-character destination folder, and this assignment persists that basename unchanged. A previously valid Frame can therefore be renamed beyond the 128-character limit without rejection.

Comment thread front/lib/resources/file_resource.ts Outdated
@davidebbo
davidebbo force-pushed the frames-v2-name-projection branch from c745947 to 89ff507 Compare September 21, 2026 12:23
@davidebbo davidebbo changed the title Frames v2: derive the name from the source folder Frames v2: name a Frame after its source folder Sep 21, 2026
A Frame's file is its manifest, so its display name has to come from somewhere
else. It now comes from the folder holding that manifest, derived at every point
of use rather than stored: the file explorer already labelled Frames this way,
while getFileDisplayName, Poke and the share page read a copy in
useCaseMetadata.frameName that publish refreshed. The two disagreed whenever the
manifest name and the folder differed.

Deriving means the name cannot drift from the folder, and it follows a Frame
that moves without anything having to refresh it.
@davidebbo
davidebbo force-pushed the frames-v2-name-projection branch from 89ff507 to 691a386 Compare September 21, 2026 13:06
@davidebbo
davidebbo merged commit 037dbf4 into main Sep 21, 2026
57 checks passed
@davidebbo
davidebbo deleted the frames-v2-name-projection branch September 21, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants