Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Adding a path to a filename creates ghost tabs #1182

Open
mootari opened this issue Mar 8, 2025 · 2 comments
Open

Editor: Adding a path to a filename creates ghost tabs #1182

mootari opened this issue Mar 8, 2025 · 2 comments

Comments

@mootari
Copy link

mootari commented Mar 8, 2025

When entering a file name like "foo/bar/Component.svelte" in the playground editor, the tab bar will display additional tabs "foo/bar" and "foo" which can be dragged but not selected.

Image

Reproduction

See this playground example.

@mootari mootari changed the title REPL: Adding a path to a filename creates ghost tabs Editor: Adding a path to a filename creates ghost tabs Mar 8, 2025
@mootari
Copy link
Author

mootari commented Mar 8, 2025

Looks like ComponentSelector needs to ignore files entries where type !== "file".

this.#files.push({
type: 'directory',
name: joined,
basename: joined.split('/').pop()! // TODO get rid of this basename nonsense, it's infuriating
});

{#each workspace.files as File[] as file, index (file.name)}

@mootari
Copy link
Author

mootari commented Mar 11, 2025

Directory entries also need to be filtered out inside download(), otherwise they break the "Download app" action because their data is undefined:

...components.map((component) => ({
path: `src/routes/${component.name}`,
data: (component as File).contents
}))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants