Skip to content

fix: implementation of path ellipsizing and overflow affordance for project names#38094

Open
willkhinz wants to merge 1 commit intoPlatformNetwork:mainfrom
willkhinz:fix-bug-alpha-welcomerecentfiles-long-projec-1774468054
Open

fix: implementation of path ellipsizing and overflow affordance for project names#38094
willkhinz wants to merge 1 commit intoPlatformNetwork:mainfrom
willkhinz:fix-bug-alpha-welcomerecentfiles-long-projec-1774468054

Conversation

@willkhinz
Copy link
Copy Markdown

@willkhinz willkhinz commented Mar 25, 2026

Description

This PR addresses the issue where long project names in the WelcomeRecentFiles section can overflow the row, and the ellipsized path lacks a full-path affordance. The changes made ensure that project names are properly truncated and provide a way to view the full path.

Related Issue

Fixes #<issue number not provided, please refer to https://github.com/PlatformNetwork/bounty-challenge>

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Testing

To verify the changes, the following commands were run:

cargo test
cargo clippy

These tests ensure that the fix does not introduce any new issues and that the functionality works as expected.

Screenshots (if applicable)

No screenshots are provided as the changes are primarily related to code functionality rather than visual interface updates.

Summary by CodeRabbit

  • Documentation
    • Added design proposal documentation for improving text truncation and visibility of file paths in recent projects list.

…overflow the row; ellipsized path has no full-path affordance

Signed-off-by: willkhinz <hinzwilliam52@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

A new FIX_PROPOSAL.md documentation file is added that proposes a UI improvement to the WelcomeRecentFiles component. The proposal sketches a RecentProject component with text truncation using CSS and Material-UI Tooltip integration to handle overflow project names and paths.

Changes

Cohort / File(s) Summary
Documentation
FIX_PROPOSAL.md
New proposal document outlining a React component design with text truncation via overflow: hidden, textOverflow: ellipsis, and tooltip functionality for displaying full project path information.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit hops through code proposals bright,
With tooltips and truncation—such a sight!
Projects displayed, paths hidden with care,
Ellipsis magic floating in the air, 🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: implementing text ellipsizing and overflow handling for project names in the WelcomeRecentFiles component, which directly addresses the PR's bug-fix objectives.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown

@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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@FIX_PROPOSAL.md`:
- Around line 1-55: The PR only adds a proposal and does not change the actual
WelcomeRecentFiles.tsx implementation; update the real component file by adding
a RecentProject component (or modifying the existing one) to apply CSS
truncation (overflow:hidden, textOverflow:ellipsis, whiteSpace:nowrap, maxWidth)
to the project name and path, and wrap the truncated projectPath with a Tooltip
(imported from `@material-ui/core`) so hovering shows the full path; ensure
WelcomeRecentFiles renders recentProjects.map(project => <RecentProject
key={project.id} project={project} />) and that you use the project.name and
project.path properties (projectName, projectPath) in the component.
- Around line 15-33: The two span elements with styles for truncation are
missing proper layout constraints: update their style to include a layout and
shrink rules (e.g., add display: 'inline-block' or display: 'block' plus
maxWidth, or if inside a flex container use flex: '1 1 0' and minWidth: 0) so
textOverflow: 'ellipsis' reliably truncates; ensure both spans (the one
rendering {projectName} and the other) include a title attribute for full text
tooltip and keep overflow: 'hidden', whiteSpace: 'nowrap', textOverflow:
'ellipsis' in the same style object to guarantee behavior.
- Line 7: The proposed import of Tooltip from '@material-ui/core' in
FIX_PROPOSAL.md references a TypeScript/React component (WelcomeRecentFiles.tsx)
that does not belong in this Rust backend repository; clarify intent by
confirming whether WelcomeRecentFiles.tsx and the Material-UI dependency are
meant for a separate frontend project or should be added to this repo, and if
they belong elsewhere, remove the frontend-specific proposal from
FIX_PROPOSAL.md or update it to point to the correct frontend repository; if the
frontend is intended to be added here, include a plan to add package.json, the
React/TypeScript scaffold, and the proper `@material-ui/core` dependency before
keeping the import suggestion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ca4e56d8-c4cb-44bc-af78-fd85f15d3271

📥 Commits

Reviewing files that changed from the base of the PR and between ec21e1b and a6f83af.

📒 Files selected for processing (1)
  • FIX_PROPOSAL.md

Comment on lines +1 to +55
To solve this issue, we need to modify the `WelcomeRecentFiles.tsx` component to handle long project names and provide a way to view the full path when it's truncated. Here's the exact code fix:

```tsx
// src/components/cortex/WelcomeRecentFiles.tsx

import React from 'react';
import { Tooltip } from '@material-ui/core';

const RecentProject = ({ project }) => {
const projectName = project.name;
const projectPath = project.path;

return (
<button>
<span
style={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
maxWidth: '50%', // adjust the max width as needed
}}
title={projectName}
>
{projectName}
</span>
<span
style={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
maxWidth: '50%', // adjust the max width as needed
}}
>
<Tooltip title={projectPath}>
<span>{projectPath}</span>
</Tooltip>
</span>
</button>
);
};

const WelcomeRecentFiles = () => {
// ... existing code ...

return (
<div>
{recentProjects.map((project) => (
<RecentProject key={project.id} project={project} />
))}
</div>
);
};

export default WelcomeRecentFiles;
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

This PR does not implement the bug fix in production code.

The changes only add a Markdown proposal; WelcomeRecentFiles.tsx is not actually modified in this diff. As-is, the overflow/affordance bug remains unresolved.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@FIX_PROPOSAL.md` around lines 1 - 55, The PR only adds a proposal and does
not change the actual WelcomeRecentFiles.tsx implementation; update the real
component file by adding a RecentProject component (or modifying the existing
one) to apply CSS truncation (overflow:hidden, textOverflow:ellipsis,
whiteSpace:nowrap, maxWidth) to the project name and path, and wrap the
truncated projectPath with a Tooltip (imported from `@material-ui/core`) so
hovering shows the full path; ensure WelcomeRecentFiles renders
recentProjects.map(project => <RecentProject key={project.id} project={project}
/>) and that you use the project.name and project.path properties (projectName,
projectPath) in the component.

// src/components/cortex/WelcomeRecentFiles.tsx

import React from 'react';
import { Tooltip } from '@material-ui/core';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking declared MUI packages in package manifests..."
fd 'package.json$' -H -E node_modules | xargs -I{} sh -c '
  echo "--- {} ---"
  jq -r ".dependencies, .devDependencies | keys[]?" "{}" | rg "^(?:`@mui/material`|@material-ui/core)$" || true
'

echo
echo "Checking existing imports in TS/TSX files..."
rg -n --type=ts --type=tsx "from '@mui/material'|from '@material-ui/core'"

Repository: PlatformNetwork/bounty-challenge

Length of output: 221


🏁 Script executed:

#!/bin/bash
# Read package.json to check MUI dependencies
find . -name "package.json" -not -path "*/node_modules/*" | head -5 | xargs -I{} sh -c 'echo "=== {} ===" && cat "{}"'

Repository: PlatformNetwork/bounty-challenge

Length of output: 58


🏁 Script executed:

#!/bin/bash
# Search for existing MUI imports with corrected syntax
rg -n "from ['\"]@(mui|material-ui)" --multiline

Repository: PlatformNetwork/bounty-challenge

Length of output: 138


🏁 Script executed:

#!/bin/bash
# Read FIX_PROPOSAL.md to understand the context
cat FIX_PROPOSAL.md

Repository: PlatformNetwork/bounty-challenge

Length of output: 2246


🏁 Script executed:

#!/bin/bash
# Find and read package.json explicitly
find . -maxdepth 3 -name "package.json" -not -path "*/node_modules/*" -exec cat {} \;

Repository: PlatformNetwork/bounty-challenge

Length of output: 58


🏁 Script executed:

#!/bin/bash
# Check if WelcomeRecentFiles.tsx exists and examine its current imports
find . -name "WelcomeRecentFiles.tsx" -not -path "*/node_modules/*" -exec cat {} \;

Repository: PlatformNetwork/bounty-challenge

Length of output: 58


🏁 Script executed:

#!/bin/bash
# Search for any MUI imports in the actual source code (not FIX_PROPOSAL)
rg -n "@material-ui|@mui" --type ts --type js -A 2

Repository: PlatformNetwork/bounty-challenge

Length of output: 224


🏁 Script executed:

#!/bin/bash
# List the repository structure
ls -la
tree -L 2 -I 'node_modules' || find . -maxdepth 2 -not -path '*/node_modules/*' -not -path '*/.git/*' | head -30

Repository: PlatformNetwork/bounty-challenge

Length of output: 1860


🏁 Script executed:

#!/bin/bash
# Find package.json without path restrictions
fd -I 'package.json' | head -10

Repository: PlatformNetwork/bounty-challenge

Length of output: 58


🏁 Script executed:

#!/bin/bash
# Search for MUI imports without type filtering
rg '@material-ui|@mui' -i | head -20

Repository: PlatformNetwork/bounty-challenge

Length of output: 302


This is a Rust backend project; the proposed code appears intended for a JavaScript/React frontend that doesn't exist in this repository.

FIX_PROPOSAL.md proposes a TypeScript React component (WelcomeRecentFiles.tsx) with Material-UI imports, but the codebase is a Rust project without any JavaScript, TypeScript, or package.json dependencies. The Material-UI import path verification is not applicable here. Before documenting this fix, clarify whether the proposed code is meant for a separate frontend project or if it's being added to an unrelated codebase.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@FIX_PROPOSAL.md` at line 7, The proposed import of Tooltip from
'@material-ui/core' in FIX_PROPOSAL.md references a TypeScript/React component
(WelcomeRecentFiles.tsx) that does not belong in this Rust backend repository;
clarify intent by confirming whether WelcomeRecentFiles.tsx and the Material-UI
dependency are meant for a separate frontend project or should be added to this
repo, and if they belong elsewhere, remove the frontend-specific proposal from
FIX_PROPOSAL.md or update it to point to the correct frontend repository; if the
frontend is intended to be added here, include a plan to add package.json, the
React/TypeScript scaffold, and the proper `@material-ui/core` dependency before
keeping the import suggestion.

Comment on lines +15 to +33
<span
style={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
maxWidth: '50%', // adjust the max width as needed
}}
title={projectName}
>
{projectName}
</span>
<span
style={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
maxWidth: '50%', // adjust the max width as needed
}}
>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Ellipsis styling is incomplete and may not truncate text as intended.

textOverflow: 'ellipsis' on default inline span elements is unreliable without layout constraints (e.g., display: inline-block/block, constrained width in a flex container, and shrink behavior). The proposed snippet can still overflow on long names/paths.

Suggested patch for the proposed snippet
-      <span
+      <span
         style={{
+          display: 'inline-block',
           overflow: 'hidden',
           textOverflow: 'ellipsis',
           whiteSpace: 'nowrap',
-          maxWidth: '50%', // adjust the max width as needed
+          maxWidth: '50%',
+          verticalAlign: 'bottom',
         }}
         title={projectName}
       >
         {projectName}
       </span>
-      <span
+      <span
         style={{
+          display: 'inline-block',
           overflow: 'hidden',
           textOverflow: 'ellipsis',
           whiteSpace: 'nowrap',
-          maxWidth: '50%', // adjust the max width as needed
+          maxWidth: '50%',
+          verticalAlign: 'bottom',
         }}
       >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<span
style={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
maxWidth: '50%', // adjust the max width as needed
}}
title={projectName}
>
{projectName}
</span>
<span
style={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
maxWidth: '50%', // adjust the max width as needed
}}
>
<span
style={{
display: 'inline-block',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
maxWidth: '50%',
verticalAlign: 'bottom',
}}
title={projectName}
>
{projectName}
</span>
<span
style={{
display: 'inline-block',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
maxWidth: '50%',
verticalAlign: 'bottom',
}}
>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@FIX_PROPOSAL.md` around lines 15 - 33, The two span elements with styles for
truncation are missing proper layout constraints: update their style to include
a layout and shrink rules (e.g., add display: 'inline-block' or display: 'block'
plus maxWidth, or if inside a flex container use flex: '1 1 0' and minWidth: 0)
so textOverflow: 'ellipsis' reliably truncates; ensure both spans (the one
rendering {projectName} and the other) include a title attribute for full text
tooltip and keep overflow: 'hidden', whiteSpace: 'nowrap', textOverflow:
'ellipsis' in the same style object to guarantee behavior.

@willkhinz willkhinz changed the title Swarm Fix: [bug][alpha] WelcomeRecentFiles: long project names can overflow the row; ellipsized path has no full-path affordance fix: implementation of path ellipsizing and overflow affordance for project names Mar 29, 2026
@willkhinz
Copy link
Copy Markdown
Author

Thanks for the review! I realized I didnt include the payout details in the original submission. For the associated bounty, please route to EVM: 0x78564c4ED88577Cc144e769F86B1a76BDB50B941

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