Commit Graph

8 Commits

Author SHA1 Message Date
Ylber Gashi
591f69885e Consolidate mobile WebView editor logic into shared packages/ui (#362)
Extract duplicated CRDT lifecycle, node views, record layout, and database
layout from the mobile WebView editor into shared primitives in packages/ui.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:52:32 +01:00
Ylber Gashi
7e1ec764c7 De-duplicate mobile database view logic into shared packages/ui (#361)
Extract duplicated database view business logic from
apps/mobile/webviews/editor/src/database-runtime.tsx (734→188 lines)
into shared packages/ui components and hooks:

- Add NavigationContext for platform-agnostic node navigation
  (desktop uses TanStack Router, mobile uses WebView bridge)
- Extract useDatabaseViewValue hook with all DatabaseViewContext
  computation (fields, filters, sorts, record creation)
- Make DatabaseViews accept renderLayout prop for custom view rendering
- Refactor ViewFullscreenButton and TableViewNameCell to use
  NavigationContext instead of hardcoded TanStack Router Link
- Fix TableViewNameCell canEdit to use useRecord().canEdit (was
  hardcoded true on desktop)
- Add readOnly={database.isLocked} to shared TableViewRow
- Merge mobile's view-delete logic into shared TableViewSettings
- Keep open-record button always visible on mobile (no hover)
- Add database node type support to mobile rename-node-sheet

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 00:21:48 +01:00
Ylber Gashi
53e2b14515 Mobile: database views, record editing, and WebView bridge improvements (#360)
Add database table view and record detail screens rendered inside the
WebView using shared @colanode/ui components. Extend the bridge protocol
with query subscriptions, event forwarding, and global focus tracking for
keyboard avoidance. Fix flush on navigation/background to cover all
debounced mutations. Update README to reflect current feature set and
document the intentional database-runtime duplication.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 22:16:54 +01:00
Ylber Gashi
b2efa1b09c Mobile: stability fixes for auth, workspace settings, editor sync, and file downloads (#358)
Align password validation with shared schema, harden workspace/member role
invariants on both client and server, fix page editor CRDT reconciliation
for incremental updates, and replace file download polling with reactive
local-file state tracking.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 13:47:24 +01:00
Ylber Gashi
86e1e597ab Mobile: fix light mode UI issues and page editor keyboard scrolling (#350)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 17:28:14 +01:00
Ylber Gashi
2cd02255c7 Mobile: keyboard avoidance and toolbar for page editor WebView (#347)
Add keyboard tracking, automatic content scrolling, and a native toolbar with block type selection for the page editor. The toolbar appears above the keyboard with "+" button for block types and a dismiss button. Keyboard height is tracked via native events and communicated to the WebView for cursor scroll-into-view. Block type selection is inline (not modal) to prevent keyboard dismissal during interaction.

- Track keyboard height in page screen with iOS/Android event listeners
- Use KeyboardAvoidingView for proper layout when keyboard is visible
- Add toolbar component with "+" (block types) and dismiss buttons
- Implement inline block type selector (no modal to preserve keyboard)
- Extend bridge protocol: keyboard.show/hide, editor.blur, block.command, editor.focus
- Handle block command execution in WebView with correct TipTap node commands
- Expose editor instance on window.__editorInstance for command execution
- Add focus/blur callbacks to notify native of editor state
- Send cursor position to scroll-into-view when keyboard shows
- Increase ProseMirror padding-bottom from 40vh to 60vh for comfortable scrolling
- Remove focus-restoration script that prevented cursor following

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-15 23:18:11 +01:00
Ylber Gashi
2be4b599e7 Mobile: fix page editor keyboard and interaction issues (#346)
* Mobile: add prebuild hook and submit config for EAS builds

Add prebuildCommand to run copy-editor.js during EAS builds so the
editor.html asset is available for Metro bundling. Also restore the
App Store Connect submit credentials (appleId, appleTeamId, ascAppId)
so builds auto-submit to TestFlight.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Mobile: use eas-build-post-install hook for editor asset

prebuildCommand replaces expo prebuild entirely, causing build failures.
Use eas-build-post-install lifecycle hook instead to run copy-editor.js
after npm install but before the native build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Mobile: fix page editor keyboard and interaction issues

- Disable native WebView scrolling and use CSS overflow to prevent
  scroll-to-top when keyboard opens
- Fix slash command click-through by preventing ProseMirror from
  processing mousedown events immediately after command selection
- Remove keyboard from auto-opening on page load and auto-focusing
  cursor; keyboard now only appears on user tap
- Add eas-build-post-install hook to build editor HTML asset during
  EAS builds
- Improve editor.html iframe sandbox and CSP settings

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 22:17:36 +01:00
Ylber Gashi
c945579abd Mobile: WebView-based page editor with TipTap (#345)
* Mobile: replace inline page editor with WebView-based TipTap editor

Replaces the plain-text block-by-block page editor with a Vite-built
WebView that runs the full TipTap rich text editor. The editor HTML is
bundled as a single self-contained asset, loaded via expo-asset and
rendered in react-native-webview. Communication between RN and the
WebView uses postMessage/onMessage bridge for init, mutations, queries,
theme changes, and navigation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Mobile: reorganize WebView editor as standalone package

Moves the editor WebView app from apps/mobile/src/editor-webview/ to
apps/mobile/webviews/editor/ as a first-class build target with its own
package.json, tsconfig.json, and vite.config.ts. This fixes TypeScript
compilation (editor code no longer typechecked as React Native) and
makes the build story clearer.

- WebView editor is now at apps/mobile/webviews/editor/
- Built artifact copied to apps/mobile/assets/editor-dist/ on prestart
- Vite dev server support for fast iteration
- Tailwind CSS @source path fixed (../../../../packages/ui)
- Page title editing restored via RenameNodeSheet
- File preview now converts file:// to base64 data URLs for WebView
- WebView hidden until ready to avoid white flash
- Keyboard accessory bar hidden on iOS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 13:43:17 +01:00