Skip to content

Conversation

@NARUDESIGNS
Copy link
Collaborator

Hello @TildaDares
This is the PR I've made to address issue #842
So I only made changes to the PublicLab.Editor.css file and so I had to use combinations of classes and IDs to target the selected classes. Do have a look and let me know what you think.
Here's what it looks like now:

Screenshot 2022-02-22 at 1 17 53 PM

@gitpod-io
Copy link

gitpod-io bot commented Feb 22, 2022

@TildaDares
Copy link
Member

@NARUDESIGNS I just tested this in the plots2 site and this is what is being displayed

Without image:

Screenshot 2022-02-22 at 15 01 53

With image:

Screenshot 2022-02-22 at 15 03 26

@NARUDESIGNS
Copy link
Collaborator Author

NARUDESIGNS commented Feb 22, 2022

This is similar to how it was before I started working on it. Also long before now, the uploaded doesn't work for me in my local environment.
I wonder what is wrong but I'd have a look, thanks.

@TildaDares
Copy link
Member

It'll be better for you to also test how it looks on the plots2 repo. If you have the plots2 repo installed locally, you can do this:
https://github.com/publiclab/PublicLab.Editor#creating-a-mock-server

@TildaDares
Copy link
Member

Also, remember that plots2 has its own custom styles so you might need to change that too
https://github.com/publiclab/plots2/blob/main/app/views/editor/rich.html.erb#L44-L58

@NARUDESIGNS
Copy link
Collaborator Author

It'll be better for you to also test how it looks on the plots2 repo. If you have the plots2 repo installed locally, you can do this: https://github.com/publiclab/PublicLab.Editor#creating-a-mock-server

I do not have plots2 installed locally. I only use it on Gitpod. But to get you, are you saying we can not make UI changes in the editor project without also making the same change in the plots2 project?

@TildaDares
Copy link
Member

TildaDares commented Feb 22, 2022

No, I'm saying to know that the UI looks good, you need to test image upload which is why you need the plots2 repo. Also, the plots2 repo has its own custom styling, so you need to also keep that in mind while you're adding styles.

@jywarren
Copy link
Member

Hi all, thanks for this, the refinement proposed in #842 looks great.

@NARUDESIGNS basically this is the situation -- the HTML actually displayed on PublicLab.org is from plots2. But since we develop the editor in its own library, which doesn't contain plots2 code, we create an "example" HTML file, just so we can properly run the code, test it out, etc. It's called an example also because if anyone else ever uses this editor, they know what HTML is needed for the library to work properly.

But that means that if you want to style how something looks differently, you need to do it on plots2, which is what's actually published to the site. That also means that we need to either:

  1. not make any changes which would break the version still at https://github.com/publiclab/PublicLab.Editor/blob/main/examples/index.html, or
  2. update https://github.com/publiclab/PublicLab.Editor/blob/main/examples/index.html so that the example still works

option 2 above is technically a breaking change. That's OK, but if we do this, perhaps we can do it all at one time, rather than in a series of PRs, since we would technically need to make a major version bump each time.

That's a good reason to make as much of our changes as we can without requiring different underlying HTML. We could do all our changes to the HTML in one PR even before we do all our styling fixes, so that we only need to bump the major version once. That might be complex to think through, and if you need to make 2 breaking changes, it's not such a big deal. But if you think it may be relatively easy to do all your HTML improvements in a single big change, or to even avoid breaking HTML changes entirely, that's ideal. Many HTML changes will result in a different appearance, but the original example file at https://github.com/publiclab/PublicLab.Editor/blob/main/examples/index.html will still work, right?

I hope this makes sense. Some HTML is done actively using JavaScript, rather than relying on existing HTML. But the template file at rich.html contains essentially everything which /must/ be installed already in the final application for the Editor to have a foundation to install upon. Make sense? I'm happy to discuss more!

@NARUDESIGNS
Copy link
Collaborator Author

OK I think I'd have to go through again to grasp it well but these are where my confusion lies:

  1. I only made changes to PublicLab.Editor.css not the HTML file.
  2. Other CSS UI changes we've done in the past weren't complicated as this seems. We merged them and they worked just fine.

Can you speak to these concerns? @jywarren

@jywarren
Copy link
Member

jywarren commented Mar 1, 2022

To check a PR's effects in plots2, before merging or publishing, here's a workflow you can use!

  1. Open plots2 in GitPod (https://gitpod.io/#https://github.com/publiclab/plots2/)
  2. copy the folder /public/lib/publiclab-editor/dist/ to /public/lib/publiclab-editor/dist-bkp/
  3. copy in (manually copy pasting if necessary) the newly generated dist/PublicLab.Editor.css and dist/PublicLab.Editor.js or dist/PublicLab.Editor.min.js files (the minified version) to /public/lib/publiclab-editor/dist/
  4. Navigate to https://GITPOD_URL/lib/publiclab-editor/dist/PublicLab.Editor.css (for example) and refresh or otherwise clear the cache
  5. Try the editor in GitPod to see if your changes appear and work properly!

@NARUDESIGNS
Copy link
Collaborator Author

I had the same old problem we had with plots2 on Gitpod last time 😭 😭 😭

Screenshot 2022-03-07 at 4 57 41 PM

@NARUDESIGNS
Copy link
Collaborator Author

copy the folder /public/lib/publiclab-editor/dist/ to /public/lib/publiclab-editor/dist-bkp/

@jywarren @TildaDares can I try something like this with the plots2 project locally?

@jywarren
Copy link
Member

jywarren commented Mar 9, 2022

Hi Paul, oh no! Ok, but so you can probably fix it the same way too. Use a link like this:

https://gitpod.io/#prebuild/https://github.com/publiclab/plots2/

That forces a fresh prebuild, so starting from an earlier stage than had generated your error.

@jywarren
Copy link
Member

jywarren commented Mar 9, 2022

For reference here was the last time this happened: publiclab/plots2#10711

@NARUDESIGNS
Copy link
Collaborator Author

Alright, I'd try that, thanks.
@jywarren

@NARUDESIGNS
Copy link
Collaborator Author

Thanks for the tip @jywarren that was really helpful.
@TildaDares can you please have a look again and see if things show up better now?

@TildaDares
Copy link
Member

TildaDares commented Mar 10, 2022

Great work @NARUDESIGNS! This is what it looks like now

Screenshot 2022-03-10 at 12 21 39

At about 767px width, the choose file button kind of cuts off from the screen. This happens till around 550px.

Screen.Recording.2022-03-10.at.12.29.25.mov

@NARUDESIGNS
Copy link
Collaborator Author

NARUDESIGNS commented Mar 10, 2022

Oh, I see.
I guess we need to target screens within that range as well. I think that should be tablet view right?
@TildaDares

@TildaDares
Copy link
Member

@NARUDESIGNS yeah you’re right

@NARUDESIGNS
Copy link
Collaborator Author

@TildaDares I think we should be fine now. Please check if all looks good so we can merge!
Thank you!!

background-color: #007bff !important;
}

@media (max-width: 800px) {
Copy link
Member

Choose a reason for hiding this comment

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

Change this to about 992px and we should be good!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alright then
On it right away

Copy link
Collaborator Author

@NARUDESIGNS NARUDESIGNS Mar 14, 2022

Choose a reason for hiding this comment

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

But why exactly 992 if I may ask?
@TildaDares

Copy link
Member

Choose a reason for hiding this comment

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

It had the same issue as before at 992px.

Copy link
Collaborator Author

@NARUDESIGNS NARUDESIGNS Mar 14, 2022

Choose a reason for hiding this comment

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

Ok then, looks great on my end but let's try.
Also can you confirm it looks great and 993px and wider on your end?

Copy link
Member

Choose a reason for hiding this comment

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

It's perfect!

Screen.Recording.2022-03-14.at.18.14.49.mov

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Awesome!

Copy link
Member

Choose a reason for hiding this comment

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

Haha love this quick iteration, you two! Thanks! 🎉

@NARUDESIGNS
Copy link
Collaborator Author

Thank you so much for your time @TildaDares I think we can merge now
cc @jywarren

@jywarren
Copy link
Member

Just re-running the tests after a sync, and we should be good to merge!

@jywarren jywarren merged commit 1eb788a into main Mar 15, 2022
@jywarren
Copy link
Member

🎉

@NARUDESIGNS
Copy link
Collaborator Author

Thank you very much!
I'd move on to another part of the editor and let you know what I'm working on
@TildaDares @jywarren

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.

4 participants