Conversation
- Changed the arguments in the getTitleDatalog function to replace title-related constants with log-related constants. - Updated variable names to reflect the new log ID context.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR modifies Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/utils/conditionToDatalog.ts (2)
60-70: 🧹 Nitpick | 🔵 TrivialCore logic change looks correct; variable naming is inconsistent with file conventions.
The
:log/idapproach is a cleaner way to identify daily note pages in Roam's Datalog schema compared to the previous regex-based title matching. However, the variable name${source}-log-iduses lowercase kebab-case, while the rest of the file consistently uses PascalCase suffixes (e.g.,${source}-Title,${source}-Log,${source}-CreateTime). Note that:log/idvariables elsewhere in this file (lines 737, 795) use-Logas the suffix.Proposed fix for naming consistency
{ type: "variable", value: source }, { type: "constant", value: ":log/id" }, - { type: "variable", value: `${source}-log-id` }, + { type: "variable", value: `${source}-Log` },Also update the test expectation accordingly:
{ type: "variable", value: "node-Log" },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/utils/conditionToDatalog.ts` around lines 60 - 70, The data-pattern branch returns a variable named `${source}-log-id` which breaks the file's PascalCase suffix convention; update the variable name to `${source}-Log` in the returned object inside conditionToDatalog (the block that currently creates the data-pattern with constant ":log/id") and update any corresponding tests to expect "node-Log" (or `${source}-Log`) instead of "node-log-id". Ensure the change is applied where this pattern is built so it matches other occurrences like the variable names used on lines referencing `-Log` elsewhere in this module.
1-1:⚠️ Potential issue | 🟡 MinorRemove unused import of
DAILY_NOTE_PAGE_TITLE_REGEX.This import is no longer referenced after the
{date}branch was changed to use:log/iddirectly instead of regex-based daily note page title matching.Fix
-import { DAILY_NOTE_PAGE_TITLE_REGEX } from "roamjs-components/date/constants";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/utils/conditionToDatalog.ts` at line 1, The import DAILY_NOTE_PAGE_TITLE_REGEX is unused in conditionToDatalog.ts; remove the named import from the import statement (delete DAILY_NOTE_PAGE_TITLE_REGEX) so the file no longer imports an unused symbol, and run the linter/format step to ensure no leftover references remain; search for DAILY_NOTE_PAGE_TITLE_REGEX in this module to confirm it's not used anywhere before removing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/utils/conditionToDatalog.ts`:
- Around line 60-70: The data-pattern branch returns a variable named
`${source}-log-id` which breaks the file's PascalCase suffix convention; update
the variable name to `${source}-Log` in the returned object inside
conditionToDatalog (the block that currently creates the data-pattern with
constant ":log/id") and update any corresponding tests to expect "node-Log" (or
`${source}-Log`) instead of "node-log-id". Ensure the change is applied where
this pattern is built so it matches other occurrences like the variable names
used on lines referencing `-Log` elsewhere in this module.
- Line 1: The import DAILY_NOTE_PAGE_TITLE_REGEX is unused in
conditionToDatalog.ts; remove the named import from the import statement (delete
DAILY_NOTE_PAGE_TITLE_REGEX) so the file no longer imports an unused symbol, and
run the linter/format step to ensure no leftover references remain; search for
DAILY_NOTE_PAGE_TITLE_REGEX in this module to confirm it's not used anywhere
before removing.
Requested by Ivo in slack
Summary by CodeRabbit
Refactor
Tests