-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Improvements regarding the Sandbox section #103
Comments
Hi, thanks for giving some love to the Sandbox ❤️ There are so many things that could work on, and my time is limited between work, family, Mint and other things, so I appreciate the time you put into Mint 🙏 The current version of the Sandbox is basically an MVP, so there can be a lot of features that can be added. I like all of your ideas. The code looks fine, although the search scope seems off since the
Yes please split it into feature PRs. |
Yes, I've actually just copy-pasted stuff for starters, since I was mostly working on documentation, I'm actually only setting up the Database now to test stuff related to the sandbox, so all that code was actually more like pseudo-code, I still haven't actually written the tests or tried running anything, will start working on that today.
It's a pretty great MVP, if I may add. One of the things I like about the Sandbox is that, unless I'm mistaken about it, the sandbox section actually uses Mint for the front-end,and Rails only serves as an API, unlike the Site which actually uses HAML. It'd be great to have the main website written in Mint, but that's obviously not a priority, and it's not worth the effort that would be required to rewrite everything. Still, that's a point for the Sandbox. And I do realize how hard it is to balance work-life, which is why I try to focus my efforts on collaborating with projects I believe can grow into something I believe in. Anyways, I'm considering splitting my work the following way:
Ideally I'd also like to have a way to differentiate sandboxes that are and aren't compiling so people can filter their search to only see stuff that actually works, plus the ability to change how results are sorted, though that'll have to wait until I'm more comfortable with the code before I'm able to decide what can or can't be done, what's worth the effort etc. |
Sandboxes are a powerful way to go into more detail than would be appropriate in either the Learn section or the API documentation, but not only that, they can also be a powerful tool for new developers to search for mint code that can provide examples of how to implement many features.
The Sandbox section, however, lacks any mechanism to search for sandboxes, even just by author.
Before learning about Mint I was quite mesmerized by Elm, and after over a decade working as a full-stack developer I almost couldn't believe how sensible it was, leagues ahead of anything else I had known (Which range from Curses to GTK to Windows Forms to all the usual front-end suspects such as Bootstrap, React, Angular, VueJS etc). But then I found Mint, and I immediately realized Mint was leagues ahead of even Elm. So I just jumped at it.
As usual, that's when we start finding the problems, and Mint wouldn't be an exception, but the community is great, and the biggest issues I came across were usually more about documentation than problems with the language itself, which is always a good sign. I tried participating in a couple discussions, raising a couple questions, and finally started contributing to the language, and after all of that I finally believe I'm knowledgeable enough to help with documentation, this I forked the website repo (This repo) and started working on it, and one of the things I wanted to do is to make it easier to use sandboxes as a way to learn about mint.
As it stands, the
Try
section lists the 20 most recent sandboxes, which usually gives you a list with 10+ meaningless and useless sandboxes called "My sandbox" that are basically the result of someone with little to no experience in Mint creating a new Sandbox to check how the syntax works and whether they think Mint is interesting for them. Not exactly the most interesting front-page but to add insult to injury, there's no search box, no way to list some user's sandboxes, no tags, no nothing basically.So, for starters, I though it'd be a good idea to include a Search Box at the top of the Sandbox listing page, plus a way to list sandboxes by other users (The code for this is pretty much done already, to list your own sandboxes, it's just a matter of making it possible to do the same to other users). I'm already working on those two.
But in addition to that, I think we could really use a few more features, namedly:
For now, I'll be working on improving the documentation in the "Learn" section and making it possible to search Sandboxes and list sandboxes by user, which are very useful, I believe, and I don't think anyone would question that. Luckily I'm mostly a Rails dev, and although i'm more of an ERB than a HAML-guy, that's a pretty small thing to get used to in the grand scheme of things, and it was really easy to understand how the site is structured and decide how I could implement the sandbox search and listings and stuff.
However, for the more complex features like Bookmarks, scores, tags etc., those depend on more significant changes, in some cases changing the database structure itself, and I think that's something that should first be discussed with the maintainers, which is the reason I'm starting this issue.
For this first iteration I'm making the search box search only sandbox titles, and the listing by user will use the user id, here's a preview of the scopes for the Sandbox model:
If you look at the file in master, it doesn't use scopes, instead all of the querying being done in the controller, which everyone agrees is not ideal. I used the package model as a reference to decide how to scope it, and used to opportunity to make the controller properly use the scopes, i.e.:
Now I'd like some feedback about the other stuff, whether I should split my changes into smaller PRs so the refactoring and each feature can be evaluated separately etc.
The text was updated successfully, but these errors were encountered: