Skip to content

Conversation

@trangdoan982
Copy link
Collaborator

@trangdoan982 trangdoan982 commented Nov 10, 2025

Summary by CodeRabbit

Release Notes

  • New Features
    • Streamline styling toggle added: New optional styling mode that provides refined visual styling for page references, checkboxes, sidebar, tables, and other interface elements when enabled.

Ability for user to select "streamlined styling" in the settings

Screenshot 2025-11-12 at 15 25 15

Streamlined styling includes:

"Subtle block styling" (DIS-562)

Optionally includes the following:

Page links underlined, gray
Screenshot 2025-11-12 at 15 25 44

Make all headers the same color

  • it's already all black text

Todo boxes gray
Screenshot 2025-11-12 at 15 25 58

Right sidebar: white background
Screenshot 2025-11-12 at 15 26 43

Table: no bg colors in rows or body of table
Screenshot 2025-11-12 at 15 28 06

@linear
Copy link

linear bot commented Nov 10, 2025

@supabase
Copy link

supabase bot commented Nov 10, 2025

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@trangdoan982
Copy link
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

📝 Walkthrough

Walkthrough

The pull request adds a streamline styling feature toggle to the Roam application. A new setting key is introduced in userSettings, a checkbox is added to HomePersonalSettings for users to enable/disable the feature, and conditional logic in index.ts loads the styles only when enabled. A new stylesheet module exports the streamline styling CSS.

Changes

Cohort / File(s) Summary
Settings Configuration
apps/roam/src/data/userSettings.ts
Added new exported constant STREAMLINE_STYLING_KEY ("streamline-styling") to define the settings key.
Styles
apps/roam/src/styles/streamlineStyling.ts
New module exporting a default CSS string with streamline styling for page references, checkboxes, sidebar, tables, and related UI elements.
Settings UI
apps/roam/src/components/settings/HomePersonalSettings.tsx
Added checkbox control for streamline styling feature toggle that reads from and writes to settings via getSetting and setSetting; injects or removes the style element on toggle.
Initialization
apps/roam/src/index.ts
Added conditional logic to read the streamline styling setting and conditionally include the style element in the rendered output only when enabled.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Settings as HomePersonalSettings
    participant Store as Settings Store
    participant Index as index.ts
    participant DOM

    rect rgb(240, 248, 255)
    Note over User,DOM: Application Initialization
    Index->>Store: getSetting(STREAMLINE_STYLING_KEY)
    Store-->>Index: setting value (true/false)
    alt Setting Enabled
        Index->>Index: Create streamlineStyleElement
        Index->>DOM: Append style element
    end
    end

    rect rgb(240, 248, 255)
    Note over User,DOM: User Toggles Feature
    User->>Settings: Click streamline checkbox
    Settings->>Store: setSetting(STREAMLINE_STYLING_KEY, checked)
    Store-->>Settings: Setting persisted
    alt Checked
        Settings->>Settings: addStyle(streamlineStyling)
        Settings->>DOM: Inject style#streamline-styling
    else Unchecked
        Settings->>DOM: Remove style#streamline-styling
    end
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • The new CSS stylesheet should be reviewed for visual correctness and selector specificity, particularly the styling rules for page references, checkboxes, and sidebar elements.
  • The settings integration follows existing patterns consistently across all three UI and initialization touch points.
  • Conditional logic in index.ts is straightforward but verify the style element ID matching between injection and removal.

Possibly related PRs

  • Consolidate UI settings #109: Modifies the same HomePersonalSettings component to convert checkboxes to Switch components, which may affect the UI consistency of the newly added streamline-styling checkbox.

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[ENG-1025] Integrate subtle controls css styling into plugin' directly relates to the main changeset, which introduces streamline styling (CSS styling feature) as a toggleable option in the plugin.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
apps/roam/src/styles/streamlineStyling.ts (2)

36-36: Minor: Remove extra space before semicolon.

There's an extra space before the semicolon on this line.

Apply this diff:

-  border: 1px solid rgba(171, 171, 171, 0.5) ;
+  border: 1px solid rgba(171, 171, 171, 0.5);

1-98: Consider theme compatibility for future iterations.

The CSS uses hardcoded colors (grays, whites) that may not adapt to different Roam themes or dark mode. While acceptable for an opt-in feature, consider using CSS variables or theme-aware colors in future updates to improve compatibility.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08113a9 and 92189c8.

📒 Files selected for processing (4)
  • apps/roam/src/components/settings/HomePersonalSettings.tsx (3 hunks)
  • apps/roam/src/data/userSettings.ts (1 hunks)
  • apps/roam/src/index.ts (4 hunks)
  • apps/roam/src/styles/streamlineStyling.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/main.mdc)

**/*.{ts,tsx}: Prefer type over interface
Use explicit return types for functions
Avoid any types when possible

Files:

  • apps/roam/src/data/userSettings.ts
  • apps/roam/src/styles/streamlineStyling.ts
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
  • apps/roam/src/index.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/main.mdc)

**/*.{ts,tsx,js,jsx}: Prefer arrow functions over regular function declarations
Use named parameters (object destructuring) when a function has more than 2 parameters
Use Prettier with the project's configuration
Maintain consistent naming conventions: PascalCase for components and types
Maintain consistent naming conventions: camelCase for variables and functions
Maintain consistent naming conventions: UPPERCASE for constants

Files:

  • apps/roam/src/data/userSettings.ts
  • apps/roam/src/styles/streamlineStyling.ts
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
  • apps/roam/src/index.ts
apps/roam/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)

apps/roam/**/*.{js,jsx,ts,tsx}: Use BlueprintJS 3 components and Tailwind CSS for platform-native UI in the Roam Research extension
Use the roamAlphaApi documentation from https://roamresearch.com/#/app/developer-documentation/page/tIaOPdXCj when working with the Roam API
Use Roam Depot/Extension API documentation from https://roamresearch.com/#/app/developer-documentation/page/y31lhjIqU when working with the Roam Extension API

Files:

  • apps/roam/src/data/userSettings.ts
  • apps/roam/src/styles/streamlineStyling.ts
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
  • apps/roam/src/index.ts
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-07-19T22:34:23.619Z
Learning: Applies to apps/roam/**/*.{js,jsx,ts,tsx} : Use BlueprintJS 3 components and Tailwind CSS for platform-native UI in the Roam Research extension
📚 Learning: 2025-07-08T14:51:55.299Z
Learnt from: maparent
Repo: DiscourseGraphs/discourse-graph PR: 0
File: :0-0
Timestamp: 2025-07-08T14:51:55.299Z
Learning: DiscourseGraphs maintainers prefer not to add narrowly typed definitions for individual `process.env` keys to avoid unnecessary coupling.

Applied to files:

  • apps/roam/src/data/userSettings.ts
📚 Learning: 2025-07-19T22:34:23.619Z
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-07-19T22:34:23.619Z
Learning: Applies to apps/roam/**/*.{js,jsx,ts,tsx} : Use BlueprintJS 3 components and Tailwind CSS for platform-native UI in the Roam Research extension

Applied to files:

  • apps/roam/src/styles/streamlineStyling.ts
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
  • apps/roam/src/index.ts
📚 Learning: 2025-07-19T22:34:08.725Z
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/main.mdc:0-0
Timestamp: 2025-07-19T22:34:08.725Z
Learning: Applies to {apps/website,packages/ui}/**/*.{tsx,jsx} : When refactoring inline styles, use tailwind classes

Applied to files:

  • apps/roam/src/styles/streamlineStyling.ts
  • apps/roam/src/components/settings/HomePersonalSettings.tsx
  • apps/roam/src/index.ts
📚 Learning: 2025-07-19T22:34:08.725Z
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/main.mdc:0-0
Timestamp: 2025-07-19T22:34:08.725Z
Learning: Applies to apps/website/**/*.{tsx,jsx,ts,js} : Use Tailwind CSS for styling where possible

Applied to files:

  • apps/roam/src/styles/streamlineStyling.ts
📚 Learning: 2025-07-19T22:34:23.619Z
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-07-19T22:34:23.619Z
Learning: Applies to apps/roam/**/*.{js,jsx,ts,tsx} : Use Roam Depot/Extension API documentation from https://roamresearch.com/#/app/developer-documentation/page/y31lhjIqU when working with the Roam Extension API

Applied to files:

  • apps/roam/src/styles/streamlineStyling.ts
  • apps/roam/src/index.ts
📚 Learning: 2025-07-19T22:34:23.619Z
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-07-19T22:34:23.619Z
Learning: Applies to apps/roam/**/*.{js,jsx,ts,tsx} : Use the roamAlphaApi documentation from https://roamresearch.com/#/app/developer-documentation/page/tIaOPdXCj when working with the Roam API

Applied to files:

  • apps/roam/src/styles/streamlineStyling.ts
  • apps/roam/src/index.ts
📚 Learning: 2025-07-19T22:34:23.619Z
Learnt from: CR
Repo: DiscourseGraphs/discourse-graph PR: 0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-07-19T22:34:23.619Z
Learning: Applies to apps/roam/package.json : Prefer existing dependencies from package.json when adding or using dependencies in the Roam Research extension

Applied to files:

  • apps/roam/src/index.ts
📚 Learning: 2025-08-26T01:52:35.443Z
Learnt from: mdroidian
Repo: DiscourseGraphs/discourse-graph PR: 369
File: apps/roam/src/utils/pluginTimer.ts:14-21
Timestamp: 2025-08-26T01:52:35.443Z
Learning: In the discourse-graph codebase, initPluginTimer() is only called once during the runExtension flow in apps/roam/src/index.ts, so re-initialization scenarios are not a concern for this specific usage pattern.

Applied to files:

  • apps/roam/src/index.ts
🔇 Additional comments (4)
apps/roam/src/data/userSettings.ts (1)

10-10: LGTM!

The new setting key follows the established naming convention and export pattern.

apps/roam/src/components/settings/HomePersonalSettings.tsx (1)

232-261: LGTM! Clean DOM management with duplicate prevention.

The checkbox implementation correctly:

  • Checks for existing style elements before adding
  • Assigns a consistent id for later retrieval
  • Removes the element when disabled

The pattern matches the existing DISCOURSE_CONTEXT_OVERLAY_IN_CANVAS_KEY approach.

apps/roam/src/index.ts (2)

118-125: Clean conditional feature loading.

The streamline styling is properly gated behind the user setting and assigns a consistent id for DOM management.


181-181: Proper cleanup handling via elements array.

The conditional spread correctly includes the style element only when enabled, ensuring the extension framework can clean it up on unload.

Copy link
Contributor

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

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

👍 Nice.

I'd also recommend creating a [[Streamline styling test]] (or similar) in the discourse-graphs graph so our team can quickly test it.

eg (just add all elements that are affected/worth seeing)

Image

@trangdoan982
Copy link
Collaborator Author

next action: rebase and wait for Matt + Johnny's review

Copy link
Contributor

@mattakamatsu mattakamatsu left a comment

Choose a reason for hiding this comment

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

Love it! Sorry that I missed this review. In both graphs I tried this in, I had an audible sigh of relief at the lessened visual noise 😊 Let's merge it! Here's how it looked for me:

https://www.loom.com/share/4f9d12fbc5e641bfbf2be2872f5e4bce

@trangdoan982 trangdoan982 force-pushed the eng-1025-integrate-subtle-controls-css-styling-into-plugin branch from 478777f to cffcf11 Compare December 4, 2025 19:54
@trangdoan982 trangdoan982 merged commit f8e9e17 into main Dec 4, 2025
5 checks passed
@trangdoan982 trangdoan982 deleted the eng-1025-integrate-subtle-controls-css-styling-into-plugin branch December 4, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants