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

Custom Sidebar is not put in the sidebarContainer slot #217

Open
ZBMO opened this issue Feb 1, 2024 · 5 comments
Open

Custom Sidebar is not put in the sidebarContainer slot #217

ZBMO opened this issue Feb 1, 2024 · 5 comments
Labels
enhancement New feature or request ship soon

Comments

@ZBMO
Copy link

ZBMO commented Feb 1, 2024

functions for :component-filter check if the c.type == 'sidebar' or c.type != 'sidebar'.
The result is that a custom sidebar isn't placed in the appropriate slot (having its type prepended with 'custom_') and is arranged on the page the other layout components.

a fix would be to change the equality checks on lines 6 and 19 of CorePage.vue to use .includes() instead of ==.
I would like to make a PR for this

image

@ramedina86
Copy link
Collaborator

Good find, thanks for sharing! I didn't contemplate people might want to develop their own sidebars. This is a limitation that shouldn't exist.

To be honest, the mechanism is a bit hacky as it is, and I think partially matching the string "sidebar" would be even hackier.

I'd prefer having something that tells the Page where to put it, whether it's the core Sidebar or a custom component. I'm thinking an additional attribute in the StreamsyncComponentDefinition (in streamsyncTypes.ts)...

export type StreamsyncComponentDefinition = {
	[...]
	insertionArea?: "default" | "sidebar";
};

I believe this is cleaner and would allow us to develop e.g. "footer" or "topbar" in the future, without breaking anything.

Feel free to send a PR; it'd be appreciated. Should still be quite straightforward I believe. Apart from that change in type as shown above, I think it'd just be checking whether the component is c.insertionArea == "sidebar" or not in CorePage.vue. Please let me know your thoughts.

@ramedina86 ramedina86 added the enhancement New feature or request label Feb 2, 2024
@ramedina86
Copy link
Collaborator

Hi @ZBMO , can you please confirm whether you want to work on this PR? Otherwise we're happy to take it ourselves

@ZBMO
Copy link
Author

ZBMO commented Feb 7, 2024

@ramedina86 sorry for the delay, I'd like to but I won't be able to work on it till next week. I understand if you need it done sooner.

@ramedina86
Copy link
Collaborator

@ZBMO no worries at all, next week is fine. And of course no pressure, just want to avoid two people working on it at the same time.

@ramedina86
Copy link
Collaborator

@raaymax please take care of this which will also help address the complexities around reusing positionless components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ship soon
Projects
None yet
Development

No branches or pull requests

2 participants