Commit graph

38 commits

Author SHA1 Message Date
flash555588
77f9a7a143 fix(ui): ensure active toolbar button highlight overrides base styles
- Increase .ai3d-btn-active selector specificity to .ai3d-inline-btn.ai3d-btn-active so it wins over the later base .ai3d-inline-btn rule.
2026-06-20 03:33:30 +08:00
flash555588
9068ac31b4 feat(ui): highlight active toolbar buttons with accent background
- Change .ai3d-btn-active from accent text to filled accent background + on-accent text.

- Keep the active highlight on hover with a slight brightness boost.
2026-06-20 03:23:33 +08:00
flash555588
a9f793e38f revert(ui): restore inline secondary expansion (first version layout)
- Replace the dropdown menu with the original left/right inline expansion of secondary actions.

- Keep icon-only primary buttons and grouped toolbar layout.
2026-06-20 03:16:33 +08:00
flash555588
f04ca3d308 feat(ui): replace inline secondary expansion with dropdown menu
- Move all secondary actions into a theme-styled dropdown menu triggered by the "more" button.

- Keep primary icon buttons on the toolbar: reset, wireframe, axes, bbox, focus, disassemble, measure, annotate, copy.

- Add menu sections with separators and full descriptive labels.

- Support Escape and outside-click to close the menu.

- Remove old inline .show-secondary expansion CSS.
2026-06-20 02:45:03 +08:00
flash555588
bf61fb4ebc revert(ui): remove toolbar text labels, keep grouped secondary collapse
- Remove icon+text labels from all helper toolbar buttons; keep icon-only primary actions visible.

- Preserve global secondary-button collapse behind the "more" toggle.

- Drop now-unused short-label i18n keys and labeled-button CSS.
2026-06-20 02:14:56 +08:00
flash555588
d10ed96013 feat(ui): re-layout helper toolbar with labels and secondary collapse
- Promote reset, wireframe, axes, bounding box, focus, disassemble, measure, annotate, and copy snapshot to primary icon+text buttons.

- Collapse all secondary buttons behind a global "more" toggle by default.

- Add short-label i18n keys and tighten labeled-button CSS sizing.

- Update preview verification harness to expand the more menu for secondary actions.
2026-06-20 02:06:21 +08:00
flash555588
5dca9ecb71 feat(inline): labeled primary measurement button and style
- Make the measurement tool a primary inline toolbar button with a visible text label ("测距" / "Measure").

- Add .ai3d-inline-btn--labeled styles for icon+text layout and compact sizing.

- Verified with typecheck, lint, unit tests, preview harness, and Obsidian vault install.
2026-06-20 01:15:11 +08:00
flash555588
3915ff4d86 fix(annotations): reduce label jitter during camera rotation 2026-06-19 22:37:10 +08:00
Zyk
01620a5950 fix: axes position, wireframe flicker, calibration icon, measurement scale 2026-06-07 12:50:25 +08:00
flash555588
c078c22b0e feat: move knowledge and matches to sidebar
- Remove the 5 icon buttons from the right sidebar (focus, disassembly,

  reset, generate-note, open-index)

- Move knowledge controls (generate-note, open-note, open-index) to sidebar

- Move registered part matches to sidebar

- Bottom panel now only shows overview: backend, route, metrics

- Sidebar renders content vertically with full workbench card styling

- Mobile: sidebar content scrolls horizontally

This puts actionable information on the right and model status

on the bottom, reducing visual clutter in both areas.
2026-06-06 21:50:24 +08:00
flash555588
355c2e1eb4 feat: workspace layout with sidebar and resize handles
Add a track-based workspace framework around the original workbench panel:

- Main preview area + right sidebar with action icons (focus, disassembly,

  reset, generate-note, open-index)

- Draggable resize handles for sidebar width and bottom panel height

- Keep the original bottom workbench panel design: overview on the left,

  knowledge actions and registered part matches on the right

- Mobile responsive: sidebar becomes a horizontal scrollable row

This keeps the familiar two-column workbench panel while adding

a proper resizable workspace frame so the preview area is no longer

squeezed by the panel.
2026-06-06 21:37:50 +08:00
flash555588
e8d094afb5 feat: workspace track layout with draggable resize handles and bottom tabs
- Replace the legacy bottom workbench panel with a track-based workspace layout

- Main preview area gets full remaining space without being squeezed by the panel

- Right sidebar with icon buttons for focus/disassembly/reset/annotation/generate-note/open-index

- Draggable resize handles for sidebar width and bottom panel height (like IDE split panes)

- Bottom panel organized into Overview/Matches/Knowledge tabs to reduce visual clutter

- Mobile responsive: sidebar becomes a horizontal row on narrow screens

- Add tab translation keys for Overview/Matches/Knowledge in both EN and ZH

- Clean up legacy workbench panel CSS and consolidate into workspace styles
2026-06-06 21:22:01 +08:00
flash555588
b1cf45b11e feat: register cross-format model components 2026-06-06 20:36:51 +08:00
flash555588
e478b426d7 feat: register glb component parts 2026-06-06 19:27:28 +08:00
flash555588
fd491042c1 Release 0.4.3 2026-06-03 20:51:30 +08:00
flash555588
9b2079343f release: prepare 0.3.0 2026-05-29 23:51:40 +08:00
flash555588
16a06bfb43 release: prepare 0.2.3 2026-05-29 16:33:42 +08:00
flash555588
768d7d027a Improve preview focus, disassembly, and toolbar behavior 2026-05-27 11:15:26 +08:00
flash555588
c87d7ea5cd release: simplify model view and publish 0.2.1 2026-05-25 20:42:41 +08:00
flash555588
287a81b1fb style: unify design tokens, consolidate duplicate CSS, clean inline SVGs
- Add comprehensive CSS custom property token system (radius, spacing, colors)
- Remove duplicate .ai3d-workbench definition (merged into base)
- Use tokens for stage-shell and section border-radius
- Rename duplicate @keyframes (ai3d-fade-in, ai3d-annot-pulse) to unique names
- Remove hardcoded SVG width/height from annotation action buttons
2026-05-22 02:34:03 +08:00
flash555588
06db0fb07c fix: restore flex column layout for workbench container
The .ai3d-workbench CSS was redefined as display: grid with 2 columns,
overriding the original flex column layout and breaking the 3-column
studio-grid structure. Changed back to display: flex; flex-direction: column.
2026-05-21 22:00:41 +08:00
flash555588
be3db73d9b feat: Three.js as primary renderer for all single-model formats and workbench
- Add renderer-agnostic preview abstraction layer (src/render/preview/)
- Add Three.js renderer with GLB/GLTF/STL/PLY/OBJ support (src/render/three/)
- Add Three.js disassembly, explode, focusWorldPoint, animation support
- Route workbench to Three.js for supported formats (allowEditModeOnThree)
- Fix htm multi-root template rendering with replaceWithHtml helper
- Fix profile null-safety with getProfileTags/getProfileAnnotations
- Fix AnalysisView double-mount with pre-cleanup in onOpen
- Move presets from babylon/presets/ to renderer-agnostic presets/
- Update routing matrix, README, i18n for expanded format support
2026-05-21 20:25:39 +08:00
flash555588
242f364698 Harden Babylon release bundle and document SPLAT status 2026-05-13 18:22:27 +08:00
flash555588
6c6c632493 feat: improve mobile support and cross-platform portability 2026-05-12 23:02:33 +08:00
flash555588
3b2a23d0aa feat: improve preview rendering and macOS converter support 2026-05-12 09:32:05 +08:00
flash555588
e43b11bf12 fix: localize preview feedback and heading pin hints 2026-05-11 18:45:19 +08:00
flash555588
78f042e5df release: prepare 0.0.5-beta.0 test release 2026-05-11 13:59:31 +08:00
flash555588
e7e7c03599 fix: override Obsidian base SVG rules to restore icon colors
Obsidian's base CSS may set fill/stroke on SVG elements. CSS properties
have higher specificity than SVG presentation attributes (fill="none"
stroke="currentColor"), causing icons to render black.

Add explicit CSS rules with !important for fill/stroke on plugin SVG
icons to ensure currentColor is used for icon rendering.
2026-05-11 09:54:09 +08:00
flash555588
cd1e0f085c fix: resolve HierarchyRequestError and restore Obsidian UI theming
activeDocument.createDiv/createEl throws HierarchyRequestError because
Obsidian's enhanced helpers try to appendChild on the Document node.
Previous createElement replacement fixed the error but lost Obsidian's
CSS variable inheritance, causing all UI to render black.

Fix by creating elements on parents already in the live DOM:
- helper-buttons: add parentEl param, create toolbar on live parent
- annotations: use this.hostEl (in DOM) for overlay/editor/pins
- app/workbench: create on container (in DOM)
- code-block: create canvas on host/gridHost (in DOM)
- loading-overlay: create on host (in DOM)
- live-preview/dom: keep staging pattern (elements attached later)

New src/utils/dom.ts provides createStagedDiv/createStagedEl for cases
where no live DOM parent is available at creation time.
2026-05-11 09:35:51 +08:00
flash555588
c877142beb fix: address Sourcery review feedback on PR #8
- styles.css: use var(--ai3d-embed-height, 300px) for embed canvas height
- helper-buttons.ts: add .catch() to clipboard writeText/write calls
- helper-buttons.ts: add FileReader onerror/onabort handlers
- app.ts: add .catch() to clipboard writeText fallback
- log.ts: restore console.info for Logger.info() (preserve log-level semantics)
- command-discovery.ts: guard process.platform/env with typeof check for mobile safety
2026-05-10 10:46:32 +08:00
flash555588
56190b3afd fix: address ObsidianReviewBot required issues for plugin submission
- Replace all direct style.* assignments with CSS classes and CSS variables
  (annotations.ts, code-block.ts, grid.ts, loading-overlay.ts, helper-buttons.ts, direct-view.ts)
- Replace node:fs/path/child_process/os imports with safe node-shim.ts wrapper
- Convert require() calls to static imports (stl-loader.ts, ply-loader.ts, picking.ts)
- Use sentence case for all UI text (en.ts, settings.ts, main.ts, etc.)
- Replace async methods with no await: onOpen, onClose, updateSettings, onunload, importModel
- Use setHeading() for settings section headings
- Replace activeLeaf with getActiveViewOfType(MarkdownView)
- Replace fetch() with dataUrlToBlob() for snapshot operations
- Replace navigator API with Platform.isMobile
- Replace TFile cast with instanceof check
- Replace console.log with console.debug
- Replace Function type with explicit ComponentFn type
- Add null guard for rootMesh assignment in scene.ts
2026-05-10 01:28:20 +08:00
flash555588
5b0988df48 feat: annotation heading binding and pin-note integration
Add bidirectional linking between annotation pins and note headings:

- Pin editor: heading autocomplete search across vault with dropdown,
  keyboard navigation (arrows/Enter/Escape), content preview of
  selected heading section, and binding tag indicator
- Pin hover: show note content popover when hovering over bound pins
- Heading badge: display 📌 badge on note headings linked to pins,
  with click to pulse-highlight the pin and hover for pulse animation
- Heading text normalization: strip markdown formatting (bold, links,
  wikilinks, highlights, code) for robust DOM-to-headingRef matching
- Memory optimization: pre-allocated scratch Vector3/Matrix/Ray for
  updateProjections hot path, debounced MutationObserver for heading
  scanning
- New shared utility: src/utils/note-reader.ts with readHeadingSection,
  searchVaultHeadings, normalizeHeadingText
2026-05-09 22:24:49 +08:00
flash555588
c7476e740c feat: add 3D annotation/bookmark system with depth-aware occlusion
- Click-to-pin: click on 3D model to add labeled bookmarks with color
- Edit existing pins: click pin to edit label/color, or delete
- Camera focus: click pin label in panel to animate camera to pin position
- Depth occlusion: pins behind geometry show blurred/dimmed; fully hidden when camera idle
- Workbench integration: Annotations panel with toggle, pin list, edit/delete/focus actions
- DirectView integration: annotation toolbar button with pin count badge
- Code-block readonly: display saved annotations in inline previews
- ESC to exit annotation mode
- Semi-transparent mode overlay when annotation active
- Coordinate fix: engine render → CSS pixel scaling for accurate pin positioning
- Relative occlusion epsilon for large model compatibility
2026-05-09 13:33:17 +08:00
flash555588
aac8b5ec60 fix: orientation gizmo viewport, wireframe root mesh, compact preview height
- orientation-gizmo: set viewport directly on camera instead of manual
  engine.setViewport (which was overridden by scene.render)
- scene: include rootMesh in wireframe iteration for STL/PLY single-mesh models
- direct-view: remove height:100% that caused excessive blank space
- code-block: remove defaultCanvasHeight from min-height, use CSS only;
  grid uses height instead of min-height so CSS max-height can cap it
- styles.css: reduce preview-host min-height, add grid-host max-height
2026-05-09 01:03:07 +08:00
flash555588
46ef05a560 feat: SLDPRT support, portability fixes, comprehensive QA audit, rewrite README
New features:
- Add SLDPRT (SolidWorks) converter via FreeCAD + OpenCASCADE pipeline
- Add IGES/IGS and BREP format support via format-aware Python scripts
- Add 3MF and DAE format support via trimesh/Assimp converter
- Add loading overlay component with progress bar and phase text
- Enable STP files by default in format registry

Portability:
- Remove all hardcoded user paths, use process.env.LOCALAPPDATA for discovery
- Fix .split("/") path separator issues (scene.ts, app.ts, helper-buttons.ts)
- Add macOS Apple Silicon Homebrew paths (/opt/homebrew/bin/)
- Fix escapePyStr + raw string double-escaping (pyPath normalizes to forward slashes)
- Add maxBuffer to all execFileAsync calls (50MB)

Bug fixes:
- Fix OBJ load errors silently swallowed (now re-throw after logging)
- Fix explode position drift on repeated set/reset cycles (store original center)
- Fix explode uses world-space position (switch to local position)
- Fix picking highlight material leak when mesh disposed externally
- Fix grid layerMask collision in compose presets (one cell = one bit)
- Fix renderScale/quality inconsistency (track currentQuality)
- Fix stale loading flag drops model path changes (pendingPath mechanism)
- Fix persist() unhandled rejection on save failure
- Fix Python injection via double-quote in paths (reject quotes in pyPath)
- Fix PLY face indices parsed as floats (Math.round)
- Fix PLY face indices no bounds checking (skip out-of-range)
- Fix ASCII STL produces confusing error (detect and warn)
- Fix WebGL engine leak on live-preview load error
- Fix DirectView race condition on rapid file loads (generation counter)
- Fix MutationObserver not disconnected on code-block load error
- Fix auto-save timer fires after plugin unload (add dispose)
- Fix duplicate conversions on concurrent requests (in-flight dedup)

Other:
- Rewrite README with comprehensive usage, third-party setup, and demo page
- Add docs/demo.md with 11 feature walkthrough sections
- Remove dead code (freecad-stub.ts)
2026-05-08 17:54:59 +08:00
flash555588
bfcde0f98c fix: code cleanup, mobile rendering, theme compat
- Deduplicate generateNote() in main.ts, reuse app.ts version
- Remove unused formatFileSize() and escapeObsidianMarkup()
- Wire up isMobile() for automatic resolution scaling on mobile
- Replace hardcoded #1e1e22 with CSS variable for theme compat
2026-05-07 22:27:33 +08:00
Flash
bd991144fa feat: Live Preview embed for ![[model.ext]] 2026-05-07 18:47:26 +08:00
flash555588
31c3837cfa feat: initial commit — Obsidian AI 3D Model Workbench plugin
Babylon.js-powered 3D viewer for Obsidian with support for
GLB, GLTF, STL, OBJ, and SPLAT formats. Features include
multi-model grid rendering, preset layouts, knowledge note
generation, and snapshot export.
2026-05-07 15:28:06 +08:00