Skip to content

Fix multi-value attribute cells rendering with page-ref brackets#329

Open
salmonumbrella wants to merge 1 commit into
RoamJS:mainfrom
salmonumbrella:fix-multi-value-attribute-brackets
Open

Fix multi-value attribute cells rendering with page-ref brackets#329
salmonumbrella wants to merge 1 commit into
RoamJS:mainfrom
salmonumbrella:fix-multi-value-attribute-brackets

Conversation

@salmonumbrella

Copy link
Copy Markdown

Problem

In Query Builder result tables a single-value attribute renders unwrapped (e.g. [[A]]A), but a multi-value attribute keeps its brackets (e.g. [[A]], [[B]][[A]], [[B]]). The two are inconsistent.

Cause

toCellValue cleans cell text with extractTag, which only unwraps a single, whole-string tag. For a multi-value string its guard sees the inner ]] before the next [[, bails out, and returns the value unchanged — so the brackets stay.

Fix

Add an opt-in stripRefs flag to toCellValue that strips the page-ref delimiters from every remaining ref, and pass it from the results-table display site (ResultRow's cell()).

It is off by default, so callers that rely on the raw value are unchanged:

  • the filter value set (filterData)
  • Kanban column grouping / drag comparison
  • the references in-place edit in predefinedSelections (blockText.replace(toCellValue(...), value))

So this only changes how cells are displayed — not filtering, sorting, or editing.

Before / After (display)

value before after
[[A]] A A
[[A]], [[B]] [[A]], [[B]] A, B

extractTag only unwraps a single whole-string tag, so multi-value attributes kept their [[ ]] while single values did not. Add an opt-in stripRefs flag to toCellValue, set only at the results-table display site, leaving raw-value callers (filters, kanban, in-place edits) unchanged.
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fabeffd1-a808-49fa-9ccb-a3cec7f3cf23

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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