Skip to content

feat: scitex-ui/app integration — all workspace apps consume shared packages#117

Open
ywatanabe1989 wants to merge 29 commits intodevelopfrom
feature/scitex-ui-app-integration
Open

feat: scitex-ui/app integration — all workspace apps consume shared packages#117
ywatanabe1989 wants to merge 29 commits intodevelopfrom
feature/scitex-ui-app-integration

Conversation

@ywatanabe1989
Copy link
Copy Markdown
Owner

Summary

  • All workspace apps now consume scitex-ui (frontend components) and scitex-app (backend SDK)
  • Manifest schema v2.0.0 with privilege declarations for all 9 builtin apps
  • Path resolution module (scitex_app.paths) with 28 tests
  • Component migration: confirm-modal, data-table (~3700 lines), resizer (~1500 lines) to scitex-ui
  • Scaffold generates scitex-ui/app-aware apps with dual-mode support (standalone + extension)
  • dev_app_loader refactored to use scitex_app.paths

Test plan

  • npm run build passes (verified after each component migration)
  • pytest tests/test__paths.py — 28 tests passing
  • File size check passes
  • All existing @/components/ imports continue working via re-export stubs
  • Manual test: workspace tab switching with migrated components
  • Manual test: scaffold a new React app and verify it builds

🤖 Generated with Claude Code

ywatanabe1989 and others added 29 commits March 16, 2026 04:15
Phase 0 - Infrastructure:
- Add scitex-ui Vite resolve alias (auto-discovered from pip)
- Add @scitex/ui npm dependency (file link)
- Add scitex-ui to Vite server.fs.allow

Phase 1 - Manifest v2 with privileges:
- Bump all 9 manifests to schema v2.0.0
- Add privileges array to each app (type, scope, reason)
- Add privileges field to ModuleConfig dataclass
- Support both schema v1.0.0 and v2.0.0 in registry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace inline confirm-modal implementation with re-export stub
that delegates to scitex-ui's canonical implementation.
Existing @/components/confirm-modal imports continue working.
window.scitexConfirm global preserved for non-module scripts.

This proves the component migration pattern for Phase 3.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace inline data-table index with re-export stub delegating
to scitex-ui's canonical implementation. All existing imports
via @/components/data-table continue working unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Core resizer classes (HorizontalResizer, VerticalResizer, BaseResizer)
now re-exported from scitex-ui. Auto-init and workspace-specific
logic (htmx:afterSettle, panel collapse) remains in scitex-cloud.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Manifest: bump to schema v2.0.0, include privileges field
- React scaffold: add scitex-ui Vite alias discovery
- React scaffold: add @scitex/ui npm dependency
- Vite config: add server.fs.allow for scitex-ui

New apps now consume scitex-ui components out of the box.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Manifest: add standalone, standalone_command, standalone_port fields
- Manifest: frontend_type now reflects actual choice (html/react)
- Generate pyproject.toml with scitex_modules entry point
- Apps can now work both standalone and as scitex-cloud extensions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace duplicated path resolution logic with scitex_app.paths:
- read_manifest → resolve_manifest
- resolve_dev_project_dir → resolve_user_project_dir
- _find_partial → find_partial_template
- validate_dev_repo → validate_project_structure + parse_dev_module_name

DRY: removes ~40 lines of duplicated code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Documents component migration flow, manifest schema v2, builtin apps,
and future AI chat extraction plan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the inline context-zoom implementation with a re-export stub
from scitex-ui. All consumers keep their existing import paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add scitex-ui, scitex-app, scitex-plt, scitex-audio, scitex-dev
  volume mounts to docker_dev compose (django, celery_worker, celery_beat)
- Set SCITEX_UI_STATIC env var for reliable Vite alias resolution
- Move scitex-app editable install outside sentinel guard
- Re-export bootstrapContextZoom from scitex-ui

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Simplifies context-zoom-init.ts by delegating standard zone registration
to scitex-ui's bootstrapContextZoom (MutationObserver + indicator badge).
Custom Monaco and PDF zones still registered directly.

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

Workers auto-restart after 100 tasks or when exceeding 500MB memory.
Prevents memory leaks from accumulating over time.

Configured in both docker-compose command args and Django settings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove mail_admins handler from django, django.request, and
django.security loggers. Errors still logged to file but no longer
flood admin inbox with EXTERNAL IP error emails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tex-ui data-h-resizer

Port 18 HTML templates from the legacy WorkspacePanelResizer system
(data-panel-resizer, data-target, data-direction) to the unified scitex-ui
resizer system (data-h-resizer, data-left, data-right, data-most-left/right).

Templates migrated:
- Shell partials: workspace_{ai,worktree,viewer,apps}_pane, global_ai_panel
- Workspace shell: shell.html (2 resizers)
- App-level: console (2), scholar_base, clew, tools (3), figrecipe
- Public: tools (3), run-stats (2)
- Docs: ts-resizer, ts-util-keyboard (text references)

Also updated:
- keyboard-shortcuts.ts: query [data-h-resizer] instead of [data-panel-resizer]
- resizer.css: added .h-resizer--shell for absolute-positioned shell resizers
- Comment references in writer-app-init.ts, panel-toggle.ts, UIManager.ts

Legacy _workspace-panel-resizer/ code still exists but finds 0 elements.
Will be removed in follow-up cleanup commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All templates now use the unified scitex-ui resizer system (data-h-resizer).
The legacy WorkspacePanelResizer code is no longer needed.

Removed:
- static/shared/ts/components/_workspace-panel-resizer/ (5 files, 906 lines)
- static/shared/ts/components/workspace-panel-resizer.ts (barrel re-export)
- Vite entry point 'shared/workspace-panel-resizer'
- {% vite_script %} tags loading legacy module

Updated comment references in:
- zen-mode.ts, global-ai-chat.ts, vis-panel-toggle.ts, UIComponents.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Mark panel-resizer.css as legacy with clear notes on what's still used
- Remove workspace-panel-resizer.test.ts (tests deleted source code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Context zoom now targets content areas only:
- AI panel: zoom applies to .scitex-ai-body (not whole sidebar)
- Module pane: zoom applies to .pane-content (not whole pane)
- Title bars/headers stay at normal size during zoom

E2E test fixes:
- Update module URLs from legacy /writer/ to canonical /apps/writer/
- Add legacy redirect assertions (301 tests)
- Fix static file test to not follow redirects

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The vis module was renamed to figrecipe. Update test to use
/apps/figrecipe/ instead of /apps/vis/.

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

Phase 4+5 of figrecipe clean docking:

- Delete old VisEditor TS code (_vis/, _vis-editor/, .legacy/) — 178 files
- Delete old CSS (vis/, editor-inline) — 35 files
- Delete duplicated Python views/api handlers (figrecipe._django has these)
- Delete duplicated services (plot_renderer, gallery, figz, pltz, stats)
- Delete old tests for deleted code
- Delete old templates (gallery.html, vis_partial.html, includes/)
- Simplify editor.html to React-only mount point
- Update URLs to delegate directly to figrecipe._django.views
- Fix Vite React plugin preamble error (exclude scitex-ui TSX from Fast Refresh)
- Add esbuild jsx:automatic for excluded files
- Update fetch override to use /apps/figrecipe/ paths
- Rename FigrecipeMountPoint.tsx → .ts (no JSX used)

figrecipe_app is now a ~25 file thin stub:
  apps.py, skill.py, manifest.json, models/, migrations/,
  urls/ (2 files + __init__), views/__init__.py,
  templates/editor.html, static/ts/_figrecipe-bridge/ (4 files)

All 19 E2E tests pass. React editor renders in workspace.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The figrecipe React editor CSS was only imported in main.tsx (standalone
mode). When mounted via the bridge in scitex-cloud, the CSS was missing.
Import all figrecipe editor stylesheets in the bridge init entry point.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The figrecipe._django API handlers need a working_dir parameter to
resolve recipe files. Add thin wrapper that injects the current user's
project path before delegating to figrecipe._django.views.api_dispatch.

This is the ONE thin wrapper scitex-cloud needs — translating
"current user's project" to a filesystem path for figrecipe.

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

The plot type selector buttons had light backgrounds because scitex-ui's
selector-nav.css wasn't loaded in embedded mode. Import the bundled
app.css from scitex-ui which includes all app-level component styles.

Shell CSS is NOT imported — scitex-cloud templates already handle that.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The import was using an absolute filesystem path that didn't resolve.
Changed to alias-based path: "scitex-ui/css/app.css" which properly
resolves through vite.config.ts alias mapping.

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

The /apps/figrecipe-react/ path was a legacy standalone React SPA mount.
All figrecipe traffic now goes through /apps/figrecipe/ which properly
delegates to figrecipe._django with project context injection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The React plugin preamble workaround was removed — scitex-ui files are
now excluded from the React plugin, and FigrecipeMountPoint uses .ts
extension with React.createElement instead of JSX.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The template was sending a URL-style path (/user/project) but the
figrecipe API expects a filesystem path. Removing it lets the
server-side _inject_project_context() provide the correct path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The React editor uses file-based storage via figrecipe._django,
not Django ORM models. Alpha stage — no data to preserve.

Dropped: JournalPreset, ScientificFigure, FigurePanel, Annotation,
FigureVersion, FigureExport, PltzBundle, FigzBundle, FigzPanel,
UserStylePreset.

Migration 0006 handles table deletion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No Celery tasks exist in figrecipe_app (services were moved to
figrecipe pip package). The dedicated log handler and logger are
also no longer needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Describes how scitex-cloud discovers, validates, and mounts apps
generically without importing app-specific code. Covers ModuleConfig,
URL mounting, context injection, manifest schema, and validation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ywatanabe1989
Copy link
Copy Markdown
Owner Author

Quality triage note (mamba-quality-checker-mba): DIRTY (merge conflicts) + 2 failing CI checks, last update 2026-03-21 (~3 weeks stale). Rebase against current main is required before this can be evaluated. If the work has been absorbed into smaller PRs, please close with superseded-by reference.

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.

1 participant