Skip to content

Conversation

@0ski
Copy link
Collaborator

@0ski 0ski commented Jan 26, 2026

Closes #

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

Tested the MiddleTruncate component in the TasksDropdown by:

  1. Verifying that long task names (e.g., "namespace:category:subcategory:task-name") are truncated in the middle
  2. Confirming the full text appears in a tooltip on hover
  3. Testing responsive behavior - truncation adjusts when the container is resized
  4. Verifying that short task names that fit within the container are displayed in full without truncation

Changelog

Added a new MiddleTruncate primitive component that intelligently truncates text in the middle while preserving the beginning and end portions. This is particularly useful for long hierarchical identifiers like task slugs.

Key features:

  • Truncates text in the middle with an ellipsis (…) when it exceeds available width
  • Shows full text in a tooltip on hover when truncated
  • Responsive - recalculates truncation on container resize using ResizeObserver
  • Maintains minimum character visibility (4 chars minimum on each side for readability)
  • Integrated into TasksDropdown to handle long task names

Changes:

  • Created new MiddleTruncate.tsx component with binary search algorithm for optimal character distribution
  • Updated TasksDropdown to use MiddleTruncate for task slug display
  • Increased TasksDropdown popover width from 240px to 360px to provide better space for truncated text

Screenshots

💯

Tasks.mp4

Open with Devin

@changeset-bot
Copy link

changeset-bot bot commented Jan 26, 2026

⚠️ No Changeset found

Latest commit: b011415

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 26, 2026

Walkthrough

Adds a new React component MiddleTruncate (MiddleTruncateProps) that measures rendered text width using hidden measurement spans and DOM refs, computes a middle truncation (preserving leading and trailing segments with minimum character constraints) via a calculateTruncation callback, and updates on container resize via ResizeObserver. When truncated, it shows the full text in a SimpleTooltip. Integrates MiddleTruncate into RunFilters.tsx to render task slugs in the TasksDropdown and increases that dropdown’s max width from min(240px, ...) to min(360px, ...).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description is mostly complete with filled Testing and Changelog sections, but the issue number is missing after 'Closes #'.
Title check ✅ Passed The title accurately summarizes the main change: introducing a MiddleTruncate component for handling long task names, which is the primary focus of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View issue and 4 additional flags in Devin Review.

Open in Devin Review

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

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: 1

🤖 Fix all issues with AI agents
In `@apps/webapp/app/components/primitives/MiddleTruncate.tsx`:
- Around line 85-103: After enforcing the minimum characters (minChars) for
startChars/endChars, re-measure against the available targetWidth (or the
measuring logic used in the fitting loop) and if the enforced minimums cause the
rendered width to exceed targetWidth, revert to the previous last-fit values
(the values computed before forcing minChars) or fall back to a safe
ellipsis-only display; update setDisplayText and setIsTruncated accordingly.
Locate the logic that enforces minChars and the variables startChars, endChars,
targetWidth (or the measuring routine) and ensure you preserve the last-fit
start/end counts before overwriting them so you can restore them when the
post-min re-check fails.
🧹 Nitpick comments (1)
apps/webapp/app/components/primitives/MiddleTruncate.tsx (1)

5-8: Use a type alias for props to match TS style.

MiddleTruncateProps is declared as an interface, but the repo guideline for *.ts/tsx prefers type aliases. Please confirm this aligns with the current TypeScript style rules and consider switching.

♻️ Proposed change
-interface MiddleTruncateProps {
-  text: string;
-  className?: string;
-}
+type MiddleTruncateProps = {
+  text: string;
+  className?: string;
+};

As per coding guidelines, prefer types over interfaces.

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 825219a and 8a8762f.

📒 Files selected for processing (2)
  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

**/*.{ts,tsx}: Always import tasks from @trigger.dev/sdk, never use @trigger.dev/sdk/v3 or deprecated client.defineJob pattern
Every Trigger.dev task must be exported and have a unique id property with no timeouts in the run function

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use zod for validation in packages/core and apps/webapp

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Import from @trigger.dev/core using subpaths only, never import from root

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
apps/webapp/app/**/*.{ts,tsx}

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

Access all environment variables through the env export of env.server.ts instead of directly accessing process.env in the Trigger.dev webapp

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
apps/webapp/**/*.{ts,tsx}

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

apps/webapp/**/*.{ts,tsx}: When importing from @trigger.dev/core in the webapp, use subpath exports from the package.json instead of importing from the root path
Follow the Remix 2.1.0 and Express server conventions when updating the main trigger.dev webapp

Access environment variables via env export from apps/webapp/app/env.server.ts, never use process.env directly

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
**/*.{js,ts,jsx,tsx,json,md,yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier before committing

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
🧠 Learnings (4)
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Export tasks with unique IDs within the project to enable proper task discovery and execution

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Attach metadata to task runs using the metadata option when triggering, and access/update it inside runs using metadata functions

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `trigger.dev/sdk/v3` for all imports in Trigger.dev tasks

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-01-15T11:50:06.067Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-15T11:50:06.067Z
Learning: Applies to **/*.{ts,tsx} : Always import tasks from `trigger.dev/sdk`, never use `trigger.dev/sdk/v3` or deprecated `client.defineJob` pattern

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (22)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: typecheck / typecheck
🔇 Additional comments (2)
apps/webapp/app/components/runs/v3/RunFilters.tsx (2)

34-34: MiddleTruncate integration looks solid.

Wiring the new component into task slug rendering should keep long hierarchical names readable while preserving full values via tooltip.

Also applies to: 658-658


638-638: Popover width bump aligns with longer slugs.

The min(360px, …) cap is a sensible companion to the new truncation behavior.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View issue and 7 additional flags in Devin Review.

Open in Devin Review

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: 1

🤖 Fix all issues with AI agents
In `@apps/webapp/app/components/primitives/MiddleTruncate.tsx`:
- Around line 119-135: Wrap usage of ResizeObserver with a presence check to
avoid runtime errors when it is undefined: inside the useLayoutEffect that calls
calculateTruncation() (and where ResizeObserver is constructed) guard
creation/observation with a check like typeof ResizeObserver !== "undefined"
before new ResizeObserver(...) and observing container.parentElement, and skip
or fallback when unavailable; apply the same guard in the EnvironmentLabel
component at the ResizeObserver usage (around the observer
creation/observe/disconnect logic) so both calculateTruncation/useLayoutEffect
in MiddleTruncate and the ResizeObserver block in EnvironmentLabel only run when
ResizeObserver exists.
🧹 Nitpick comments (1)
apps/webapp/app/components/primitives/MiddleTruncate.tsx (1)

61-83: Clarify the “binary search” comment.
The loop is incremental/alternating rather than a binary search, so the comment is misleading.

📝 Suggested wording fix
-    // Binary search for optimal character counts
+    // Incrementally find the optimal character counts
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a8762f and e402153.

📒 Files selected for processing (1)
  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

**/*.{ts,tsx}: Always import tasks from @trigger.dev/sdk, never use @trigger.dev/sdk/v3 or deprecated client.defineJob pattern
Every Trigger.dev task must be exported and have a unique id property with no timeouts in the run function

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use zod for validation in packages/core and apps/webapp

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Import from @trigger.dev/core using subpaths only, never import from root

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
apps/webapp/app/**/*.{ts,tsx}

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

Access all environment variables through the env export of env.server.ts instead of directly accessing process.env in the Trigger.dev webapp

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
apps/webapp/**/*.{ts,tsx}

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

apps/webapp/**/*.{ts,tsx}: When importing from @trigger.dev/core in the webapp, use subpath exports from the package.json instead of importing from the root path
Follow the Remix 2.1.0 and Express server conventions when updating the main trigger.dev webapp

Access environment variables via env export from apps/webapp/app/env.server.ts, never use process.env directly

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
**/*.{js,ts,jsx,tsx,json,md,yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier before committing

Files:

  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
🧬 Code graph analysis (1)
apps/webapp/app/components/primitives/MiddleTruncate.tsx (2)
apps/webapp/app/utils/cn.ts (1)
  • cn (77-79)
apps/webapp/app/components/primitives/Tooltip.tsx (1)
  • SimpleTooltip (141-141)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: typecheck / typecheck
🔇 Additional comments (2)
apps/webapp/app/components/primitives/MiddleTruncate.tsx (2)

1-8: Props typing and imports look good.
Type alias aligns with TS style guidance, and the imports are clean.


137-163: Render + tooltip integration looks solid.
Hidden measurement span and tooltip-on-truncate behavior are clean and readable.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View issue and 3 additional flags in Devin Review.

Open in Devin Review

claude and others added 8 commits January 27, 2026 18:47
When task names are too long to fit in the dropdown, truncate in the
middle (showing beginning...end) instead of just cutting off the end.
This helps users identify tasks with colon-namespaced names where the
unique part may be at the end. Show full name in tooltip on hover.
Increased the max-width of the TasksDropdown SelectPopover from 240px
to 360px to provide more space for viewing task names, especially those
with colon-namespaced naming conventions.
…cated

Changed the SelectPopover min-width from 0 to 360px to ensure the dropdown
always has adequate space for displaying task names with middle truncation.
This prevents the dropdown from becoming too narrow when long task names
are present.

Slack thread: https://triggerdotdev.slack.com/archives/C032WA2S43F/p1769451219774789?thread_ts=1769436524.157219&cid=C032WA2S43F

https://claude.ai/code/session_01KrFXrmK7jz9sWTcS8pMtXL
…runcated

When text is truncated, apply min-w-[360px] to the MiddleTruncate component
to ensure the truncated text has adequate display space. This matches the
max-width of the dropdown popup and prevents the component from becoming
too narrow.

Slack thread: https://triggerdotdev.slack.com/archives/C032WA2S43F/p1769451219774789?thread_ts=1769436524.157219&cid=C032WA2S43F

https://claude.ai/code/session_01KrFXrmK7jz9sWTcS8pMtXL
- Changed interface to type alias to match repo TS style conventions
- Added re-measurement after enforcing minChars to prevent overflow
  in narrow containers
- Changed min-w-[360px] to min-w-full to prevent layout overflow when
  popover width is constrained on narrow viewports

https://claude.ai/code/session_01KrFXrmK7jz9sWTcS8pMtXL
- Fixed misleading comment: "Binary search" → "Incrementally find"
- Added ResizeObserver guard for jsdom/older browser compatibility

https://claude.ai/code/session_01KrFXrmK7jz9sWTcS8pMtXL
Increase the minimum width for the run slug display inside the
RunFilters select dropdown so long slugs are less likely to be
truncated prematurely. Change MiddleTruncate to include a
min-w-[360px] class on the SelectItem content to provide more room
for slugs and improve readability in the runs filter UI.
@0ski 0ski force-pushed the claude/slack-fix-branch-name-truncation-9PMl9 branch from a0e401c to 3df5767 Compare January 27, 2026 18:10
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View issue and 7 additional flags in Devin Review.

Open in Devin Review

…ible

min-w-[360px] class allows to keep reasonable spacing when there is only
one item on the list
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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/webapp/app/components/runs/v3/RunFilters.tsx (1)

638-659: Fixed 360px min‑width can overflow on narrow viewports.
Line 658 forces min-w-[360px] while the popover max width is min(360px, var(--popover-available-width)). When available width is smaller, this can cause horizontal overflow and prevent MiddleTruncate from measuring the real width.

🛠️ Suggested tweak
-              <MiddleTruncate text={item.slug} className="min-w-[360px]"/>
+              <MiddleTruncate text={item.slug} className="min-w-0" />
🤖 Fix all issues with AI agents
In `@apps/webapp/app/components/primitives/MiddleTruncate.tsx`:
- Around line 49-54: The current truncation math double‑counts the ellipsis: you
measure the ellipsis into `measure.textContent` and compute `ellipsisWidth`, but
then subtract `ellipsisWidth` again when computing `targetWidth` (`const
targetWidth = availableWidth - ellipsisWidth - 4`), causing over‑truncation;
update the calculation to use the available width already accounting for the
ellipsis measurement (remove the extra `- ellipsisWidth`) or otherwise ensure
`targetWidth` aligns with how `measure` is used so `ellipsisWidth` is not
subtracted twice—adjust the `targetWidth`, `ellipsis`, `measure`, and
`ellipsisWidth` usage accordingly.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0e401c and 3df5767.

📒 Files selected for processing (2)
  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

**/*.{ts,tsx}: Always import tasks from @trigger.dev/sdk, never use @trigger.dev/sdk/v3 or deprecated client.defineJob pattern
Every Trigger.dev task must be exported and have a unique id property with no timeouts in the run function

Files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use zod for validation in packages/core and apps/webapp

Files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Import from @trigger.dev/core using subpaths only, never import from root

Files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
apps/webapp/app/**/*.{ts,tsx}

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

Access all environment variables through the env export of env.server.ts instead of directly accessing process.env in the Trigger.dev webapp

Files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
apps/webapp/**/*.{ts,tsx}

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

apps/webapp/**/*.{ts,tsx}: When importing from @trigger.dev/core in the webapp, use subpath exports from the package.json instead of importing from the root path
Follow the Remix 2.1.0 and Express server conventions when updating the main trigger.dev webapp

Access environment variables via env export from apps/webapp/app/env.server.ts, never use process.env directly

Files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
**/*.{js,ts,jsx,tsx,json,md,yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier before committing

Files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/components/primitives/MiddleTruncate.tsx
🧠 Learnings (8)
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Export tasks with unique IDs within the project to enable proper task discovery and execution

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Attach metadata to task runs using the metadata option when triggering, and access/update it inside runs using metadata functions

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-01-15T11:50:06.067Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-15T11:50:06.067Z
Learning: Applies to **/*.{ts,tsx} : Every Trigger.dev task must be exported and have a unique `id` property with no timeouts in the run function

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `trigger.dev/sdk/v3` for all imports in Trigger.dev tasks

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-01-15T11:50:06.067Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-15T11:50:06.067Z
Learning: Applies to **/*.{ts,tsx} : Always import tasks from `trigger.dev/sdk`, never use `trigger.dev/sdk/v3` or deprecated `client.defineJob` pattern

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `schedules.task()` for scheduled/cron tasks instead of regular `task()`

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Limit task duration using the `maxDuration` property (in seconds)

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Subscribe to run updates using `runs.subscribeToRun()` for realtime monitoring of task execution

Applied to files:

  • apps/webapp/app/components/runs/v3/RunFilters.tsx
🧬 Code graph analysis (1)
apps/webapp/app/components/runs/v3/RunFilters.tsx (1)
apps/webapp/app/components/primitives/MiddleTruncate.tsx (1)
  • MiddleTruncate (16-168)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: Analyze (javascript-typescript)

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@0ski 0ski changed the title Add MiddleTruncate component for long task names feat(webapp): Add MiddleTruncate component for long task names Jan 27, 2026
@0ski
Copy link
Collaborator Author

0ski commented Jan 27, 2026

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)

apps/webapp/app/components/runs/v3/RunFilters.tsx (1)> 638-659: Fixed 360px min‑width can overflow on narrow viewports.

Line 658 forces min-w-[360px] while the popover max width is min(360px, var(--popover-available-width)). When available width is smaller, this can cause horizontal overflow and prevent MiddleTruncate from measuring the real width.

🛠️ Suggested tweak

-              <MiddleTruncate text={item.slug} className="min-w-[360px]"/>
+              <MiddleTruncate text={item.slug} className="min-w-0" />

🤖 Fix all issues with AI agents

In `@apps/webapp/app/components/primitives/MiddleTruncate.tsx`:
- Around line 49-54: The current truncation math double‑counts the ellipsis: you
measure the ellipsis into `measure.textContent` and compute `ellipsisWidth`, but
then subtract `ellipsisWidth` again when computing `targetWidth` (`const
targetWidth = availableWidth - ellipsisWidth - 4`), causing over‑truncation;
update the calculation to use the available width already accounting for the
ellipsis measurement (remove the extra `- ellipsisWidth`) or otherwise ensure
`targetWidth` aligns with how `measure` is used so `ellipsisWidth` is not
subtracted twice—adjust the `targetWidth`, `ellipsis`, `measure`, and
`ellipsisWidth` usage accordingly.

📜 Review details

Tested it, and the min-w-360 is needed to keep the nice UX, I couldn't overflow it

Copy link
Collaborator

@nicktrn nicktrn left a comment

Choose a reason for hiding this comment

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

👌

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.

4 participants