Readit News logoReadit News
dailker commented on     · Posted by u/dailker
dailker · 6 months ago
Just spent the morning fixing a frustrating test suite failure in OrbitOS, our open-source web-based operating system. The issue was classic - framer-motion components breaking Jest tests with the dreaded "Element type is invalid" error. For anyone building complex React UIs with animations, this might be useful.

We're building OrbitOS (https://github.com/codehubbers/OrbitOS) - essentially a desktop operating system that runs entirely in your browser. Think Windows 95 meets modern web tech. The project includes draggable windows, snap-to-edge functionality (like Windows Aero Snap), a taskbar with live clock, built-in apps (calculator, notes, file manager), and a full theming system. It's been a fun challenge pushing the boundaries of what's possible with React and modern browser APIs.

The window management system uses framer-motion for smooth animations - windows scale in/out when opening/closing, drag with momentum physics, and snap to screen edges with visual previews. Everything worked perfectly in development, but our CI pipeline was consistently failing because Jest couldn't understand framer-motion's custom components like motion.div and AnimatePresence. When Jest tries to render these in its JSDOM environment, it gets undefined instead of actual components.

The fix was creating proper Jest mocks that preserve the component structure while eliminating the animation complexity that Jest struggles with. Instead of just mocking framer-motion to return empty objects, I mapped motion.div to regular div elements and made AnimatePresence a transparent wrapper that just renders its children.

The interesting part was maintaining test coverage for the actual window management logic. Our tests simulate real user interactions - mousedown on title bars, mousemove to screen edges, mouseup to trigger snapping. We test all the snap zones (left/right halves, quarter-screen corners, maximize on top edge) and edge cases like rapid mouse movements and zero-dimension windows. The mocking strategy preserves all this functionality while just stripping away the animation layer.

The window snapping algorithm itself is pretty neat - we calculate snap zones based on cursor proximity to screen edges with different thresholds for corners vs edges. The state management uses React Context with a reducer pattern to handle multiple windows, z-index ordering, and position/size tracking.

One thing that surprised me was how well modern browser APIs work for desktop-class interactions. We're using ResizeObserver for responsive window content, IntersectionObserver for taskbar auto-hide, and the Pointer Events API for handling both mouse and touch interactions. The File System Access API (where supported) even lets us save/load actual files to the user's computer from our web-based apps.

The project is completely open source and we're actively looking for contributors. If you're interested in systems programming, UI/UX design, or just want to see how deep the rabbit hole goes with modern web APIs, check out the repo at https://github.com/codehubbers/OrbitOS. We have good first issues tagged for newcomers, and the codebase is well-documented with architectural decision records explaining why we chose certain approaches.

Would love to hear from anyone else working on desktop-class web applications or dealing with similar testing challenges around animation libraries. Also curious about performance optimization strategies for complex React UIs - we've learned some hard lessons about what works and what doesn't when you're trying to maintain 60fps with multiple draggable windows.

The testing infrastructure we built could probably be extracted into a separate library for anyone dealing with similar framer-motion + Jest issues. Let me know if there's interest in that or if you want to dive deeper into any of the technical details.

dailker commented on A modern, modular utility library for C developers   github.com/dailker/everyu... · Posted by u/dailker
HelloNurse · 6 months ago
Regarding documentation, comments in tens of .h files in third level directories are very user unfriendly, regardless of their quality (which seems fairly good). You need:

1) an overview of the available functionality, design choices, aspects that need feedback and contributions etc.

2) a guide of what headers every function or macro is located in (consider fragmenting headers less, possibly adding "umbrella" headers that just include a set of the current headers that is likely to be used together)

3) generated API docs in the web site.

dailker · 6 months ago
Thanks for insight. I will definitely consider your critic.
dailker commented on     · Posted by u/dailker
dailker · 6 months ago
Hi HN,

I’ve been working on a personal project called Dragon’s Vault, a web-based encrypted chat platform built from the ground up with zero-trust architecture. The core idea is simple but ambitious: even if the server or database is compromised, your messages should remain completely unreadable.

The system uses multi-layer client-side encryption: AES-256-GCM for the first layer, XChaCha20-Poly1305 for the second, and RSA/ECC for key exchange. Everything happens in the browser: the server only ever sees encrypted blobs. Even metadata like timestamps and usernames are encrypted, and encryption keys are stored securely in IndexedDB.

Some of the features currently implemented:

End-to-end encrypted one-on-one messaging

Friend-based system with requests and approvals

QR code sharing for profiles

Real-time notifications

Multiple UI themes (dark, light, ocean blue, neon)

Fully responsive design for desktop, tablet, and mobile

From a development perspective, the project is built with Next.js, a MongoDB backend, and client-side cryptography libraries. There are clear abstractions for encryption, key storage, and authentication, making it easy for contributors to pick up and extend features.

I’m sharing this here because I’m looking for:

Feedback – on the security model, UX, and overall architecture

Feature ideas – are there ways to make encrypted social chat more usable without compromising security?

Contributions – anyone who wants to help improve code, add features, or enhance security documentation

The repo is open source: https://github.com/dailker/dragons-vault

I’ve put a lot of thought into balancing strong encryption with usable social features, but this is very much a work in progress. I’d love to hear from anyone interested in privacy-first messaging or client-side encryption. Even small contributions, security reviews, or suggestions are incredibly valuable.

Thanks for reading.

dailker commented on A modern, modular utility library for C developers   github.com/dailker/everyu... · Posted by u/dailker
dailker · 6 months ago
Hey HN,

I want to share everyutil-c, a C utility library aimed at filling in gaps beyond the C standard library, with performance, modularity, and cross-platform consistency as first-class requirements. Below are some of the technical design decisions, recent improvements, and open areas where I’d love feedback or contributions.

Everyutil-C is meant as a “standard library extension” for C projects — lightweight, dependency-minimal, and structured so you can pull in only what you need. Key subsystems include:

1. dynamic array abstractions, safer iteration, bounds checking, contiguous resizing, insertion/removal, possibly span/view-like APIs.

2.enhancements over strlen, strcpy/strncpy, concatenation, splitting, trimming, maybe UTF or ASCII “safe” operations.

3. parsing, formatting, safe arithmetic (overflow detection), maybe integer ↔ string conversions.

4. wrapping malloc/free with alignment options, optional debugging hooks, etc.

5. handling Windows vs POSIX differences, proper __declspec(dllexport) stuff, platform detection, conditional compilation.

Recent Technical Milestones

1. Improved performance of iteration (fewer bounds checks, perhaps more inlining).

2. clearer ownership semantics, avoidance of buffer overruns in growth/resizing.

3. cleaner internal structure, possibly splitting core and helper functions so that the minimal subset (e.g. fixed-size dynamic arrays) can be used without pulling in everything.

4. Support for Make, Autotools, and CMake so as to integrate with different build pipelines.

build.sh script to automate configuration, especially helpful on MSYS2/Windows, where toolchain quirks (path separators, runtime linking, DLL visibility, etc.) can be a headache.

Proper handling of DLL exports on Windows; ensuring symbols are exported appropriately, avoiding linker errors.

Testing & correctness

Full test suite covering edge cases (zero length, null pointers, huge sizes, overflow).

Cross-platform tests to verify behavior is consistent on Linux, macOS, Windows.

Automated CI likely (or recommended) to verify builds under different compilers (gcc, clang, MSVC or mingw).

Technical Trade-offs & Design Choices

Some of the tricky technical decisions/constraints and how I addressed (or plan to address) them:

Minimal dependencies vs feature richness. I avoid bringing in large external libraries; aim is to stay in “pure C99 (or close)” so users don’t have to link dozens of other libs.

Memory allocation strategies: resizing vs doubling, growth factors, freeing, fragmentation. Trying to keep it reasonable without over-engineering.

Symbol visibility & binary interfaces: ensuring that the API headers are stable, and that users who build shared libs / static libs get consistent behavior. Handling extern "C" for C++ usage, etc.

Portability quirks: Windows’ path handling, _snprintf vs snprintf, difference in size_t, alignment issues; ensuring macros / config headers detect and adapt.

What I’m seeking feedback on

Are there any missing utility subsystems people commonly need in C that would integrate well here (e.g. logging, formatting, serialization)?

How do people prefer safe vs unsafe APIs: do you want always safe, or ability to sacrifice safety for speed?

What patterns for versioning/stability are helpful: semantic versioning, API deprecation path, binary compatibility?

Experiences integrating similar libraries (stb, klib, GLib, etc.): what patterns or pitfalls do you want to avoid?

Suggestions around documentation / API specification style: inline comments, header docs, external reference, examples.

Repo: https://github.com/dailker/everyutil-c

If you find it useful, I’d appreciate a on the repo.

Thanks, @dailker

dailker commented on Everyutil-C – A modular, cross-platform C utility library   github.com/dailker/everyu... · Posted by u/dailker
dailker · 8 months ago
README.MD to navigate on GitHub via markdown links
dailker · 8 months ago
oh i got you i will add that to C version. I was kinda lazy after JS. Definitely loved that idea! Thanks
dailker commented on Everyutil-C – A modular, cross-platform C utility library   github.com/dailker/everyu... · Posted by u/dailker
laveur · 8 months ago
The lack of API doc's for the c version is kind of frustrating. It makes it impossible for someone to evaluate whether or not your library is suitable for something they need. Or if it is, how to use properly.
dailker · 8 months ago
README.MD to navigate on GitHub via markdown links

u/dailker

KarmaCake day8July 12, 2025
About
Hi, I'm Ilker Ozturk Student | Full Stack Developer | Lifelong Learner

I'm a passionate full stack developer with a strong focus on clean, scalable code and intuitive user experiences. From building full-featured web apps to experimenting with side projects, I love turning ideas into reality with code.

Founder of CodeHub – a collaborative space for open-source devs Always learning, always building – currently exploring backend architectures and DevOps Open to interesting projects, collaborations, and hackathons

Portfolio: www.theilker.com GitHub: @dailker

Let’s build something cool.

View Original