Building a TUI
A livestream working on Solo, my terminal UI for Laravel. I dig through Laravel's connection factory to register a libSQL resolver for Turso, then rework how hotkeys are handled so Vim keys can work. For someone who doesn't use Vim, I put in a lot of effort to make Vim work.
Everything I said
Let's try this again. There we go. Okay, so we need to... That's not true. Delete that. That is true.
I don't know why Restream, Restream continually messes everything up. Um, okay. So we are... Yeah, Joe's gone. That was a little oopsie-doopsie. We did a little oopsie-doopsie. We like to do an oopsie-doopsie. That happens all the time. Let's go to, uh, YouTube and make sure, make sure that we are streaming correctly over on YouTube.
Mm-hmm, mm-hmm. Yeah, this joint stream, I need to delete. So I had a little false start there. What happened was, uh, Restream, Restream kinda lied. Uh, so I'll just delete that 19-second stream. We'll just make that stream invisible.
Hey, Samuel. Yeah, Joe's, Joe's not here, so sorry. That was a little bit of a, that was a little bit of a false start. So I think we're okay. So we're streaming correctly. There we go.
So we're back, baby. All good on LinkedIn. Oh, hey, Josh. How was your stream earlier today? Uh, yeah, seriously, finish the Restream thing, 'cause this Restream drives me nuts. Um, how was the stream with Mux, Joshua? No, unfortunately, I need a lot of sleep per night.
And Echo on LinkedIn. The pixelization thing, or pixelation? Why did I say pixelization? The pixelation thing is awesome. Uh, unfortunately, no, I need a ton of sleep. Uh, Ivan, I don't know.
I, uh, I haven't started it yet, so you're about to watch me build the actual thing. Um, hey, JT. You're about to watch me build the actual thing, and we'll see. We'll see when it gets released. Um, so I'm gonna start today, and then I have some flights next week. Um, going to Boise to see Steve and Kelsey and so, um, I'll be able to work on it on some flights and yep.
All right, Mark's gonna start streaming. That's what we like to hear. Um, did I, did I test your PR? You know, Samuel, testing's an open question at this point. Um, I did pull it down and test it locally, but I don't have good testing set up for, um, like the actual underlying process part, which I, I would like to figure out.
Uh, Cranabone, who I think his real name is Mohammed, uh, yeah, Cranabone, he set up the workbench integration, and so this will get me a long way, this will get me a long way in the right direction. Um, but yeah, I read the docs like you did, and I think you're absolutely correct, and I think I mucked that up, so I appreciate that. Um, oh, Josh, that freaking rules.
Thanks, man. Um, the only thing on my mind for Solo right now is I wanna merge these two PRs, um, but not in their current state. So I need to re- I need to rethink, uh, hotkeys just kind of like across the board, um, so that people can define their own global hotkeys, so that the VIM folks can have what they're used to, um, and so that commands can define hotkeys,
um, and the UI will still work. So I think I'm gonna add an extra, an extra, uh, row. If a command has hotkeys, I think I'm gonna put it... When I zoom, does this zoom? Ah, that's so freaking cool. So I think I would put command hotkeys above global hotkeys. Hey, Ahmed.
Um, so that's the goal. But yeah, I'm so freaking pumped about this package, the Solo package. People like it. It's going great. Look at all these commits we've already had. Look at all this. This is great. Speaking of Josh Siri, he fixed the Chewy issue.
Chewy was kind of out of sync with prompts, um, so it's all fixed now thanks to Josh, Josh and Joe. Boy, feels like I muck things up a lot more than the average person, but that's the price we pay, and I'm okay with that. Hey, Mitchell. All right. You know what?
I think, I think mucking things up is just really not that bad. Feels really scary, but yeah, Solo's the Tui. Um, Solo is this guy. I think mucking things up is the price you pay for, like, actually doing things. That seems okay to me. There's, um, Aaron Francis, you're always doing something wrong.
This is how I feel. You're always doing something wrong. But you know what? If you wanna do stuff, you're, uh, invariably gonna do stuff wrong, and that's okay. Better to do stuff and do it wrong than not do stuff at all. This is Google Chrome, if you've ever heard of that. Um. Oh yeah, the-- Mitch, scrolling back a little bit.
The Tmux people were like, "Why didn't you just use Tmux?" And my, my answer was, "I don't, I don't know what Tmux is." And people were, uh, people were very confused by that. Somebody on here, um... How do you, how do y'all use Reddit? Reddit is the worst. Um, somebody on here was, "Why didn't you just use..." Uh, seems like he reinvented Tmux, and I said, "Yeah, maybe.
Isn't that cool?" Um, why didn't you just use that? I don't know. I'd never heard of it, and it seems complicated. Um, so there were some funny, there were some funny comments, and it's like, I don't mind. It's a very, it's a very developer thing to say, like, "Why didn't you just do this complicated thing?" Like, never heard of that in my life.
Um, should we build a, should we build a driver for Turso? It's been a minute since I've built a, uh, a database driver. That was, Josh, that was literally the first comment, I think, when I, like, got on stream to do it.
It was like, "Wait, why is this better than NPX concurrently?" And I was like, "My brother in Christ, I have not written a single line of code. I don't know, but I think it could be, it could be cool." Um, correct, Will. Right you are. Hey, Daniel. Why didn't you just? Why didn't you just? That's a great...
Oh, guys, that's a great article title. Why didn't you just? I should-- I'm writing that down in my head. Why didn't you just? I should write it down on a piece of paper. I should write it on a piece of paper. Why didn't you just?
That's a great article title. Why didn't you just? Got it. Look forward to that one. Yeah, you're scooped. You've been scooped. All right. Okay, my friends, we are mostly recovered.
You know, I had a minor procedure earlier this week, um, but we're mostly, we're mostly recovered, and I think we're ready to do some work. I've got two types of waters here. We're ready, we're ready to get some stuff done. Man, FFmpeg is the most wrapped thing in the entire world.
Is that Andrew Ehrman from college, Andrew Ehrman? Is that Fightin' Texas Aggie Andrew Ehrman? Um, Daniel, I have a Restream, like, plugin/URL that I pull all the content out of and then restyle and put it on here.
Man, freaking Ehrman. Freaking Ehrman showing up in the chat. Guys, I went to college with Andrew Ehrman. PumpItAlex. Ridiculous. Um, all right. So here is the dealio, my friends. What we're gonna do, what we're gonna do today...
Can I get a light mode on this? Brace yourself. Brace yourself. Shield your eyes. There we go. Fits the theme better. Um, what we're gonna do is they have a PHP, um, what, what would you call that? SDK. But they don't have, um, they don't have a, a Laravel one, and we love Turso.
We know Turso. Um, we're gonna call it, for now, we're gonna call it the LibSQL driver. Ehh, I could go either way on that. Ah, JT classic. Um, so this is the way that they want you to use it, which is fine for, um, like, native PHP. But hey, come on.
Hey. Who's write, who's writing, who's writing native PHP anymore? Laravel or bust. So we're gonna turn this into a proper, we're gonna turn this into a proper driver. Hello, Florian. God, Florian, I feel like you stay up late. It's gotta be... Oh, it's not that late. It's gotta be, like, eight thirty or nine thirty, maybe ten thirty there.
So I have already done this. I've already required the LibSQL driver, um, or package rather, and it's got some FFI stuff in it. Uh... Right now on stream? Are you crazy? I'm not relaunching the update. Literally writing native PHP.
Touché. Touché, my friend. Um, all right. So here's what I have so far. I have this. Um, you can ignore... Guys, also, I just learned that, uh, PHP has a native SPLQ in it. And it's a doubly linked list, and you can do, uh, you can do awesome stuff where you might use an array, you can use this queue.
I mean, we haven't even gotten started and we're alway- we're already distracted. Aaron Francis Solo. Uh, yeah. So the SPLQ in PHP, just learned about this. I was actually asking ChatGPT, if you can believe it. Um, I was asking ChatGPT, how do I, how do I do efficient array operations in PHP, memory efficient, without like recopying the array everywhere?
And, um, SPLQ is the answer. So if we look at... Where's manages processes? I think that's where it is. Manages. Yeah. Um, no, it must be in the command itself.
I'm trying to show you something awesome, so just wait one second. Command. I keep all of the output lines in an SPLQ, which then allows us to do cool stuff like this. Add line, boom.
You can do, um, a dequeue. So you can, like, you can enqueue stuff at the end and dequeue stuff from the beginning without having to, like, copy arrays around or anything like that. You don't have to do array merge. You don't have to, like, merge new stuff at the end of the array.
You just, like, put stuff on and pop stuff off, and it's very, very, uh, memory efficient. So SPLQ, good job, PHP. Um, let's see. I do not use cursor. Uh, Technomancy, you don't have to detox from all dopamine.
Any way that I provide dopamine is okay. Other things you should detox from. So you should read my tweets and watch my videos, but everything else you can log off from. That's the rule. So the question is, we can get rid of that. Here is the way that they use it, which is this.
Um, so you open this new database, and that is their database. So if you look in here, you see a bunch of stuff. We're just gonna do local right now. We're not gonna do-- We're not gonna talk to Turso remote. We'll do that later. Um, but just for now, we're just gonna do local. Um, the kid that wrote this, and I say kid 'cause he's like 19, is a genius.
So props to this kid. I think he's written like all of their SDKs in like a week or something. And it cross, it crosses like REST and PHP and JavaScript. It just crosses everything. So I'm not that smart. I'm just gonna take what he's done and turn it into a Laravel driver. So what we need to do is if we come to...
I haven't done this in a long time, but here's what I want to do. Um, this is what it normally looks like. And so what I wanna do is this. I wanna say that this is the Turso. Should we... L-let's just call it LibSQL for now. I'll figure out later what they wanna call it. Um, Florian, I'm always distracted.
That's my secret. Yeah, this should enable a lot of stuff. This should enable Laravel Scout. This should enable queues and caches and multi-tenancy. It should enable a lot of stuff. Um, doo, doo, doo, doo. We're gonna say, we're just gonna hard-code this to, let's just call it LibSQL.
What did I-- Did I already call it something else? No, I already called it LibSQL. Um, so this is-- We're just programming by wishful thinking at this point. Um, so this is not going to work because there's no such driver as a LibSQL driver. There is, however, um...
Where would that be? There's the LibSQL DB. So the actual file has already been created. Um, there is a Turso Laravel, um... They have, um... I don't think they have like an eloquent driver.
Um, driver LibSQL. I think this uses the old, the old SDK, and so they've asked me to r- they've asked me to write a new one. Um, so we're just gonna kinda implement it from scratch. So we can maybe use some of the stuff that they have done on that old one, but I kinda just wanna do it, I kinda just wanna do it from scratch.
So they have a few... Yeah, this is the problem. Um, the current one requires access to, um... It's just not very friendly in terms of the DX. I'll just say that. I think there's some stuff that you would have to do to get it installed, um, which is like in-install a, um, a PHP extension, which is not what we're looking
for. So yes, there is one right now. It's not, uh, it's not exactly what they're looking for, 'cause you have to open the PHPINI and do all this stuff, and we don't wanna do that. So...
Oh, weird. If you go back... There, there we go. Um, so we're gonna do a new one. And the good part is we get to learn a bunch of stuff. So the first thing I think we need to do... So I'm gonna do all of this, uh, I'm gonna do all of this in this local application here, and then we'll extract it to a package.
So let's just put it all in a single folder for now. This is just my, this is just my kitchen sink app. So we're gonna put it in torso, and we're gonna create a torso... Gah. LibSQL service provider. Hey, Ben. Um, we're gonna create a LibSQL service provider.
I'm gonna rename this already to LibSQL Ben's provider. Oh, is it service provider? Yeah, there you go. And then I think what we need to do is, um, I think we need to register a new grammar.
Public function register. So if we come over here... Actually, let's go to database, and let's just set the default. Um, we can just change this to from whatever it was and say we want to use LibSQL. So now if we come over here, and we were to say DB select
one, that should say, "Hey, there's no such driver. You can't do that." Should. We'll see. Unsupported driver. Okay, perfect. Oh, we are just barely getting started.
Um, okay. So what we need to do is we need to register a new driver. Here's what I'm gonna do. Did you know, um, not Aaron Francis, single store Laravel. Do you know that I wrote this? I wrote this driver. I've done this before. There he is.
Hey. That's me. Um, so I've done this before, and I've forgotten some of how to do it. So resolver for creates a new connector. So one of the problems, in my opinion, one of the problems here is, um, it's very, uh...
There are a lot of classes. I'll just say that. Um, so let me show you. Where are we gonna start? Connection. So if we come here, connection factory.
Let's go look at the source. Connection factory. And then we come to SQLite. There you go. So we kind-- we can kinda get a sense of how we need to do this, um, if we come in here. And so right here, it's looking for torso.
God, freaking... It's looking for LibSQL. Um, uh, uh, uh, uh. Yeah, it's looking for LibSQL. So we need to, we need to bind something into the container to make this work.
I don't know why that didn't... Two seventy-nine. Uh, we're on the wrong one. So we're down here at create connection. And I think what is going on... Two seventy-nine.
Why is this not... Oh, I'm in test bench. I'm in Solo test bench. I don't wanna be here. This is the wrong one. I need to... I had Solo installed locally here, so I need to get rid of that. Yeah. I can get rid of that.
Let's go to the real one. Connection factory. Yep, yep, yep. Two seventy-nine. I'm just trying to figure out where we are. There we go, LibSQL. Okay, so we're in the connection factory, so we need to see what get resolver does.
We need to register a new resolver. So over here in get resolver, resolver four. There you go. So what class is this? This is database connection. So I bet if we come over here, and we did a connection Resolver four.
Hey, there we go. Lib SQL function. Just figuring it out as we go. What parameters get passed? We need to go back to the connection factory. It gets connection, database, prefix, and config. Okay. Uh, I don't exactly know what those are yet, but that's fine.
So did we make it? Did we make it? No. So it didn't register. I haven't registered my service provider, like a big dummy. Solo service provider. Let's do Lib SQL. So now we should get one, two, three.
One, two, three. I'm a professional developer. Okay. So we're hooked in. Now we just need to figure out how to make... Rather, what do we need to return? What do we need to return?
Um, I don't know. I have no idea. Should return a connection. Should return a database connection. Okay. I bet it's probably gonna make the most sense for us to extend, probably gonna make the most sense for us to extend the SQLite connection.
Hmm. This is a good question. It should actually work straight out of the box if we come back to our here, and we say return new SQLite connection. Video database table prefix config.
And who do you extend? You just extend a straight connection. So then... Hmm, I don't know. What do you... So you just pass through. So we're gonna start here. Hey, Adrian.
So this isn't re-- I mean, this is real. This is close, in fact, but it's not good enough yet. Um, this returns a SQLite connection, which is, uh, close, but it's not gonna be right. Um, what's a real command?
So we have-- I've already created a users table, so let's see if this does anything. It should be able to read. Still unsupported. That's interesting. I would have thought at this point that we had to come in here.
Okay, so that's been registered. So who's complaining about unsupported, unsupported driver? Hmm, mm, mm, mm. Uh, yeah.
Oh, I didn't return anything? Um, yeah, that's the goal. Uh, who asked that? Chrysianic? Yeah. S-s-so if I just read a straight SQLite database,
will that work? I think I have database.sqlite. Um, did I set up... So what if I did a straight database path?
So we're starting small by eliminating, uh, all points of potential. I don't know if users is in there. Select one should work. Unsupported, unsupported driver comes from connection eight twenty-five.
Run query callback. Okay. So the real question is, database, if I come back here and switch it over... So we're eliminating variables.
That's all we're doing. Select. Database file does not exist. Hey, Soto. What if we comment that out and we say go here? Great.
Got all the way through to SQLite, so that's fine. I don't, I don't know what's in that database is part of the problem. Uh, maybe articles are in there? Yeah, there you go. Hey, you're always doing something wrong. We just talked about that. Okay, so working backwards, have we, have we learned anything?
Um, hmm, hmm, I don't know. I don't know if we've learned anything. We've learned that this works. Um, so we've learned... It's just, I don't know if that's actually even right syntax. Select star. It's probably like DB table, articles. I feel like that's probably what it's supposed to be.
Does that run the query? Just the query. There you go. Cool. All right. So this is what we're after. That's actually results.
That's results. Okay, that's what we're after. So what we need to do, what we need to do is we need to now change... We're gonna change our default back to lib school, and our database matches.
So I'm just trying to intercept. Yeah, it's still not working. Hmm. I feel like I have successfully bound this in, but I have missed something. So let's look at the other driver that I have written and see...
DB connector single store. This feels like something. Um, so I wrote this a long time ago. When did I write this? Two years ago. So I think the question is...
All right, who's complaining about this? Connection two eight twenty-five. Connection eight twenty-five is complaining about this. And who's complaining before that?
I just feel like we haven't changed hardly anything, and yet it's still not working. So why would that be? There's something I'm missing.
I know Tobias also has a, um, he's got an enhanced Postgres driver. I don't think we need to look at that yet. So if we do resolver for the driver is the callback. Yep, that's right. Connection factory.
So we get down here. Mm-hmm. We're returning a SQLite connection. We are newing it up, so that is correct.
We should be doing that. So I think we end up here. Yes. Mm-hmm. Then we hop into the resolver, which is this guy. Nope, I don't think you can add void. Nope.
What if we did, um... So here, for some reason, I bound con... DB connector. No, I don't need to add it to the match because it, it returns early here.
So it bails out with my, um, it bails out with my resolver up here. So back when you were looking at those match statements, the first one above the resolver had something about the bind statement.
Ooh, create connection and create connector. Yes. God, that was the thing I said early on where I'm like, "Ugh, this is, uh, this is a little confusing, and I've forgotten a little bit of it." So we don't return...
Here's my guess. If we do, um, if we did this, and we came over here and did this, this, uh, what is it? App bind, is that it? If we did this and we bound libsql, if you could spell it right.
If we bound libsql to whatever SQLite is, a new SQLite connector, I think that's gonna get us where we wanna be. Is that right? Yeah, yeah, yeah. That's-- We're getting closer. Yeah, I got you.
Still doesn't want to work. Have I done anything different than I used to do? Return new connection, app bind single store to the connector. SQLite connector. This is the one we're gonna probably have to extend. Now, I don't know why Restream insists, insists
on marketing itself in an app that I am paying for. So then if we come back to the connection factory, and we said, um, yes. Yeah, that's interesting, isn't it? Hello, hello, hello.
I don't think... It shouldn't be too low. Should be okay. Create connector, create connection. Oh, you know what? There might be, um... There might be docs on this.
I don't know. No, I don't think there are, which is fine. It's a relatively, it's a relatively, um, obscure...
Make. You're right. It makes it for me. No, still nothing. I think you're right about that. Uh, string concrete.
Concrete is a SQLite connector. The driver is set to libsql. Driver is set to libsql. Mm-hmm, mm-hmm. Boy,
it just seems like I've written this before, and it should work. So what's the difference here? That's the same. All right, chat, what am I doing wrong?
Boy, that just looks the same, doesn't it? Resolver four, resolver four. It's saying unsupported driver. And everything else is the same. Database path, database path, driver, driver.
That shouldn't be an issue. That was the issue. Why was that the issue? Foreign key constraints. I turned off foreign key constraints, and it just worked. That's weird. Why?
Why? Why? Why? So it works with SQLite, but mine is just, mine is just SQLite.
Mine is literally just SQLite. Connectors, SQLite. SQLite connection Boy, that's confusing to me.
Human-readable driver. Why would that happen, friendos? I cannot think of a single reason that that would happen. Uh, yeah, but we're not using...
We haven't done anything... Like, we haven't done-- We're just local, and we're just using a pure... We're just using pure SQLite database at this point. It feels like...
So if we go to... This is edifying because I don't know why this is happening. This is good. So let's come to the catch, and let's say, I think it's when it's trying to turn foreign keys on, it's freaking out. But is that not happening with SQLite as well?
Oh, it's not happening with SQLite. It's not happening with SQLite. Well, this is curious. Uh, rather, that's not true. It's, uh, not erroring. It is turning them on.
It just doesn't, it just doesn't fail. Okay. Let's use our powerful brain. Yeah, I kinda wanna do it clean without looking at the original one. But perhaps it's a moot point.
Um, Turso GitHub, Turso driver Laravel. See the extensions. Boy,
they replaced the entire factory. Ugh. That doesn't seem great. Mm. Mm. I don't think this
is right. Okay. We need to think. We need to use our brains. Why would this be happening? Um. Please don't. Um, why would this be happening if we haven't changed anything?
Have we changed anything? That's a great question. Um, I don't think we've changed anything. Gremlins indeed. We can do this, though.
We can do hard things. So it works, and it doesn't work. Yep. I wonder if pragma is hard-coded in...
I think pragma, the, this pragma might be hard-coded somewhere. Um, that's my guess. Let's, let's go find it. Ooh, man. That's my guess. That's my guess. If we come up here... Oh, nah, don't ask Taylor.
He doesn't remember. He doesn't wanna be bothered with this. I bet that's what's happening. Um, how can I prove that?
S- s- s- s- s- s- s- s... So 8.26 is complaining. How do I get all the vendor frames? Isn't it, like... Yeah, I want all the vendor frames.
Let's go look at, um- Yeah, configure foreign key constraints. So it happens in configure SQLite connection twenty-eight.
SQLite connection twenty-eight. So we do configure foreign key constraints, and then I think we hop in here. Are we still on, still on libsql? Okay. So yep, we're good there. And then we come down here, get schema builder.
Mm. This might be something. We might not have a schema builder registered. No, SQLite schema builder. The SQLite builder. Ooh, ooh, ooh, okay. Okay. Um, is this where we fail? Yes. So this fails. Okay,
so this fails. So if we go down into the schema builder, which is a SQLite schema builder. Then we go into the SQLite grammar. I mean, this should be fine.
We may have been bamboozled, guys. I don't know. Pragma foreign keys on. So that compiles just fine. That's all that does. So this should be just fine as well. Ooh, we are on the hunt, aren't we? This connection. So this should be an instance of what?
It's a SQLite connection, and we're running statements. So SQLite connection, our statement. This is actually database connection. Mm-hmm. Mm-hmm.
Mm-hmm. Foreign keys, we're not pretending. Get PDO. Do we get this far? Ah, we don't get that far, so we're not even preparing it correctly. That's the problem. So what is... Hello, friends.
Hey, Linus. Thank you, Nicholas. That's very nice of you. Ooh, that's interesting. That's interesting. We actually can't get PDO at all. Did you see that? So if we say DD one, we get one, and if we say DD get PDO, we don't get anything.
All right. Hey. PDO is a thing. Call user func.
It is a user func. There's our error. As I wrote before, you need to replace all classes. I don't know what that means. Replace all classes?
Can you help me understand that, Adrian? So this PDO is actually our closure. As is wrote before, you need to replace all classes.
SQLite connector, and so on. I don't-- I'm sorry, Adrian. I don't know what you're saying. So I've
replaced the connector with the SQLite connector. I've created a connection with the SQLite connection. What am I not replacing here? I need to extend them all. Why?
Um, directory. Connection. Connector extends SQLite connector.
Connection extends SQLite connection. Okay. Because PDO does not know what libsql is.
Okay. That feels like something. That feels like something. That feels like something. Oookay.
I don't think it's necessarily, um... So if I did construct PDO, this is the SQLite connection. So if I did that here, what do you get? So you get PDO, driver is-- Oh,
I think the driver... That's interesting. Hmm. So if I did connection, and
then I came in here and I said, here we are, came back to database. Um, connection.
I need to use connection. I need to use connector. This is coming back a little bit.
This is coming back a little bit. This is how the sausage is made. It's not great. It's not pretty. Okay. So if we do that, um, we should get here. Yep. And what is PDO here? Mm-hmm.
Mm-hmm. Now I'm using the, um, I'm using, I'm using their base binding, so in Composer torso libsql, and then I'm trying to write, uh, I'm trying to
write a Laravel, uh, eloquent driver for that. On service provider 20. Boy,
I am a little bit lost. I'm not gonna lie. This connection that you get from the closure. So if I dump...
So the connection is a closure. There's the path to the file, and the driver is libsql. Yeah, I might be a little bit lost.
So here's the question: Is there some sort of PDO thing going on, uh, deep down that's specifically looking for... PDO might be looking for SQLite. It's just connection.
Boy, this is deep inside of, uh... Yeah, I can't do that 'cause we haven't registered it yet. Hmm. Let's look real quick at, um, Tobias enhanced, uh, Postgres Laravel.
Anything that Tobias does, I tend to think is correct. Zero downtime migration, enhanced service provider. Whoa. Oh, brother. Um, okay. So that's fine. That's fine. That's fine. Eloquent builder resolve for... Okay.
So connection resolver for Postgres. So he-- I think he's overwriting... I think he's overwriting the P- the Postgres one, which is interesting. Hmm, how can I click on that chat?
Let's see. There we go. All right, Adrian, I'm up for it. Let's try that. Let's try that. In register... Hmm.
This feels interesting. So when it's resolving DB Factory, when it's resolving DB Factory, this is from Adrian, uh, what is it? Nur- Nurenberger. Extend LibSQL. Connection
Factory doesn't have an extend. Oh, guys. We're just not getting very far, are we?
Who knows? UBlock dead in the latest Chrome? Adrian, that didn't work. We don't have an extend in Connection Factory. It's resolving DB Factory.
Connection Factory. No such thing as extend. Ooh, y'all, this might be a miss. I might need to do some research here. I thought I already did. Um, we're gonna kill that for a second and take some of those ideas.
Honestly, I don't know that it even matters 'cause we're not gonna... Y'all, this is a mess. I wonder if I should just work on the hotkeys for Solo right now, 'cause this is not going super well.
I think one of the problems is... Well, let's look at that connector. See, that's the exact same thing. Connection. Oh, Moby, thank you.
Connection extends the MySQL connection. So this is a driver that I wrote for SingleStore years ago. Yeah. There is already a Laravel driver for Turso, but it's based on a different SDK that they, uh, no longer want to use, and so they want me to rewrite, they want me to rewrite one that uses their new
SDK. Yeah, exactly. It requires a lot of, um, setup from the user. Okay.
You can do this. You can absolutely do this. Why can't you figure this out? Um, that's a good question. That's a good question. I think you can. Oh, no. Finder's locked up Um, hey, I can keep going.
I can keep going for like three more hours. Hmm. The current one... Oh, guys, I think my keyboard died. Let me get a new keyboard. Hang on. I have another one. Hang on. It's
gonna be hard to do anything if I can't get a keyboard to connect. Okay. Of course.
What do you look like? Um, that's not my call, Nanocell. That's above my pay grade. Man, what have we learned?
Have we learned anything? We've learned my keyboard doesn't work, so I gotta go get that one. Um, can I do this? Am I-- Is it possible? Can I pull this off? I think I can do this. We have learned that if you try to enable foreign keys...
I don't know that we need to continue worrying about this. Oh, don't, don't die. Um, I don't, I don't know that we need to continue worrying about this.
Let's look at... Boy, there's just not much there. Um, all right. Let me find a charger for my other keyboard, 'cause my backup keyboard is also not working.
All right. Give me two minutes. I'm gonna find a charger so I can wire my keyboard, and I'm also gonna go to the bathroom. Yeah, I think that's right, Alejandro, but I can't figure out where. Um, I don't have a keyboard, so I can't look up the docs on that. Yeah, that's not gonna work.
Um, okay. Let me go get a keyboard. Two minutes. I'm gonna also mute 'cause I'm gonna go, I'm gonna go get a soda and use the bathroom too. Give me two minutes Charging
the keyboard off of a portable battery. Which should-- shouldn't go wrong. Nothing bad should happen there. All right. We need to, we need to figure some stuff out. Let's go... I'm hesitant to look at the existing...
Oh. I'm hesitant to look at the existing LibSQL Laravel one because it's based on a fundamentally different, uh, completely different underlying technology. So... But we can look at it. Let's look at it. No, that's not right.
There's per-perhaps still something we can learn from this. Nope, that ain't it. This is what it's based on. That's actually what we don't want. I hope this gives you all some insight into how we're all just figuring things out, `cause, boy, it's not going great.
Um, so let's look and see in the existing one. Let's just walk through this. How do I get rid of that? I wanna get rid of that. There you go. Let's slow down and read a little bit. This is the existing one, package service provider from Laravel package tools, uh, from Spatie.
Yeah, p-pity. Um, okay. So, they don't even configure unless... Mm. I'm not sure that's right. So they replaced the entire lib s- they replaced the entire DB factory, which is interesting.
What do you look like? See, they're replacing... I don't think that's necessary. I just don't think that's necessary. So
their get PDO returns a LibSQL database. Okay, we're getting closer. Hmm.
This is interesting. Mm-hmm, mm-hmm, mm-hmm. So what I'm seeing here, this is wild to me.
I'm sure there's a reason for that, but I do not understand it. So get_read_pdo returns this get_pdo, which returns this DB, and this DB is DB, which... What is going on here, guys?
Hmm. So we're at a crossroads. Here's the question. This is potentially very interesting, provided I'm a little bit further. Should we keep struggling through, or should we switch to solo and do hotkeys, and I struggle through
this quietly alone in the dark? That's the question for y'all. What do you think? If you're happy to watch me struggle, I'm happy to keep struggling. No shame whatsoever in struggling live. But is it interesting? That's the question. If you wanna switch, say switch Let's go back to their service provider.
Adrian says switch. It's just so fascinating. I don't understand. I don't understand any of this. Like that... Oh, goodness, why would that be the case?
That doesn't make any sense to me. Adrian, I, I kind of agree. That's why I feel-- That's why I'm, I'm hesitant to look at this because it's like, am I learning anything? I don't know. I just, I just don't think this is right.
Um, I think here's what we're gonna do. I think I'm gonna, I think I'm gonna work on this offline and get to the point, because right now we're, we're just scaffolding. Um, I think, Alejandro, you're right, but I'm not sure.
So here's... I think it is trying to create a PDO connection based on something that doesn't exist, and we need to... Actually, let's go to... Before we give up, let's go to, uh, let's go here. Let's go here. And which one is the new one?
Yeah, the one that Levi made is the new one. That's the one we want. Official docs go nowhere?
Is that right? So do they have any... They have a doctrine one.
I think that's where I'm gonna end up, is building out... I think that's where I must end up, is building out a PDO interface. Um, so... God, y'all, we have got to update these docs.
These look so hideous. Yeah, I think this is the problem. I think this is the problem.
All right, we're gonna switch. I'm gonna figure this out. You're-- You better believe I'm gonna figure this out, but I'm not gonna figure it out right now. So condolences.
Um, we need to come back here. We need to get rid of this red herring. I will figure this out for you all. Terribly sorry that I failed, um, but that's okay.
We're just gonna whip that. We're gonna switch back to main. We're gonna implement some hotkeys. What do I need?
I need, um, I need to close... Actually, I can leave you open. And I need to open as well. Uh, where are you? You are here. All right. Whoof. Make sure I have Solo installed locally.
Repositories path Solo. Yes. Okay. So if we come back to Live OS, we're gonna implement some, uh, global hotkeys Oh, that's nice, Florian. I think I kinda did fail. Maybe I didn't.
That's okay. Um, feels like I failed, but that's okay. Adrian, I think that's correct. Um, I think that's correct, but I don't know if I need to do that, 'cause what I was trying to-- I was trying to take a little bit of a step and, like, step
forward, but then I got, then I got bamboozled and sidetracked on how do I make the SQLite PDO work. But then it was a spectacle. I can create a spectacle, but then I realized I'm not even trying to get the SQLite PDO to work. I need to implement the new one, and so I feel like I got rabbit holed a little bit, uh, incorrectly there.
So we're gonna come up for fresh air, and we're gonna look at these two PRs. So if we put this guy on this screen... Hey, who is that guy? Let's go full screen here. You see some private repos. This is what we're gonna try to do.
Um, add return. Oh, no, PHPStan. Oh, no. Um, guys, what do I do about this? What do I do about this? Because, uh, Laravel's, Laravel doesn't have return types.
Am I cool to just, like, add return types and it's fine? Uh, because Laravel doesn't have them, so if you go to Solo service provider, ignore it. That's kinda how I feel. Um, but, like, PhpStorm wants me to do it.
But if you go here, and then you go to service provider, the real one doesn't have it. So, I mean, I'm fine adding it. I guess it still works. Like, it doesn't complain. So I guess why, why is that okay?
I guess 'cause it's narrowing the type? I just feel like if I'm extending it, I would have to conform to their interface, but I guess I don't. I think I'm fine with that. Oh, but goodness, you know, the other thing is, this is, this
is a stub. This goes in there. You can just add that in your own, right? So I-- The stub shouldn't matter. Just change it in your own, right? I think that's right. I think that's right.
I think because it's a stub, I don't need-- I don't-- It's not my problem. Thanks for the idea, @Kyle. I think I'm not gonna merge this one since this is just the stub, and you can add the return types in your app after it's...
Apostrophe after it's, yeah, it's been published into your app. That feels easy. That feels easy to me.
Um, okay. So what we're actually working on is Vim key bindings and custom hotkeys. Two separate ideas. Two separate ideas that are both related.
Vim key bindings is cool. Here's what I don't like about just merging this as is. Um, interesting. Key right and key right arrow. I wonder what the difference there is. Um, this feels crowded to me, having two potential displays, and I also feel like people should be able to just customize these.
So that's what we're going to do. All right. What branch are we on? For Solo, we are on, let's switch to PR four, I think is where I started. View stash. We're gonna put the stash back. How do you restore the stash? And I just kind of-- Here's where I stopped before I started doing something else.
So if we look, I think what I wanna do is global hotkeys. I think I wanna have one place to register global hotkeys And that way, um, so if you come over to, come over to the dashboard and look, all of these hotkeys I feel like people should have control over.
Um... No, that's actually there. Oh, goodness. Wake up, PhpStorm.
Wake up. That's gonna take forever. So in your solo service provider, I feel like... Hmm, that's cool. I feel like, um, so how do we wanna do this?
So, like, I don't want Vim key bindings, but I wanna let other people have them. So we could do something as simple as use Vim keys, something like that. Here's the thing. If this is used amongst teams, then we're gonna need a, yeah, we're gonna need a configuration so that I can not have Vim key bindings and teammates
can. So I think we do need... I think we need Vim and not Vim. Should we just do that as a config Vim and what would you call that?
Uh, arrows? Arrows versus Vim. Does that seem right? That seems okay. That seems okay.
Register global hotkeys. So I've already extracted it from show dashboard. I think I need to at, to do, um, add current command hotkeys, uh, rather bind current command hotkeys.
Ooh, I need to do that down here. Actually need to do that. So this is the main loop that, like, draws the whole thing. Defulter Vim, that's nice. Um, this is the main loop function that draws everything. So you can see, catches up the scroll, then it renders the whole thing, then it listens.
Have a useKeyMode, which takes a set of key bindings. That's interesting. That's interesting. I wonder if... I feel like we need a new folder here. Let's do, um, keys.
Hotkeys. Um, let's try this. I don't get that joke, Florian. I'm so sorry. I feel like, um, this
should move here and should be just called hotkey. Big K or little K? I feel like little K is right. I know, Florian, that's like a-- I feel like L1 Ransom's always talking about normal mode, and I don't fully understand what exactly that means, but I understand it means something.
I don't think we need you anymore. We don't need you. I don't love this. The key manager, um... Let's do a little programming by wishful thinking. And if I'm in my... Use key bindings.
Key bindings. Key bindings, arrows. Vim, does that feel good? I feel like that's close.
We need the, uh, pull all hotkeys into the config. Daniel, that's actually helpful. Thank you. S- s- ch, ch, ch, ch. I think, um, this is good.
This is good. I'm proud of this. What if we just, like, power through and we say, um, default keys. Yeah, it's, um, it's--
they're all li- or they're all saved on YouTube, so you can find it on YouTube for sure. So how would this work if we took this and we were just like... Let's just copy this. Um, I don't know, I don't know what this is gonna be called.
This is... I don't know if I like this. We would need to pass through... I don't know if I like this. Do I-- I don't think I like this at all. I think I like something more like, um, something
like... That's not right. Yeah, we switched off of the Turso driver for a second. Um, Turso is, Turso is great for zero latency whatsoever, 'cause it's a local file.
But they also have these embedded replicas where you can, like, write to the local file, and it forwards off to the server, and then it syncs back down to the other side, which is kinda cool. So there's lots of good reasons for it. Um, do I like this better? So if I did C, and then this received the command.
Do I like this better? And you can say command clear. Uh, I think I do kinda like that better. I don't think I should know-- I don't think I need to know about the listener.
I don't think that's my problem. I think that's somebody else's problem. Um, so if I were to... I just don't like this. I don't think I like this at all. What do I wanna do here?
Let's do, um, key, which could be an array or a string, 'cause you could combine multiple key and handler. Um, let's just go ahead and just for now, we'll do it like this.
Um, this is also gonna be nice because if you come down here, they're duplicated. Um, so I don't like that. So we have it one place in the registration and one place in the display.
Uh, this was from the PR, and so I think this will be nicer. So if we do, um, we can make this an optional callable. So then that means we need to do...
Not up there, you doofus. Um, what do you do? You do that up here as well. Callable. Mm-mm, mm-mm, mm-mm. What, what are you complaining-- Why do you complain about everything?
Let's just leave that there for now. Um, display using. I feel like that should be closure. Okay.
Um, and then we need a handle, and the handle should receive the dashboard. Um, you're pr- probably gonna want command first, but that's okay. And then call user func, this handler, mixed
args one, two, zero or more. So we need to pass prompt and command. And then should I put the binder here? Oh, that's nice. Thank you. I appreciate you saying that.
Um- We're just gonna do this for now. I don't know. I don't know if I wanna do this here or if I wanna do this on the other side. I don't know. It feels a little goofy here, but maybe that's okay. Listener on this key.
Should I just call this keys? I probably should. And then listener on pass a callback. I need to think about that, actually.
I think this needs to go on the other side. Let's put that on the other side. So if I got rid of you, register global hotkeys is gone, and I had a default keys. Yep, I don't like that at all.
That feels gross. Oh, that needs to be makeable. Um, how do you do this? You do dot dot dot args, is that right? Is that right?
Let's look at the manager. No, let's look at the command. S-s-s-s-s-s-s. Okay. Okay, so this should be good so far.
And if we return this... So now we have a default keys group that returns keys. Uh, it should accept the prompt first. And then, so what if we did this?
What if we said that keys is new? This is gross, but it's fine. We're fine. Keys, TD keys. Mm-hmm, mm-hmm. No alt screen solo. Oh, wrong. No alt screen solo.
Oh, yeah. Programming by wishful thinking. Gotta make sure you actually implement your wishes. There are some keys, baby. Cool. We love it.
We love it. We love some keys. So now, we'll keep all of y'all right there. We need to do, um... So this is a hotkey key.
I think I can go satisfy some type heads if I do default keys, and then I can do, what do we do here? Hotkey. There we go. That one's for you, type freaks. Boom. Done. That's nice. I like that. So in here, I should have a key.
There's my first key. Mm-hmm. Mm-hmm. Mm-hmm. So now if I did listener, I gotta pull it in. Use listener. If I did listener on key... Ooh, I don't like that. I don't like-- That feels weird. Let's name this hotkey.
That feels a little better. A little goofy, but a little better. What are you complaining about? Callback is missing. I'm working on it. So then the callback, I think I can do, um, uh, call user func hotkey. I'm gonna pull that in.
Might be able to do a short closure. Hotkey, uh, handler. Do I need to do... I think I have one too many levels of indirection here. I don't think I need you. Oh, no, I can do that.
Do I want to, though? Hotkey handle. Maybe. Maybe. Why not? That's feels, that feels nice. Um, then I can do this and this current command, which then allows me to do convert to short closure.
Come on, PHP Storm. Come on, man. Killing me. Um, did that work?
Um, potentially. Potentially. I think I mucked up this guy's PR pretty badly, but that's okay.
Okay, so the C hotkey still works. None of the other ones should work. Yeah, none of the other ones work. Okay, that's cool. That's cool. Um, I like that.
But the question then becomes, SelectedCommand public. Sure does require a lot of intimate knowledge about how this dashboard works. Um, I think we can power through. Let's take all of you guys and come over to default keys.
And... Oh, it's a little wordy, isn't it? C we've already done. P. There's gotta be a nicer way to do this. I think we could potentially have a key value.
Pause, follow, restart. So we should have some other keys now. We should have pause. Oh, we don't have quit. Oh, Aaron, you silly, silly boy. Uh, we need to get quit working.
S-s-s-s-s-s-s-quit, I need you. I think this'll be a good refactor. Here's our first array, and we're gonna say, key, control C. So that is prompt quit.
I don't like how much knowledge these have to have of the dashboard, but that's okay. So I'm gonna close you. Um, where? One-fifty. Cool.
Those keys work. So we've got all of those keys. We don't have scrolling yet. And I think this is where... Got two clears. Mm.
I think this is where it starts to diverge with Vim keys. I'm pretty sure. S-s-s-s-s-s-s. Yeah. And so what are the Vim keys? Let's look at Aaron Francis Solo.
I feel like we're getting close. Let's just re-implement the current keys. Boy, this is so wordy. Why do I hate this so much? You can't have, you can't have a key... You can't have an array be a key, so you can't do it like this.
Can't do that. Can you have... I think you can have a weak map. Um, I think you could have a weak map, but nobody knows what a weak map is. Nobody's g- nobody's gonna like that.
Um. That just is so esoteric. You can't...
Yeah, you can't... Oh, yeah. No, that's stupid. Hotkey bind quit key.
Hotkey bind So you're saying basically, in some kind of like setup thing, you'd say hotkey.
Yeah, they don't need to know how quit is called. I agree. That's a terrible, that's a, that's a terrible, um, leaking of knowledge there. I almost feel like it should be like... I feel like that makes way more sense to me.
What do we think? I feel like that makes a lot more sense in terms of like... So then P becomes command pause. Actually, um, that's close. I feel like that's close.
This needs to be, um... What does this need to be? Um, it's almost like it needs to be... It's almost like it needs to be, um, 'cause it's not all off the command. It's like hotkey, actions, command, quit.
And this is command pause. This is... This feels a little bit better. F-R-Q. Uh, what's the top one? C-P-F-R-Q. And this becomes, what is that? Restart, follow, pause, clear.
It makes more sense to have clear command, pause command, follow command, but I don't like that those aren't alphabetical anymore, or right, uh, rather sortable. Yeah, probably. That's probably better.
We've got a lot of other keys. Um, stop and start, left and right, um, and then all the scrolling ones. So then somewhere, somewhere
we need to do some sort of mapping. Name it like the comments. I don't know what that means. The problem I think... Or if you're saying do it like this, I think that's probably...
Almost everything operates on the commer- current command log. Yeah, let's just keep going and see how that feels. So if we had, um, what would you do here?
Left. Left arrow. That's almost like previous process. Does this feel good to anybody?
Does this feel right? 'Cause then you could have up... I don't know what the difference between up and up arrow is. Um, scroll up. And then I do like how this reads.
Scroll down. I think I just saw a shift down, which is nice. Shift down, that's nice. What was I doing? Was I using shift down? Bum ba dee bum bum ba doo.
Yeah, I was. Good job, Aaron. Scroll down big. Shift up. I think I got those backwards. Nope, I did not. Scroll up big.
This is feeling Hmm. That makes more sense. Page up. And then I kinda want this to be hidden.
Kinda like that. Um, do I have this somewhere? Yeah. And so, like, let's say, um, display for this one. You're welcome. Yeah, hidden, hidden's better.
I feel like command should come first. That's what most people want. Will I have to do introspection, reflection maybe? So display only when command is paused. Why don't I have an is paused there? Um...
I don't have an is paused. Huh. I sure don't. They're public. Do I care? Stay focused.
It doesn't matter right now. I think this could be... S- s- s- um...
Yeah, this should be just hidden. Um, I think I also wanna... I need a way to say, um...
So what I have here is good 'cause it's the, it's like the actual key binding followed by the actual, like, rather pointer to what the actual action is. But I do feel like I want, like, the, um... Uh, just turn the brightness on your screen down.
It'll get darker. Um, I do kinda feel like I want the display name there as well. Which leads me back to wanting this style. Which is not incompatible with what we've done.
Maybe it just needs to be that. Guys, these decisions are kinda hard. I just wanted to, I just wanna do a good job.
That's all I've ever wanted. How does this feel? Does this feel better? Ah. I do like the fluent configurators, which
don't exist, but... Oh, sure it does. Um, okay, this may be close. So if we come back here, and we say that the handler is in fact, um, a string or a closure. Label at the end.
Yeah, but I'm gonna need, I'm gonna ha- uh, label will be required. I bet we can't launch this right now. Oh, great. Label will be required 'cause I have to show something at the bottom. You know what I mean? So I kinda want it in the constructor because it, it must be there.
Does that make sense? Uh... So I think I'm gonna leave it in the constructor, or rather put it in
the constructor. I do like the name label, though. Is this short enough to go on one line? Damn it. Yeah,
I think you can, and that's where this display will come in. But I guess if you're saying that you never wanna show it, you don't need a label, huh? I am sensitive to that. That makes sense to me. That makes sense to me. Um, okay.
That's fine. We can just, just leave it for now. That's fine. Um, that will show-- That will make it-- That will determine if it's displayed. And then...
Boy, this is... Maybe today's not my day. Maybe that's what it is. Maybe today's a bad day. Bad day, good day, no matter, gotta keep going. Um, this display. Okay.
So then, uh, this doesn't exist. Feel like, I don't know. We'll name stuff later. Um, okay. So if we called this key handler, um... Should make this an enum,
I think. I think I c- I like a capital H there. Um, how do you do a backed enum? Yeah, you just do that.
Cool. All right, so if we took... I feel like we're getting close, man. Actually, does it need to be backed? I don't know if it needs to be backed right now.
I don't think it needs to be backed. What am I gonna, what am I gonna do with the string? Nothing. What case do I want? I probably want Pascal. Hey, you're welcome, Alan.
That's very nice of you to say that. I, uh, you know, sometimes, here's, here's a little, here's a little truth for you. Um, sometimes I'll, like, get on a stream and totally bomb like I did earlier and feel like, what am I doing? Why am I, why am I even doing anything?
Um, and that's okay. That happens. But it doesn't mean it doesn't make me feel bad. Uh, next process. This is feeling better. So then we can come over...
I don't know what key manager's supposed to do, I'll be honest with you. We can come over here and instead of string or closure, we can say, um, key handler or closure. I do like that. That does make me feel better. Could do that, couldn't I?
I could do that, couldn't I? Uh-huh, I could do that. I could do that, couldn't I? What would that feel like?
What does key manager do? I don't think key manager does anything. Um, is it-- I think it's match this. Is that right? I think that's right.
I do like that that, um, that wraps all the knowledge up in one place. Enumeration methods Yeah, match this. This, I mean, this feels kind of cool. This is PhpStorm.
I don't need to return anything unless I wanna cancel, but I don't think I need to. Um, okay, so then if we did, uh, what is it? Is it static or self? Who can say? Uh, it's keyHandler clear. And that becomes...
I think that just becomes command clear. Oh, that feels pretty good. That feels pretty good. So if we take that and we yoink. Yep, and then, um, too many. Let's just...
Yeah, I don't know if I need a return. Do I? I don't know if I do. Okay, so then we can say, um, pause, follow, restart,
quit. Ooh, this is prompt quit. Uh, this is something else. I think I need to make a prompt method for that. Um, I think I need to make a prompt method for that.
Scroll up is command scroll up one, which is default, so I don't need you. Scroll, scroll down, and then I can just yoink these two, come down here, and y'all are... I mean, page is, page is, is just not really true.
Um, public function page down becomes, uh, this scroll down, this pane height. Let's just do less one. I don't know if that's gonna be right, but that's close.
Pane height plus less one line to keep context. I don't know if that's right. That's feels good though. Page down, page up. Uh, next, previous, and next process, I feel like I need to put that on the dashboard. Um, so if we did public function nextTab, I think is better.
PreviousTab, I think is better because there's a little bit of logic in here that I also want to dork around with. So on left would be previous, on right would be next. So next and previous, no reason to have all that space.
I hate that that wraps. That's fine. Okay, so then we can come back over here, keyHandler. This is prompt, uh, previous tab. I feel like I should rename the, uh, enum as well. Prompt next tab, just for naming consistently.
Consistency. Previous tab, next tab. That feels better to me. So let's make a little space here. Um, clear, pause, follow, and restart. We also need, um, so this is like process.
I mean, frankly, these are logs. This is processes. Yeah. Scroll up, scroll down, page up, page down. Processes. Restart.
I need a case start, case stop, and then you guys are pretty easy to figure out. Mm, I gotta order all of this. Um, where should you go? Does it matter? Super doesn't matter. Let's put you here and stop.
That feels good. Why are you complaining? Delete? Why would I delete it? What? What? Is my code that bad? You can unwrap all closures and use, uh Use the dot, dot, dot, um, like
that? That's pretty freaking dope if that works. I think you're right. I think you're freaking, freaking right, dude. Why
do I have to return the match? Whatever. Who knows? Hmm.
Okay, so I think I'm gonna start by returning these, which means I think I want to go back down. I
have... I think name should be in control of the user or the developer.
All right. So I think then you come down here. I don't think boot makes sense. And I think make makes no sense anymore. You go away. So this is now a key group. Hmm.
Guys, I don't know. Um... All right. So now if we try to run it again, what do we get? We get keys. Use
dynamic function instead. I don't know what that means. Um, what did I do? Hot keys, hot key line 16. Oh, I added that. All right, so there are all the keys. Honestly, I don't know if I like having the handler
over in the enum. I kind of agree. I don't know if I like that. Hmm.
I don't think I like this. Um, so
in this case, the handler... We know that the handler is either a key handler or a closure. So if we did... Oh,
that was stupid. Okay, so we know... I think I wanna do... Yeah, I'm, that's what I'm thinking, but I'm wondering... So, um, let's do, uh, let's just, let's just do it.
Uh, hot key handler instance of key- Oh, gosh. This and this current command.
Otherwise, call user func. Um. Nope, didn't work.
I've lost all hotkeys. True. Okay. So what did I do wrong?
Hey, Matthias. All right, let's change this one. Let's just change clear and try this again. Okay, so that wasn't the issue 'cause we're getting, still getting no clear here.
So if it's an instance of KeyHandler, feel like that should have worked. Um, let's try this. This current command clear. Let's just run clear. Listener on expects a callback, right?
Sure does. Um, okay. So that works. So why does, uh, duh...
Why does hotkeyHandler, which is an instance of KeyHandler, which definitely has a handle, this and this current command? Let's find out if-- I bet Adrian's already said the answer. Let's find out if we ever make it to the handle. Hey.
We're adding hotkey customization to Solo here. Hey, it made it. Cool. Oh, it's returning. Duh. It's not actually calling. Um, there you go. That's why. So let's do this.
Let's say, um, let's say that the handler equals... Let's compress this. Instance of KeyHandler. This is not actually handle. This is actually handler, to be honest.
It's returning a, it's returning a function. I wonder if command stays in scope there. That's interesting. That's interesting. When
setting the hotkey, do the detection there. Oh, you're saying do the compression or the coalescing over there? I don't think that's probably a good idea. Yeah, this is messy. Oh, guys, I'm just dorking everything up today. This is, this is hideous.
I hate this. Um, that's okay. Keep going. So let's do it. I think Adrian's probably right. Um. F,
guys. I'm all wrapped around the axle. I'm so lost. I think... Oh, my goodness gracious. So on construct, um, let's try this. If, uh, if handler instance...
No, I guess that's fine. Instance of KeyHandler. This handler equals this handler, handler, but then I can't call... Then we're back to this I don't have that at this point.
Uh, we're back to dashboard prompt and command, command, which means we're back to... Ugh. Okay.
Cool. Hotkeys work. Have we done anything that we like is the real question. We've done something cool. Okay. So let's first just get rid of all this.
Uh, no, we did. That's fine. Let's get rid of all this, and then see how we feel about just this. I think this is good.
I think this is good. Um, because then what we can do-- The real test is: Does it solve the problem? And I don't know if it solves the problem. Um. Because
then Vim keys... What are the Vim keys? We need to pull up that PR again. Man, can I just say that for someone who doesn't use Vim, putting a lot of effort into making Vim work. It's all for the love of the game, just for the love of the game.
Um, all right, so let's do this. So this is the Vim keys class. So I'm led to believe that J, uh, clear, pause, follow, restart, quit, previous, next.
Are we gonna even do-- There we go. There we go, there we go, there we go. I'm led to believe that J, oh, is... Scroll down. I'm led to believe that Control + D is, uh... Where are you? Control + D is page down.
So page down, key Control + D is page down. Scroll up, I'm led to believe is K and Control + U. Key Control + U. Okay.
Um, so the interesting thing is we only wanna replace the arrow and the scroll keys. Um, so we need to figure that out. H is previous process, previous tab. H and L are previous. Next and previous.
Okay, that's kinda cool. Um, so let's copy you guys. This does-- I will say this makes configuring keys a lot easier. H and, H and L is previous tab. Is that H is previous? Yeah. And next tab. Yeah. Okay. Okay.
That feels, um... That feels better, but I don't know how to do... I don't know how to then, like... I don't know how to eliminate... Boy, I don't know how to eliminate keys.
Like, at that point, these should not be registered anymore. Um, okay, so what I'm gonna do is I'm just gonna comment these out, and then I'm gonna come back here. Crazy take. Give me a crazy take. What's
your crazy take? Make an array key equals enum value equals key. Adrian, it's five o'clock. I, I need, I need a little more... I don't know if I fully understand that.
Um, so what is supposed to happen here? If I were to hit H, that should be left arrow, and it is. Cool. I can see why people would like this. I can totally see why people would like this. Yeah, these are cool keys.
I dig. Um, so Adrian... Yeah, man, Vim is wild. Vim is wild, and the Vim enjoyers are wild. Yeah.
But then, um, so I do, I do like that. But then you can't assign, you can't assign multiple... You could assign multiple keys to this if you did that.
No, I don't like that. That feels backwards to me. It feels backwards to me.
Oh, hey, Robin. Speaking, speaking of Vim enjoyers. Yeah, but here's the thing is I need to allow-- I also need to allow for this. You know what I mean?
And I can't set, I can't set a function as a key in an array. It's almost like I need to give every hotkey a unique ID of some sort, of some sort. But that feels like a real pain if I'm a user. Why do I care about that?
I do wonder if maybe splitting it up, and then Vim could subclass the default. And maybe I don't do merging.
Maybe I don't do merging at all. Um, if you wanna add your own... Nobody knows what a weak map is. That's the problem. Um, let's try this.
Clear pause, follow. What if we did this? Um, tabs.
And then, uh, clear... Is that in logs? Yeah, that's in logs. Clear pause, follow. Restart is a process one. Up and down are logs.
Did we already do those? We already did those. This isn't right. This isn't right. This is close, but this isn't right.
This isn't right. This is close, but this isn't right. Um, yeah, of course, it's fine to have
code duplication. The, the thing that I, like... I, I think I take a lot of, like Take a lot of, like, pride/pain in trying to make this really-- trying to make everything really, really nice to use, even if it means, like, eating glass on my side.
Um, and so that's what I'm trying to figure out is, like, how do I make this really, really nice to use even if it kinda sucks even if it kinda sucks to, like, build myself? Um, I don't know where stop and start went. So what if we did it like that, and then we just kinda, like, just
kinda killed that for a second, and then we did logs, processes, and tabs. And then, um, the Vim keys extends default keys.
I don't know if I hate that. I do hate that, actually. F me, guys. I hate that 'cause then you have to replace all of them, which is silly. Okay, this is interesting.
I think... Yeah, I don't like this at all, I'm gonna be honest. So the problem, I think, in my opinion, we just haven't cracked it yet.
I think the problem is with Vim, you just wanna replace a few keys. And so I think... Dang it.
I don't know what to do. Keep keys and just spread them in. Yeah. I do-- Okay, so held constant, I really like this.
I think this looks great. I really like that. The question is how do we implement Vim keys, and then how do we also implement custom hotkeys? It's almost like you need a remap function, but you need to be able to address a key directly, and
then this array, you can't rather, in this array, you can't address a key directly because it doesn't have-- You can't address a hotkey directly because it's not an associative array. Oh, hey, Andrew.
Thanks for hanging out. Um. That's an interesting idea. Put all of the hotkeys in a config file. I wonder if...
Sheesh. I wonder if the real answer is just have a-- maybe pull back one step and just have a configuration for Vim, not Vim. Maybe that's, maybe that's the real answer.
'Cause if I make a config, if I make a config with the keys, then I lose control, I lose control of those keys. Like, um, so I publish config into the user's app, app config or the config directory, and then let's say I wanna change, I
wanna change display to, like, show or something. I'm no longer in control of that, and so I feel a little bit scared about that. I don't think I have the right abstraction here. I don't think this is correct. I feel like maybe each individual key is correct.
And I also have to think about the ability for teams to say... Yeah, I feel like Vim default or make your own is- Is correct. Because I, I need the ability for one teammate, i.e. me, to not use Vim keys, and another teammate, uh, i.e. the Vim enjoyers, to use Vim keys in the same code base.
Which means that has to be config-driven, which means it has to be ENV-driven so that-- because the ENV is not committed. Let's try this. Um, s-s-s-s...
Let's-- This is potentially correct. Public function. Actually, we can pl-- Yeah, we can make this protected function. Um, what were all the Vim ones?
Down, down, previous, previous, page, page. Okay, so I think it's all of those. So if I take U and put U up here... I
don't know if standard is the right name. Extends default keys. Let's make it public. Who cares? Standard
keys, uh, Vim doesn't work. I feel like quit didn't work there. Uh, Control, Control + C.
There we go. So then if I switch this to Vim mode, and I do JK, uh, uh, yeah, I wasn't-- I'm not used to these. So J scrolls down, and then H scrolls left and right. Okay.
So then, um, keys should really be solo, uh, hotkeys, which can be... So then I can come to-- I think we're getting closer.
Uh, make theme. Public function. That's too close to useTheme. Feels like a whole nother registry. Um, what did I call it? Hotkeys? Is that what I called it? Hotkeys. This should return an array.
An array of, uh, hotkeys. Why is it so big? Simplify. Do I already have one? Who's hotkey? What in the world? Oh, import it.
So then hotkeys. So we should be back to default. We are back to default. Mm, let's
just do this for now. Some made-up thing, and then Vim returns an unknown
key. Unknown hotkey class. Fix that later. Yeah, that's fine. Okay, so then what did we say? Match Vim. So that should return Vim keys, which gives me H and L. And then let's say their config is set to default.
Cool. Feels better. Um- Oh, not with alias. I think then what needs to happen is... Let's try this.
Let's say that... Where's contracts? Hot keys. Oof, it's a big old interface. We just actually have one, a public function keys.
I feel like we're getting close, which is good 'cause I am losing steam. Uh, hot key. What are you complaining about? Oh, did I do that wrong? I think I probably did. So then
default keys. Yeah, I think I got it. Implements hot key. Hot keys is silly. That should be, um, hot key provider. Which means this can become hot key provider.
Default is default keys. Vim keys. I feel like PHP Storm doesn't, doesn't like generics very much. So then if we, we can come back down to, what is it?
Hot keys. Um, uh, hot, hot keys defaults to default.
Uh, it's actually key is correct. Um, so, uh, class, is that legal? I don't know if that's legal. Yeah, it looks like it. Uh, is arg get this... What did I name it? Keys.
Hmm, it's fine. So then, if we call this keys, key... Well, I, we'll need to add some error handling and some caching.
You don't know what you're gonna be, do you? Yeah. That's fine. So then, this should actually work now. Um, we'll do some error handling later.
Okay, so that should be default keys. Um, yeah, probably. Yeah, I guess then we wouldn't need a registry at all, huh?
That's probably true. Solo.hotkeys, set it to Vim. So then we should have Vim keys now. And we do, um, but sure, let's...
Yeah, we can get rid of that. That's fine. I like that better. Uh, keys. We don't need a registry at all. Should I do that with themes? Maybe. Probably. Hot keys. Um, hot keys or default keys class, um, implements.
What's the name of the interface? Hot key provider. I feel like it should be called provides hot keys. Um, what do we say here? Um- I guess I'm not guaranteed that it's an actual class either.
Uh, is instantiable. Instantiable. Uh, is a works with FQCNs is a object or class.
Yeah, cool. Cool. That seems easier. Um, if not, is a object or class, class. Is a first one.
Okay. So if hotkeys, if it's not an instance of hotkey provider, then freak out. I'll fix this later. Hotkeys must implement... Oh,
allow string true. So at this point, we know that the... This is a fully qualified class name, so we can return new hotkeys, keys.
And that's better because now it knows what, what it is. So by default, it's default. Uh, so if we default keys, cool. Um, and if we were to say config set solo.hotkeys to vim keys just for pretenses.
Cool. I like that. Um, okay. So then, does that go in source stubs? I think that does go in stubs, doesn't it? The provider. Or I'm sorry, the config. Uh, solo.php.stub.
I never remember where this stuff is supposed to go. Let's look. Here's one I was looking at the other day. Waterline apps, waterline service provider, config. Assets. That's not what I want. There you go.
Keys could be a static method, but it's, um... My headphones are dead. Keys could be a static method. Um. Oh, oh, oh, oh. On the, the interface. I see. On the... Yeah. That's a good point. That's a good point. That is a good point. That is a good point. All right, we're gonna put it in...
Yeah, we're gonna put it out here. Hmm. Yeah. Oh, guys. Okay, we're almost done. Config solo.php return. Um, okay.
I don't think we need the big guy. Where else do we have config solo.theme? So that, you know, right now that's just a key. Which maybe I wanna change config. Config solo.hotkeys.
Um, hotkeys. You know why?
You know why I did it as a string? I did it as a string so people could do this in their ENV. Because you can't put-- I mean, you could, um, but putting a fully qualified class name in an ENV variable is a little goofy.
So, they would end up having to do something like this. Like if a team... You see what I mean?
Like, um, that should be... So here, they could just do this. In fact, I probably should. Um, ENV solo theme, by default it's dark. And here- Key bindings.
It's the first time I've used key bindings. That's kinda nice. By default, it's default. See what I mean? So I feel like for the sake of ENV, it would be better to go back to the registry idea. So that in my ENV, I can have default, and in yours, you can put VIM, and it just works.
You know what I mean? I kinda like that. Uh. Is my little...
Yeah, it does. Um, the provided-- I probably need to put this on a new line. The provided, we have provided, um, light. Yeah, it is more convenient. Light and dark themes.
If you prefer to register your own theme, you are free to do that via the facade solo register theme name and iAwesome theme class.
Okay. So then let's take you... Boy, how does Taylor do these close? Let's just, um...
Yeah, that's fine. I can fix that later. Yeah, we have to have a whole new, um, we have to have a whole new register theme.
There you go. So you gotta have one of those for register key bindings. Which I don't think I'm gonna do right now. I think I'm gonna, I think I'm gonna call it. It's 5:30. Let's see what's going on. We've been streaming for three hours.
All right. Let's call that quits for now. Um. Oh, look. Look at what good guy Josh did. Oh, he's so fast. That's crazy.
I'm so curious what he says about it. What is Fission? Oh, it's his kit. Okay. Ooh, I'm so excited to see what he says about it. This is so cool.
He already did that. Just wanna see it running. There you go. Hey, look at that. That friggin' rules. That's so cool. Oh, man.
That's awesome. Thanks, Josh. Cool. Um, okay, so kind of a weird day, huh? I don't feel like this was my best day ever. Um, but that's okay. Nevertheless, we persist. Um, so I need to go watch Josh's video.
Ooh, I'm excited to go watch that. Um, okay. Thanks for hanging out, Adrian, ets, and et al. Thanks for all of the help. Um, yeah, Josh, I gotta make a React video, and then he's gonna make a React React, and it's, you know, round and round we go. Um, okay. So I will finish this up probably, uh, you know what?
Probably not this weekend, 'cause I got four kids. Um, so I don't do much on weekends anymore. But I will finish this up so that the VIM enjoyers can have their VIM key bindings. Um, and I think, I think I landed somewhere that I'm happy with. Um, but it sure did take a while, didn't it?
I don't think I like the name Standard. Um, but it sure did take a while. But hey, you know, we got there in the end. So thank you all for hanging out. Um, thanks for walking, or helping me figure out all of this stuff as my brain slowed down. I will see you next time. Um, I'm gonna figure out this Turso PDO thing, and then I'll come back on, uh, I'll come back on next week, and we'll, we'll actually do some, some Turso stuff.
So, so long friends. Thanks for hanging out. See you next time.