Jack's Notes
Pages
-
Explore
- Nifty, my first link!
-
contents
Journals
-
Sunday, November 6, 2022
- It's nice to see this set up properly! I have exporting to my repo set up and it looks decent.
:has()in #css is an absolute game changer. Declarative will always win.- #TODO set up POSSE for my notes. Opt into crossposting with tags.
- #TODO figure out DMV registration
- #TODO code formatting on my personal website.
- #TODO graphs for notes on website
- #TODO #oss my tailwindcss color config.
- #TODO can I use enhance-ssr + cloudflare instead of begin.com?
-
Friday, October 21, 2022
- Hey mom and dad, this will be an incredible weekend and I'm extremely grateful for all you've done, and the daughter you've raised. I have loved every day I've spent with her, and I'm beyond excited to spend the rest of our days as a family.
- I love you both. Thank you.
-
Monday, October 10, 2022
- Send Ghazal your Store research/proto
- Update the PR about Print Refactoring, loop Jenkins Into it.
- Add Brands to Icons (sg, twitter, fb, email, etc)
-
Friday, October 7, 2022
- Little prince
- You shouldn't try so hard to be perfect. Trust me, perfect should try to be you. Bo Burnham
-
Sunday, October 2, 2022
- Post web component world
- Check MACC pottery
-
Friday, September 30, 2022
- Setting up logseq on my android was a pain, glad I know what's needed now, but golly, what a time sink.
- I'm setting up auto uploading on my avetta computer and pixel.
- Auto uploading from the Avetta computer works!!
- I'm glad I got this all set up on my android
-
Tuesday, September 20, 2022
- [[Regex]] to find all record type aliases in [[elm]]:
type alias.*=\n \{.?(.|[\n])*?\}
- [[Regex]] to find all record type aliases in [[elm]]:
-
Monday, September 19, 2022
Variance Status Usage
On each of the Flag Detail Pages, these are the only places flag.varianceStatus is used.
Pseudo Code of Supplier App Flag Action Column Logic:
if List.member flag.flagResult [ Amber, Red ] then if supplierCanRequestVariance then case flag.varianceStatus of Unknown -> if List.member flag.id rejectedFlagIds then varianceRejected else requestVarianceButton SupplierDocRequested -> varianceNeedsMoreInfo VarianceApproved -> varianceApproved VariancePending -> varianceInReview VarianceReReview -> varianceInReview SupplierDocProvided -> varianceInReview SupplierRequested -> varianceInReview VarianceRejected -> varianceRejected VarianceClosed -> blank else varianceNotAvailable else blankPseudo Code of Client App Flag “Action” Column Logic:
let variancePending = List.member flag.varianceStatus [ VariancePending, SupplierRequested, SupplierDocProvided, SupplierDocRequested ] in if flag.flagType == "siteVariance" then if canViewVariance then viewButton else blank else if (not isForced) then if variancePending && canViewVariance then varianceInProgress else if canCreateVariance then forceFlagButton else blank else if canViewVariance then viewButton else blankDo these seem like they’re set up to perform the correct behavior? I can translate to english if that’d be easier, but the visual hierarchy of the code indentation seemed to do a better job communicating dependencies than english when I first tried to write it out.
My 2 cents
Disclaimer: I don’t have as much context as folks who’ve been around this codebase for longer, but from my previous experience with relational data in elm, I see areas where tweaks to our data-structures, Decoders, and Endpoints could prevent a whole category of bugs/workarounds.
The Most Fragile Part of this System IMO: We run a risk of data going stale here. It’s a data-structure issue. flag.varianceStatus is relational data. That data technically belongs to the variance, not the flag. This flag.varianceStatus field simply reflects what state the variance.status was when the flag was last fetched. (It is only fetched on page load)
Here’s an explanation of why that’s a problem: Since we are referencing the relational flag value and not the native variance value, if a user updates a variance and receives the new variance data, the data on the flag details page will be inaccurate/stale. It’s common and good practice to return the new data when an HTTP request makes updates. However, changes to the variance (such as status), wouldn’t and shouldn’t need to update our flag type, since those values didn’t change. However, because we’re storing relational data on our flags, that’s exactly what we’ll need to do to keep the data fresh. So what’s the easiest way get totally accurate and fresh data when there are several relational fields? Refresh the whole page.
Here’s an example of that problem in action: If you make changes to a variance, your browser will refresh when you return to the flag details page. Your screen will go white, you’ll be faced with a loading spinner, and you’ll be waiting for the initial payload to finish before being able to view the page. All of that (as far as I can tell), is to update 4 relational fields for one flag on the flag detail page. This page reload is about 3.5MB on refresh. It takes a couple seconds on my machine to get a full refresh, I’ve got a pretty good computer and connection, but I’m also running on dev, so YMMV.
TL;DR: We’re looking at something which could be solved with 2kB response and normalized data-structures ballooning to a request that is 1750 times larger (~3.5MB) and a page refresh because we’re using relational fields.
My Suggestion: To avoid conflicting/stale data, we should remove non-id relational fields. This is a bigger refactor than it sounds like, but I think it’d be worth it.
Here’s a Youtube video which goes into greater depth about this normalized data pattern: https://www.youtube.com/watch?v=28OdemxhfbU
-
Wednesday, September 14, 2022
- ADP clockout
-
Monday, September 12, 2022
- Check if [[ryan diep]] has a multi step form.
- See if I can talk with [[Ghazal]] about why we opt for MPA over SPA data management? Why aren't we taking steps toward SPA patterns?
-
Sunday, September 11, 2022
- Feels like the
bg-[color]-[X00]pattern in tailwindcss is a bandaid on the issue that browser handling of colors is far too inhuman. people don't think inrgb.hslisn't perceptually uniform. If we could useLCHinstead, it could open us up to even more natural approaches to color in UI design. The upshot of this approach is pseudo selectors could modify lightness and chroma to create uniform interactivity across colors, without needing to manually set behavior for each state/color combo. We could set the behavior in one place, and it'd work on all colors. Perhaps falling back on HSL is adequate in this rocky period in browser adoption. Maybe an--hsl-shiftvariable that'd be set with each hue could indicate the difference between 50% and the point where black/white are equally a11y. #css #design-systems #color
- Feels like the
-
Friday, September 9, 2022
- I keep thinking I'll have the perfect note to start a journal, but I don't. So I'm writing this so I can stop looking at this like something seeking quality over quantity, and start using logseq properly.
- Don't update the the global
.supplierFlags. instead store fetched supplier flags on the page, then union the fetched and global for the Compliance Variance ViewModel. #avetta #TODO
-
Saturday, September 3, 2022
- What will it take to set up with my website?
- Could I make an api or something?
- I’m sure this could be neat with 11ty
-
Friday, September 2, 2022
- Hello World
- New Content
- Another row
- [[Explore]]
- Will this work from my iPad?
- This is a neat app, I’m really enjoying it.