Skip to content

feat: implement referencing next styles & improve fill handling#7482

Open
davidkna wants to merge 4 commits into
starship:mainfrom
davidkna:next-style
Open

feat: implement referencing next styles & improve fill handling#7482
davidkna wants to merge 4 commits into
starship:mainfrom
davidkna:next-style

Conversation

@davidkna

@davidkna davidkna commented May 17, 2026

Copy link
Copy Markdown
Member

Description

Add ability to reference next modules' foreground and background. Useful to make a spacer seperating 2 modules, merging the style of both.

I also added some changes to $fill handling. Unlike #7381 next-segment styles are only read one-step ahead.

Motivation and Context

Closes #7381
Closes #5059

Screenshots (if appropriate):

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Checklist:

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@cubic-dev-ai cubic-dev-ai 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.

3 issues found across 5 files

Confidence score: 3/5

  • There is some merge risk due to two medium-severity, high-confidence rendering issues in src/config.rs and src/module.rs, so this is not quite in the “safe with minimal risk” range yet.
  • In src/config.rs, reference color resolution appears to clear existing fg/bg when only one side of StyleRefs is present, which can cause boundary segments to lose fallback colors and display incorrectly.
  • In src/module.rs, adjacent fill segments may read next_* styles from trailing text rather than the immediate next segment, creating incorrect style transitions between segments.
  • Pay close attention to src/config.rs, src/module.rs - style resolution and next-segment lookup can misapply colors at segment boundaries.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/advanced-config/README.md">

<violation number="1" location="docs/advanced-config/README.md:669">
P3: Fix duplicated wording in the new style-token documentation (`can not be be`).</violation>
</file>

<file name="src/config.rs">

<violation number="1" location="src/config.rs:337">
P2: Reference color resolution clears existing fg/bg when only one side of `StyleRefs` is present, causing boundary segments to lose fallback colors.</violation>
</file>

<file name="src/module.rs">

<violation number="1" location="src/module.rs:259">
P2: Adjacent fill segments can resolve `next_*` styles from trailing text instead of the immediate next segment.</violation>
</file>

Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic

Comment thread src/config.rs Outdated
Comment thread src/module.rs Outdated
Comment thread docs/advanced-config/README.md Outdated
Co-Authored-By: Christophe Henry <christophehenry@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai 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.

0 issues found across 1 file (changes from recent commits).

Shadow auto-approve: would require human review. This PR modifies core rendering logic by adding next-style references and overhauling fill-segment width handling, which impacts style propagation across all modules and increases the risk of subtle bugs in prompt layout and color output.
Re-trigger cubic

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai 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.

0 issues found across 1 file (changes from recent commits).

Shadow auto-approve: would not auto-approve. Auto-approval blocked by 1 unresolved issue from previous reviews.
Re-trigger cubic

@cubic-dev-ai cubic-dev-ai 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.

0 issues found across 1 file (changes from recent commits).

Shadow auto-approve: would require human review. This PR introduces significant changes to core styling and fill logic across multiple files, including new concept of next segment style references and refactored fill handling, which has a broad blast radius and could affect how all modules render; human review is needed to ensure correctness...
Re-trigger cubic

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.

multiple fills do not fill the line perfectly

1 participant