Skip to content

Conversation

ArslanSaleem
Copy link
Contributor

@ArslanSaleem ArslanSaleem commented Aug 5, 2025

Important

This PR adds functionality to save markdown files from the UI to the backend, including new backend routes, services, and frontend components for artifact management.

  • Backend:
    • Adds artifacts.py route to handle artifact saving in routes.
    • Implements ArtifactsService in services/artifacts.py to process markdown files and extract linked files.
    • Introduces FilesService in services/files.py for file path validation and retrieval.
    • Updates main.py to include artifacts router.
  • Frontend:
    • Adds SaveArtifactButton component in save-artifact-button.tsx for saving artifacts from the UI.
    • Integrates @radix-ui/react-dialog for dialog management in dialog.tsx.
    • Updates content-sidebar.tsx to include save button for markdown files.
    • Adds saveArtifact function in api/artifacts.ts to handle API requests for saving artifacts.
    • Updates package.json to include @radix-ui/react-dialog dependency.

This description was created by Ellipsis for fd240e8. You can customize this summary. It will automatically update as commits are pushed.

@ArslanSaleem ArslanSaleem requested a review from maidacundo August 5, 2025 16:18
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to fd240e8 in 2 minutes and 14 seconds. Click for details.
  • Reviewed 753 lines of code in 11 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. examples/ui/frontend/src/components/content-sidebar.tsx:775
  • Draft comment:
    The string manipulation for determining the download file extension (replacing 'md' with 'pdf') is brittle; consider refactoring for clarity and robustness.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_npzhKHSJGLggqlc7

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.


import aiohttp
from fastapi import APIRouter, HTTPException, Request
from fastapi.security import HTTPBearer
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused import: HTTPBearer is imported but never used; consider removing it.

Suggested change
from fastapi.security import HTTPBearer

class ArtifactsService:

@staticmethod
async def get_files_for_artifact(type: str, filepath: str, conversation_id: str):
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using 'type' as a parameter name to prevent shadowing the built-in; consider renaming it (e.g. artifactType).

This comment was generated because it violated a code review rule: mrule_jwFVvydpsvYdje26.

return None

@staticmethod
async def get_file_from_env(file_path: str, env: BaseEnv) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

The return type of get_file_from_env is declared as 'str' but it returns a tuple (content_bytes, mime_type); update the type annotation accordingly.

Suggested change
async def get_file_from_env(file_path: str, env: BaseEnv) -> str:
async def get_file_from_env(file_path: str, env: BaseEnv) -> tuple[bytes, str]:

@@ -0,0 +1,6 @@
class FileNotFoundError(Exception):
Copy link
Contributor

Choose a reason for hiding this comment

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

Custom exception 'FileNotFoundError' conflicts with the built-in exception; consider renaming it (e.g. CustomFileNotFoundError) to avoid confusion.

This comment was generated because it violated a code review rule: mrule_jwFVvydpsvYdje26.

)

# Create router
router = APIRouter(prefix="/artifacts", tags=["artifacts"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure new API routes and service functions (e.g. artifacts endpoints) are accompanied by proper unit tests.

This comment was generated because it violated a code review rule: mrule_q7uemN6whkfXoUH0.

</DialogTrigger>
<DialogContent className="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Save Completion</DialogTitle>
Copy link
Contributor

Choose a reason for hiding this comment

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

The dialog title 'Save Completion' may be misleading; consider renaming it to 'Save Artifact' to match the feature purpose.

This comment was generated because it violated a code review rule: mrule_kO2c9rTcwkbqZtg4.

@ArslanSaleem ArslanSaleem marked this pull request as draft August 5, 2025 16:22
@ArslanSaleem ArslanSaleem changed the title feat(markdown): save markdown files from UI feat(save): save markdown and websites from UI for chat completions Aug 5, 2025
@ArslanSaleem ArslanSaleem changed the title feat(save): save markdown and websites from UI for chat completions feat(save): save markdown and websites from UI for chat creations Aug 6, 2025
ArslanSaleem and others added 25 commits August 19, 2025 23:27
* refactor chatbox

* refactor chatbox to separate component

* improve UI to show menu and same layout for creations page

* fix: show loader on the table

* fix: new chat button not working

* feat improve ui and view invoices and billings

* move static links to config

* fix: build errors
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
feat(release): add pipeline to auto deploy on release
* fix: creation fallback web page

* feat(fallback): don't show error of creations on the complete ui instead show on table area

* fix: remove duplicate to separate component
s size of generated pdf text
* fix: excel file viewer

* fix: requested improvements in code

* refactor and move to utils
gventuri and others added 30 commits September 23, 2025 13:29
…ling

- Added a new method `_is_breaking_tool` to check if a tool name or its alias corresponds to a breaking tool.
- Updated the logic in the agent to utilize the new method for better clarity and maintainability.
- Modified the `set_idle` tool registration to include additional aliases for improved handling of tool calls.
- Temporarily disabled handling of unknown tools in the frontend component.
…hart components

- Updated ChartRenderer to allow switching between bar, horizontal bar, and line chart types.
- Enhanced BarChart to handle horizontal bar configurations, including custom scale settings for horizontal orientation.
- Adjusted dependencies in useEffect for better performance and clarity.
* fix(csv): handle large csv files

* fix: user worker to parse csv file
* add limit of 10 MB size to csv file

* update error message

* Update examples/ui/frontend/src/components/chatbox.tsx

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* Update examples/ui/frontend/src/components/chatbox.tsx

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* fix: abort upload on new chat

* remove extra
* feat(pro_user): remove branding for pro user

* Update examples/ui/backend/pxml/dashboard_compiler.py

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: Gabriele Venturi <[email protected]>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* fix: get creation user plan

* Update examples/ui/backend/routes/artifacts.py

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* fix: csv scrolling issue

* fix: make requested changes
* fix: csv scrolling issue

* fix: make requested changes

* sync table view to be same as of in dashboard

* fix: maxheight prop
- Updated dashboard-core.js to extract column names from unique, min, and max formulas, allowing for both range and direct column name formats.
- Added functionality in dynamic-filters.js to handle direct column name references in function calls, improving formula evaluation capabilities.
- Introduced `cleanNumericValue` function in both `charts.js` and `base-chart.tsx` to standardize the cleaning of numeric inputs by removing non-numeric characters and handling edge cases.
- Updated data processing logic in `processChartData` and `processCSVData` to utilize the new cleaning function, ensuring more robust data handling for various chart types.
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