Skip to content

refactor(web): cleaned up web/src structure - #776

Merged
exploIF merged 1 commit into
mainfrom
@ksienkiewicz/refactor-web-src-structure
Aug 18, 2026
Merged

exploIF merged 1 commit into
mainfrom
@ksienkiewicz/refactor-web-src-structure

Conversation

@hejsztynx

Copy link
Copy Markdown
Collaborator

Summary

A lot of files were just dropped were just dropped into src/web directory, which was messy. Grouped the files according to their existential purpose.

Compatibility

OS Implemented
iOS
Android
Web

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (N/A)

Copilot AI lite review requested due to automatic review settings August 14, 2026 19:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the src/web folder structure by moving web-specific helpers into clearer subfolders (e.g., utils/, nativeMappers/, tiptapWatchers/, htmlExtensions/) and updates import paths accordingly, while also adding a few web utilities used by the editor and renderer.

Changes:

  • Reorganized web code into purpose-based subdirectories and updated all affected imports.
  • Added browser/DOM environment assertion for client-only components (SSR clarity).
  • Added/extended web utilities: paste-image dimension reading, ordered list marker sizing, and image error fallback handling.

Reviewed changes

Copilot reviewed 16 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/web/utils/useStableRef.ts New hook to hold latest values via a stable ref.
src/web/utils/pasteImages.ts Updated imports + uses new helper to read pasted image dimensions.
src/web/utils/pastedImageDimensions.ts New helper to best-effort decode intrinsic image dimensions.
src/web/utils/assertBrowserEnvironment.ts New helper to throw a clear error when DOM APIs are unavailable (SSR).
src/web/tiptapWatchers/useOnLinkDetected.ts Updated import path for position mapping.
src/web/tiptapWatchers/useOnEditorChange.ts Updated import path for adapted native events.
src/web/tiptapWatchers/useOnChangeText.ts Updated type + position-mapping imports after refactor.
src/web/tiptapWatchers/useOnChangeState.ts Updated type/import paths to new structure.
src/web/tiptapWatchers/useOnChangeHtml.ts Updated type/import paths to new structure.
src/web/tiptapWatchers/emitLinkDetected.ts Updated type import path.
src/web/pmPlugins/AutolinkPlugin/index.ts Updated imports to new watcher/mapper locations.
src/web/nativeMappers/returnKeyTypeToEnterKeyHint.ts Moved mapping utility into nativeMappers/.
src/web/nativeMappers/positionMapping.ts Moved/refined PM↔native position utilities.
src/web/nativeMappers/adaptWebToNativeEvent.ts Moved/refined web event → RN NativeSyntheticEvent adapter.
src/web/htmlExtensions/usePressInteractions.ts Updated type import path.
src/web/htmlExtensions/useOrderedListMarkerWidth.ts New hook to set --et-ol-digits for ordered list layout.
src/web/htmlExtensions/useImageErrorFallback.ts New hook to mark broken images for CSS fallback.
src/web/formats/EnrichedLink.ts Updated import path for position mapping.
src/web/formats/applyWrappingListToSelection.ts Updated import path for position mapping.
src/web/EnrichedTextInput.tsx Updated imports to new structure; uses new helpers/mappers.
src/web/EnrichedText.tsx Updated imports to new structure; uses new helpers/extensions.
src/web/tests/returnKeyTypeToEnterKeyHint.test.ts Updated import path after refactor.
src/web/tests/assertBrowserEnvironment.ssr.test.ts Updated import path after refactor.
src/web/tests/assertBrowserEnvironment.dom.test.ts Updated import path after refactor.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@exploIF
exploIF merged commit 0585b57 into main Aug 18, 2026
9 checks passed
@exploIF
exploIF deleted the @ksienkiewicz/refactor-web-src-structure branch August 18, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants