Skip to content

Resolve references in copied Journal blocks - #222

Merged
RCmerci merged 3 commits into
mainfrom
devin/1796307412-journal-copy-reference-text
Dec 3, 2026
Merged

RCmerci merged 3 commits into
mainfrom
devin/1796307412-journal-copy-reference-text

Conversation

@RCmerci

@RCmerci RCmerci commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Resolve page and block UUID references in copied outlines with graph-scoped reads before the final version check.
  • Preserve Markdown and indent continuation lines after expanding nested references. A reducer regression covers live page and block targets in one copied outline.

Link to Devin session: https://app.devin.ai/sessions/98b65457efb54db3804df2af276c8d02
Open in Devin Desktop: https://app.devin.ai/desktop/session/98b65457efb54db3804df2af276c8d02?variant=devin
Requested by: @RCmerci


🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T14:23:59.696223Z 0d28bee PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d28beea78

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/journal_pure_copy.ml
Comment on lines +438 to +439
| Reference_block (refs, target), Block_result block when Graph.Uuid.equal target.uuid block.uuid ->
settle_reference t refs target (Some block.title)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve property-backed labels when resolving block references

When a referenced block has a blank title and stores its label in logseq.property/value, this branch replaces the reference with an empty string or whitespace, silently dropping its content from the clipboard. Static inspection shows that the existing presentation path handles this case in Journal_graph_reference_plan.block_source, called through capture_block_label by journal_graph_runtime.ml, whereas the copy path discards properties in block_text and uses only block.title. Preserve the block's property-backed label when resolving references so copying does not erase text that is visible in the app.

Useful? React with 👍 / 👎.

Comment thread app/journal_pure_copy.ml
Comment on lines +285 to +286
(match Journal_model.render_copy_references ~lookup ~maximum_bytes:maximum_text_bytes
fragment.title with

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude Markdown code from copied reference expansion

When copied text contains a live UUID token inside inline code or a fenced code block, the new renderer replaces that literal token with the target's title, changing the code sample rather than preserving it. Static inspection shows that both reference collection and expansion use fold_references, which recognizes tokens without accounting for Markdown code boundaries; the existing Journal_model.Title parser deliberately treats code as literal, with inline-code behavior covered by test_rich_title_boundaries and test_ast_reference_discovery in test/journal_model_test.ml. Make collection and replacement respect those boundaries while preserving the original Markdown source.

Useful? React with 👍 / 👎.

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

iOS Simulator verification on c3afa784

Journal’s Copy action resolved persisted page and block references, including the empty-label link. The text pasted into Safari matched the expected Markdown and indentation byte for byte.

**Notes** for Travel plans
  - See Pack
    Bring a map
  - Unlabeled: Travel plans
Journal before Copy Safari after Paste
Journal shows readable references and the Copy action Safari shows the pasted outline

Reducer tests cover explicit link labels and literal UUIDs inside inline and fenced code.

Simulator recording

@RCmerci
RCmerci merged commit af3b504 into main Dec 3, 2026
1 check passed
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