Skip to content

Instantly share code, notes, and snippets.

View fgeierst's full-sized avatar

Florian Geierstanger fgeierst

View GitHub Profile

The Algorithmic Hand: A Comprehensive Analysis of Touch Adjustment Heuristics in Browser Rendering Engines

1. The Variance of Human Input and the Necessity of Heuristic Interpretation

The evolution of the World Wide Web from a pointer-driven interface to a touch-first ecosystem necessitated a fundamental re-engineering of how browser engines interpret user intent. In the desktop paradigm, input is deterministic: a mouse cursor is a single pixel coordinate $(x, y)$ that intersects with the rendering tree in a binary state—either the cursor is over an element, or it is not. The "hit test" is a precise ray-cast operation.

However, the capacitive touchscreens that define modern computing introduce a layer of analog ambiguity to this digital precision. When a human finger contacts a glass digitizer, it does not act as a pixel. It creates a "contact patch," a deformed ellipse of flesh that can range from $8mm$ to $20mm$ in diameter depending on pressure, finger size, and angle of attack.1 The hardw

@fgeierst
fgeierst / devcontainer.json
Created January 7, 2026 11:16
Copy Claude config from host to devcontainer on initialization
"initializeCommand": "bash -c 'docker run --rm -v \"$HOME:/source:ro\" -v \"claude-code-config-${devcontainerId}:/dest\" --user root node:24 sh -c \"if [ -d /source/.claude ]; then cp -r /source/.claude/* /dest/ 2>/dev/null || true; fi; if [ -f /source/.claude.json ]; then cp /source/.claude.json /dest/ 2>/dev/null || true; fi; chown -R 1000:1000 /dest\"'",
@fgeierst
fgeierst / design-tokens-file-snapshots-glob.spec.ts
Last active December 8, 2025 09:13
Design tokens snapshot test vitest
import { describe, it, expect, beforeAll } from 'vitest';
import fs from 'node:fs';
import path from 'node:path';
import { globSync } from 'glob'; // requires: npm i -D glob
const BUILD_DIR = path.resolve(__dirname, 'build');
const SNAPSHOT_DIR = path.resolve(__dirname, '__snapshots__');
describe('All Build Outputs', () => {
// 1. Find ALL files in build dir (ignoring folders)
@fgeierst
fgeierst / component-event.e2e.ts
Last active July 5, 2025 13:16
Playwright Event Testing with insertAdjacentText
import { expect, test } from '@playwright/test';
import type { Dropdown } from './dropdown.js'; // Assuming Dropdown type is available
test('should emit a change event and signal in DOM', async ({ fastPage, page }) => {
// fastPage.setTemplate sets up the component under test
await fastPage.setTemplate({ attributes: { type: 'combobox' } });
const { element } = fastPage; // element refers to the fluent-dropdown
// Step 1: In the browser context, attach an event listener to the component.
@fgeierst
fgeierst / event.e2e.ts
Last active July 5, 2025 13:17
Playwright Event Testing Pattern
import { expect, test } from '@playwright/test';
test('should emit a custom event on interaction', async ({ page }) => {
// Assume 'my-component' is a web component that emits a 'custom-event'
await page.setContent(`
<button id="myButton">Click Me</button>
<my-component></my-component>
`);
const myComponent = page.locator('my-component');
const myButton = page.locator('#myButton');
@fgeierst
fgeierst / index.html
Created April 26, 2025 13:04
playground-elements
<link
rel="stylesheet"
href="/node_modules/playground-elements/themes/neo.css"
/>
<script type="module" src="/node_modules/playground-elements/playground-ide.js"
></script>
<playground-ide
id="playground"
resizable
@fgeierst
fgeierst / git-commit-msg.md
Created September 2, 2023 09:02
Semantic Commit Messages
  • feat for a new feature for the user, not a new feature for build script. Such commit will trigger a release bumping a MINOR version.
  • fix for a bug fix for the user, not a fix to a build script. Such commit will trigger a release bumping a PATCH version.
  • perf for performance improvements. Such commit will trigger a release bumping a PATCH version.
  • docs for changes to the documentation.
  • style for formatting changes, missing semicolons, etc.
  • refactor for refactoring production code, e.g. renaming a variable.
  • test for adding missing tests, refactoring tests; no production code change.
  • build for updating build configuration, development tools or other changes irrelevant to the user.

Source: http://karma-runner.github.io/6.4/dev/git-commit-msg.html

a:not([class]) {
/* Relatively sized thickness and offset */
text-decoration-thickness: max(0.08em, 1px);
text-underline-offset: 0.15em;
}
/* https://moderncss.dev/modern-css-for-dynamic-component-based-architecture/ */
@fgeierst
fgeierst / visually-hidden.css
Created May 30, 2023 09:41
Short visually hidden utility
/* Visually hide an element while still making it accessible for screen readers. */
.visually-hidden {
position: absolute;
transform: scale(0);
}
/* https://www.scottohara.me/blog/2023/03/21/visually-hidden-hack.html
* https://codepen.io/scottohara/pen/QWVOqNY
*/
@fgeierst
fgeierst / Main.js
Created July 26, 2022 12:06
Islands architecture with TYPO3+Rollup+Svelte
import Test from './Test.svelte';
// Mount Svelte component
const test = new Test({
target: document.querySelector('#test')
});