We were unable to construct the commit group for this pull request: Author does not currently possess a GitClear subscription seat.

feat(object): "Created in" origin navigation for media and bookmark objects #2355

Merged
requilence opened 10:16am on August 26, 2026 wanted to merge 11 commits into anyproto/anytype-ts develop from
feature/created-in-context-navigation

Pull Request Overview

  • Opened on August 26, 2026
  • Status Merged
  • Commit count 11 with first commit August 26, 2026

Total Delta

0 Total Diff Delta

Open Days

Open 18 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Data pending calculation for pull request

Author avatar

feat(object): "Created in" origin navigation for media and bookmark objects

What

File, image, video, audio and bookmark objects are artifacts β€” created inside a document block, a chat, a collection, or as a cover/icon value β€” but their own page gave no way back to where they came from.

That link is genuinely unreachable otherwise: createdInContext sits in heart's relationsToSkipLinksIndexing, so the origin produces no backlink in either direction. If we don't render it, it's lost.

This adds an eyebrow above the title on media and bookmark pages, plus one navigation primitive that deep-links into the origin.

How



  • U.Object.openCreatedInContext β€” single entry point. Resolves the context from dependent details (already delivered on object open, so no extra fetch and no backend change), toasts and stops when the context is gone, and reveals in place when it's already the open object.


  • Ref meaning comes from the context's layout, not from probing the string: chat β†’ message id; otherwise a relation key when getRelationByKey resolves, else a block id. Empty ref β†’ the context root.


  • Reveal reuses what exists β€” U.Comment.scrollToBlock and the chat scrollToMessage event. The relation case is the only new behavior: it opens the right panel and highlights the row, waiting on a bounded raf poll (and on sidebar.isAnimating, since rightPanelToggle silently no-ops mid-animation) rather than guessing a timeout. Gives up silently instead of dead-clicking.


  • The createdInContext cell is special-cased (precedent: source in cell/index.tsx) so the property deep-links identically wherever it renders β€” Local group, Properties panel, featured chip β€” not just from the eyebrow.

Scope

Normal objects are deliberately unchanged. They already have a featured-relations row, which is the type-controlled mechanism for "what shows at the top of an object" β€” so they keep the property in the Properties panel's Local group and can promote it to the type. The eyebrow is hard-coded only on media pages, which render their own layout and have no featured row.

Bookmarks do have a featured row (they route through page.go, which applies WithFeaturedRelationsBlock unconditionally). The eyebrow is kept there as a product decision, since bookmarks were part of the original request; both affordances deep-link identically.

Not included, recorded in the spec: chat message-id stamping (the messageId doesn't exist at upload time, so a chat-origin file resolves to the chat but not the message β€” degrades gracefully), and one-step "add to type as featured".

Second commit β€” unrelated sidebar fix

Collapsing or expanding the vault left the space sidebar unresizable until a reload, while the same closed-vault state restored from storage worked fine.

resizePage applies sidebarAnimation via toggleClass, so it survives until the next non-animated resize, and leftPanelClose/leftPanelOpen never removed it β€” unlike leftPanelSubPageOpen/Close, which both strip it in their completion timeouts. Since .subPageWrapper.sidebarAnimation carries overflow: hidden and the resize handle is absolutely positioned outside the box at right: -12px, the leaked class clipped the handle away entirely. Reload cleared it because init() calls resizePage with animate = false.

Pre-existing, not caused by the feature; fixed here at request.

Verification



  • bun run typecheck β€” clean


  • bun run lint β€” clean on all touched files

  • 74/74 unit tests pass (20 new covering ref derivation and primitive branching; also repairs object.test.ts, which was failing to load entirely β€” 0 β†’ 54)

No component tests: vitest runs environment: 'node' here with no jsdom installed. Those conditions are covered by the Storybook story instead.

Testing notes

Worth exercising by hand: drop an image into a document block β†’ open the image object β†’ click the eyebrow (should scroll to that block and highlight). Also the vault fix β€” collapse the vault, then drag the space sidebar's right edge without reloading.

Design doc: docs/superpowers/specs/2026-08-23-created-in-context-navigation-design.md

PR was closed without comments.