feat: Live Preview embeds, PAT authentication, and MR status column - #35
Open
Ridermansb wants to merge 5 commits into
Open
feat: Live Preview embeds, PAT authentication, and MR status column#35Ridermansb wants to merge 5 commits into
Ridermansb wants to merge 5 commits into
Conversation
OAuth tokens were never sent on API requests, so private issues could not embed. Add per-instance personal access tokens (SecretStorage) with OAuth as fallback, plus connection test and auth error notices. Co-authored-by: Cursor <cursoragent@cursor.com>
Let users pick one auth method per instance (none, PAT, or OAuth) with clearer settings UI. Fix API client reload on URL changes, implement merge request embeds, and add link:vault for symlink-based dev setup. Co-authored-by: Cursor <cursoragent@cursor.com>
Extract shared embed logic and register a CodeMirror extension so pasted URLs render as cards while editing, with clearer feedback for unconfigured self-hosted instances. Co-authored-by: Cursor <cursoragent@cursor.com>
Surface head_pipeline and MR state in a right-aligned status column so notes show CI and merge progress at a glance. Co-authored-by: Cursor <cursoragent@cursor.com>
Fetch paginated MR discussions with a compact header UI, fix Live Preview so URLs inside fenced blocks are not treated as link embeds, and only show unconfigured-instance errors when the instance is actually missing from settings. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhances the Obsidian GitLab Embeds plugin with private instance auth, Live Preview embeds, and richer merge request cards that show merge state and CI pipeline status at a glance.
Previously, embeds only appeared in Reading view and MR cards showed basic metadata only. This branch makes embeds work while editing, supports authenticated access to private projects, and surfaces MR lifecycle + pipeline info on the card.
What's new
Live Preview embeds
WidgetTypedecorations, gated byeditorLivePreviewFieldso embeds do not appear in source modePersonal Access Token (PAT) authentication
Richer MR embed cards
MR cards now include a right-aligned status column:
🟢 Open,🔀 Merged,🔒 Closed)✅ Passed,❌ Failed,🔄 Running, etc.)#pipeline-id · duration · finished datePipeline data comes from GitLab's
head_pipelinefield on the existing single MR API call — no extra request.Developer experience
npm run link:vaultscript for local vault symlink workflowTechnical changes
New modules
src/gitlab-url.ts— URL parsing and project ID encodingsrc/embed-service.ts— API fetch, caching, auth error handlingsrc/embed-renderer.ts— shared DOM rendering for issue/MR cards + status blockssrc/live-preview-extension.ts— CM6ViewPluginfor Live Preview widgetssrc/codemirror-shims.d.ts— TypeScript shims for Obsidian-bundled CodeMirror modulesUpdated modules
src/main.ts— slimmed down; registers post processor + editor extensionsrc/api-client.ts— PAT support; mapshead_pipelineon merge requestssrc/settings.ts— per-instance auth UI (None / PAT / OAuth)styles.css— card layout (gitlab-embed-body,gitlab-embed-aside) and status block stylesArchitecture
Reading view → MarkdownPostProcessor → embed-service → embed-renderer Live Preview → CM6 ViewPlugin/widget → embed-service → embed-renderer
Both paths share the same fetch and render logic so issue/MR cards stay consistent.
Test plan
✅ Passedwith pipeline meta❌ Failed🔀 Mergedwith merged date🟢 Openwith created date