Hi We have the metaflow UI deployed in different ...
# ask-metaflow
m
Hi We have the metaflow UI deployed in different environments. We'd like to have different colour backgrounds for the different envs. Just wondering if this is possible through some existing config?
b
That's a good suggestion! Would you want the whole background to be a different color, or just the header?
m
Just the header would be sufficient, I think
a
@mammoth-rainbow-82717 one feature that you maybe able to use for this purpose is
system notifications
- basically a long lived notification that informs people which stack they are on - https://github.com/Netflix/metaflow-service/blob/46ef6ead8a2cb8fd4956ba9a02fcb94b2[…]061e2c3/services/ui_backend_service/docs/environment.md?plain=1
m
Interesting. Don't have an example of what it looks like in practice, I suppose?
It is just some markdown at the top of the main page?
a
I tried to find a screenshot - but unfortunately couldn't locate one. @bulky-afternoon-92433 would you happen to have one?
b
Didn't have one saved, but here's two screenshots fresh out of the oven:
there are a few different styles mentioned in the readme that can be used for the notifications, but a big gotcha regarding using these to convey the environment a user is on: The UI keeps track of notifications that the user has dismissed, and these will not be displayed again. The dismissal of a notification is recorded in the browsers LocalStorage
my config.notifications.json for the markdown example looks like
Copy code
[
  {
    "id": "fixed_id_attribute",
    "type": "info",
    "contentType": "markdown",
    "message": "#Markdown example\n*Check* out metaflow at the url [Metaflow](<https://metaflow.org>)",
    "created": 1618404534000
  }
]
with some of the fields straight out of the docs example šŸ™‚
m
I see. Thanks for sharing. Doesn't seem ideal though. I can imagine people dismissing it immediately, but then leaving the page open for days. They'd then forget which env they are in. Plus, we all other internal apps we have a colour scheme for the environment. Would be good be aligned with that.
Do you think it would be a big PR to add something like this? Would be happy to look into it, if you are open to such a change.
šŸ‘Œ 1
b
As to the point of customizing the look of the UI, I agree that offering the option to personalize some of the elements would be an improvement
The biggest hurdle to overcome with regards to configurability, which is already evident in the ways that notifications can be set up (both as a json file on the server, or from an environment vaiable) is the matter of storage. The backend does not offer any persistent storage with its default configuration, so storing any assets for the frontend is a bit of a problem
maybe @ancient-application-36103 can chime in as well, but here's some things that would need to be considered for the feature • asset storage configuration for custom assets • how much customization to offer. Limit to certain UI elements, or full "Themes" • the UI uses
styled-components
for CSS, might be worth looking into if this can be leveraged for implementing themes. I'm not familiar enough with the capabilities of it
m
I see. Thanks for the info. It seems like it would be a not insignificant amount of work then. I guess I'll leave it for the moment and see how much of a priority it becomes.