3.3 KiB
3.3 KiB
Tab Harbor Agent Guide
This file captures project-level design and implementation constraints for agents working in this repository.
Design Direction
- Tab Harbor is a quiet browser workspace, not a SaaS dashboard, wallpaper page, or gamified productivity product.
- Preserve the calm / literary / composed identity. Interfaces should feel like a reading desk or paper workspace.
- Prefer scanability over spectacle. If a change makes the page louder before it makes it clearer, reject it.
- Keep secondary controls quiet. Theme controls, drawer triggers, archive actions, and helper affordances must not visually outrank tab content.
- Avoid decorative chrome that does not improve hierarchy, orientation, or atmosphere.
UI Guardrails
- Do not rely on hover alone for critical controls or discoverability.
- Keyboard focus must stay visible and usable.
- Reduced-motion users must still understand every state change without animation.
- Compact controls still need comfortable hit targets.
- Theme changes must update the full environment, not just local controls.
Interaction Lessons
- Floating editors triggered from compact controls should anchor near the triggering element when practical; default corner placement is only a fallback.
- For dense icon reordering, prefer explicit grid tracks over
flex-wrapwhen cross-row drag behavior matters. - For icon drag-and-drop previews, use
ghost + slotinstead of converting the original node toposition: fixed; keep the dragged visual under the pointer and the layout slot in the flow. - Drag preview hit-testing should be based on stable slot positions captured at drag start, not on the currently reflowing DOM alone.
- FLIP animations in reorderable icon strips should only run for nodes whose order actually changed; avoid re-animating unaffected siblings.
Frontend Architecture
- This project is plain HTML, CSS, and ordered
<script>tags with no bundler or ESM module system. - Script load order is part of the runtime contract. Treat changes to
index.htmlscript order as high impact. - Top-level bindings can collide across files. When destructuring from
globalThis, use file-scoped prefixed aliases instead of shared short names. - Keep
extension/app.jsas a thin orchestrator entry. Do not let it grow back into a catch-all runtime file. - Prefer responsibility-based module boundaries such as:
ui-helpers.jstheme-controls.jsdrawer-manager.jsdashboard-runtime.js
Refactor Safety
- After any script split, actively check for startup-time failures such as
Identifier has already been declared. - A passing
node --test extension/*.test.jsrun is necessary but not sufficient for startup refactors. - If the page shows static scaffolding but not dynamic tab data, first suspect runtime initialization failure before changing data logic.
- For startup regressions, inspect real browser console/runtime errors before continuing to refactor.
Validation
- Run
node --test extension/*.test.jsafter code changes that affect UI structure, script loading, or runtime behavior. - For script-loading or initialization changes, also verify the extension in a real browser session.
Reference
Detailed rationale and lessons learned live in:
docs/design-principles-and-lessons.md.impeccable.md