Skip to content

Display file max size errors on selection in UploadAssetModal#1774

Merged
KCarretto merged 1 commit intofeat/assets-pagefrom
jules-assets-file-size-check-14592160947290800029
Feb 8, 2026
Merged

Display file max size errors on selection in UploadAssetModal#1774
KCarretto merged 1 commit intofeat/assets-pagefrom
jules-assets-file-size-check-14592160947290800029

Conversation

@KCarretto
Copy link
Collaborator

Updated UploadAssetModal to validate file size immediately upon selection. Files exceeding 100MB are now marked with an error status and display "File size exceeds 100MB limit" before the user attempts to upload. Added a unit test to verify this behavior.


PR created automatically by Jules for task 14592160947290800029 started by @KCarretto

- Export MAX_FILE_SIZE constant from upload.ts
- Import MAX_FILE_SIZE in UploadAssetModal.tsx
- Add file size check in handleFileChange
- Set file status to 'error' and display error message immediately if file exceeds limit
- Add unit test for file size validation
- Add data-testid to file input for testing

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@KCarretto KCarretto marked this pull request as ready for review February 8, 2026 17:23
@KCarretto KCarretto merged commit b509203 into feat/assets-page Feb 8, 2026
@KCarretto KCarretto deleted the jules-assets-file-size-check-14592160947290800029 branch February 8, 2026 17:23
github-merge-queue bot pushed a commit that referenced this pull request Feb 9, 2026
* Assets page 3148273193234440162 (#1761)

* feat(www): add assets page and backend download endpoint

- Add `cdn.NewDownloadHandler` to `tavern/app.go` at `/assets/download/`.
- Create `tavern/internal/www/src/pages/assets` with `Assets.tsx` and components.
- Implement `AssetsTable`, `CreateLinkModal`, `UploadAssetModal`.
- Add `useAssets` hook with GraphQL queries.
- Register `/assets` route in `App.tsx` and navigation.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* feat(www): enhance assets page with new sorting, styling, and details view

- Refactor `AssetsTable` to use `lucide-react` icons.
- Disable client-side header sorting in favor of backend sorting.
- Implement row expansion (`AssetAccordion`) to show links and tomes.
- Update `CreateLinkModal` styling to match other modals.
- Update `SortContext` and `SortingControls` to support Assets sorting.
- Add `Breadcrumbs` to Assets page.
- Update `useAssets` query to fetch nested link and tome details.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* fix(www): resolve typescript errors in assets page

- Fix `AssetNode` interface definition in `interfacesQuery.ts` to include `edges` for `links` and `tomes`.
- Fix duplicate import in `SortContext.tsx`.
- Resolve `TS2339` error in `AssetAccordion.tsx` by ensuring correct types.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* feat(www): enhance assets page with new styling and functionality

- Refactor `AssetsTable` to use `lucide-react` icons.
- Disable client-side header sorting in favor of backend sorting.
- Implement row expansion (`AssetAccordion`) to show links.
- Update `CreateLinkModal` styling to match other modals.
- Update `SortContext` and `SortingControls` to support Assets sorting.
- Add `Breadcrumbs` to Assets page.
- Update `useAssets` query to fetch nested link and tome details.
- Add random string generation for new links.
- Add "Copy to Clipboard" for hashes and links.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* fix(www): resolve typescript interface and build errors

- Overwrite `tavern/internal/www/src/utils/interfacesQuery.ts` to ensure `AssetNode` interface correctly includes `edges` for `links` and `tomes`.
- Fix duplicate import in `SortContext.tsx`.
- Verify build passes locally.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* some updates

* Enhance Assets page with creator info and improved link controls (#1742)

* feat: update Assets page with creator info, responsive table, and link controls

- Add `creator` field to `AssetNode` interface and GraphQL query.
- Add "Creator" column to Assets table using `UserImageAndName`.
- Implement responsive column hiding for Assets table (hide Size, Hash, Links, Created on mobile).
- Fix "Tome" icon display and conditional row expansion.
- Add "Limit Downloads" checkbox to Create Link modal.
- Sort asset links by Unexpired > Unlimited > Most Remaining Downloads.
- Update link expiration text to show "Expired" when appropriate.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* feat: update Assets page with creator info, responsive table, and link controls

- Add `creator` field to `AssetNode` interface and GraphQL query.
- Add "Creator" column to Assets table using `UserImageAndName`.
- Implement responsive column hiding for Assets table (hide Size, Hash, Links, Created on mobile).
- Fix "Tome" icon display and conditional row expansion.
- Add "Limit Downloads" checkbox to Create Link modal.
- Sort asset links by Unexpired > Unlimited > Most Remaining Downloads.
- Update link expiration text to show "Expired" when appropriate.
- Increase spacing for Tome icon and Creator column to prevent overlap.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* feat: update Assets page with creator info, responsive table, and link controls

- Add `creator` field to `AssetNode` interface and GraphQL query.
- Add "Creator" column to Assets table using `UserImageAndName`.
- Implement responsive column hiding for Assets table (hide Size, Hash, Links, Created on mobile).
- Fix "Tome" icon display and conditional row expansion.
- Add "Limit Downloads" checkbox to Create Link modal.
- Sort asset links by Unexpired > Unlimited > Most Remaining Downloads.
- Update link expiration text to show "Expired" when appropriate.
- Increase spacing for Tome icon and Creator column to prevent overlap.
- Set minimum width for Name and Creator columns.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* feat: update Assets page with creator info, responsive table, and link controls

- Add `creator` field to `AssetNode` interface and GraphQL query.
- Add "Creator" column to Assets table using `UserImageAndName`.
- Implement responsive column hiding for Assets table with progressive breakpoints to avoid horizontal scroll.
- Fix "Tome" icon display and conditional row expansion.
- Add "Limit Downloads" checkbox to Create Link modal.
- Sort asset links by Unexpired > Unlimited > Most Remaining Downloads.
- Update link expiration text to show "Expired" when appropriate.
- Increase spacing for Tome icon and Creator column to prevent overlap.
- Set minimum width for Name and Creator columns.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* feat: update Assets page with creator info, responsive table, link controls, and name truncation

- Add `creator` field to `AssetNode` interface and GraphQL query.
- Add "Creator" column to Assets table using `UserImageAndName`.
- Implement responsive column hiding for Assets table with progressive breakpoints.
- Fix "Tome" icon display and conditional row expansion.
- Add "Limit Downloads" checkbox to Create Link modal.
- Sort asset links by Unexpired > Unlimited > Most Remaining Downloads.
- Update link expiration text to show "Expired" when appropriate.
- Increase spacing for Tome icon and Creator column to prevent overlap.
- Set minimum width for Name and Creator columns.
- Implement intelligent asset name truncation (handling paths) and click-to-copy functionality.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* feat: update Assets page with creator info, responsive table, link controls, name truncation, and refresh logic

- Add `creator` field to `AssetNode` interface and GraphQL query.
- Add "Creator" column to Assets table using `UserImageAndName`.
- Implement responsive column hiding for Assets table with progressive breakpoints.
- Fix "Tome" icon display and conditional row expansion.
- Add "Limit Downloads" checkbox to Create Link modal.
- Sort asset links by Unexpired > Unlimited > Most Remaining Downloads.
- Update link expiration text to show "Expired" when appropriate.
- Increase spacing for Tome icon and Creator column to prevent overlap.
- Set minimum width for Name and Creator columns.
- Implement intelligent asset name truncation (handling paths) and click-to-copy functionality.
- Add "File Plus" icon for assets not referenced by any tomes with tooltip.
- Wire up automatic table refresh after creating a link or uploading an asset.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Assets page updates: Link creator, disable button, filters, responsive columns (#1744)

* Update Assets page with Link creator, disable link button, filters, and responsive columns

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Update Assets page with Link creator, disable link button, filters, and responsive columns

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Assets Page Enhancements: Bulk Upload, Link Shortcuts, Last Modified Column (#1745)

* Enhance Assets page with bulk upload, link duration shortcuts, and last modified column

- Add `formatRelativeTime` helper for succinct relative timestamps (e.g., "5s ago", "1h 15m ago").
- Update `CreateLinkModal` to use `Tabs` (simulating segmented control) for selecting link duration: "10min", "1hr", or "Custom".
- Add "Last Modified" column to `AssetsTable`, visible on large screens, using `formatRelativeTime`.
- Add info tooltip to "Hash" column header in `AssetsTable`.
- Update `AssetAccordion` to hide the copy-link button for expired or exhausted links.
- Refactor `UploadAssetModal` to support bulk file uploads and recursive folder uploads using `webkitdirectory`.
- Add progress tracking and error reporting to the upload process.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Enhance Assets page with bulk upload, link duration shortcuts, and last modified column

- Add `formatRelativeTime` helper for succinct relative timestamps (e.g., "5s ago", "1h 15m ago").
- Update `CreateLinkModal` to use `Tabs` (simulating segmented control) for selecting link duration: "10min", "1hr", or "Custom".
- Add "Last Modified" column to `AssetsTable`, visible on large screens, using `formatRelativeTime`.
- Add info tooltip to "Hash" column header in `AssetsTable`.
- Update `AssetAccordion` to hide the copy-link button for expired or exhausted links.
- Refactor `UploadAssetModal` to support bulk file uploads and recursive folder uploads using `webkitdirectory`.
- Add progress tracking and error reporting to the upload process.
- Update `AlertError` component to support `ReactNode` details and `whitespace-pre-wrap`.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Enhance Assets page with bulk upload, link duration shortcuts, and last modified column

- Add `formatRelativeTime` helper for succinct relative timestamps (e.g., "5s ago", "1h 15m ago").
- Update `CreateLinkModal` to use `Tabs` (simulating segmented control) for selecting link duration: "10min", "1hr", or "Custom".
- Add "Last Modified" column to `AssetsTable`, visible on large screens, using `formatRelativeTime`.
- Add info tooltip to "Hash" column header in `AssetsTable`.
- Update `AssetAccordion` to hide the copy-link button for expired or exhausted links.
- Refactor `UploadAssetModal` to support bulk file uploads and recursive folder uploads using `webkitdirectory`.
- Add progress tracking and error reporting to the upload process.
- Update `AlertError` component to support `ReactNode` details and `whitespace-pre-wrap`.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Enhance Assets page with bulk upload, link duration shortcuts, and last modified column

- Add `formatRelativeTime` helper for succinct relative timestamps (e.g., "5s ago", "1h 15m ago").
- Update `CreateLinkModal` to use `Tabs` (simulating segmented control) for selecting link duration: "10min", "1hr", or "Custom".
- Add "Last Modified" column to `AssetsTable`, visible on large screens, using `formatRelativeTime`.
- Add info tooltip to "Hash" column header in `AssetsTable`.
- Update `AssetAccordion` to hide the copy-link button for expired or exhausted links.
- Refactor `UploadAssetModal` to support bulk file uploads and recursive folder uploads using `webkitdirectory`.
- Add progress tracking and error reporting to the upload process.
- Update `AlertError` component to support `ReactNode` details and `whitespace-pre-wrap`.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Enhance Assets page with bulk upload, link duration shortcuts, and last modified column

- Add `formatRelativeTime` helper for succinct relative timestamps (e.g., "5s ago", "1h 15m ago").
- Update `CreateLinkModal` to use `Tabs` (simulating segmented control) for selecting link duration: "10min", "1hr", or "Custom".
- Add "Last Modified" column to `AssetsTable`, visible on large screens, using `formatRelativeTime`.
- Add info tooltip to "Hash" column header in `AssetsTable`.
- Update `AssetAccordion` to hide the copy-link button for expired or exhausted links.
- Refactor `UploadAssetModal` to support bulk file uploads and recursive folder uploads using `webkitdirectory`.
- Add progress tracking and error reporting to the upload process.
- Allow renaming of assets when uploading a single file.
- Update `AlertError` component to support `ReactNode` details and `whitespace-pre-wrap`.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Enhance Assets page with bulk upload, link duration shortcuts, and last modified column

- Add `formatRelativeTime` helper for succinct relative timestamps (e.g., "5s ago", "1h 15m ago").
- Update `CreateLinkModal` to use `Tabs` (simulating segmented control) for selecting link duration: "10min", "1hr", or "Custom".
- Add "Last Modified" column to `AssetsTable`, visible on large screens, using `formatRelativeTime`.
- Add info tooltip to "Hash" column header in `AssetsTable`.
- Update `AssetAccordion` to hide the copy-link button for expired or exhausted links.
- Refactor `UploadAssetModal` to support bulk file uploads and recursive folder uploads using `webkitdirectory`.
- Add progress tracking and error reporting to the upload process.
- Allow renaming of assets when uploading a single file.
- Fix `Button` component to correctly respect the `type` prop (preventing accidental form submissions).
- Update `AlertError` component to support `ReactNode` details and `whitespace-pre-wrap`.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* npm build

* minor tweaks and build

* Fix pagination bug in Assets page (#1748)

When navigating backwards in the Assets page, the previous query variables (first/after) were being merged with the new variables (last/before), causing a GraphQL error or invalid query state. This change explicitly clears the unused pagination variables in `useAssets` hook.

Verified with a reproduction unit test that simulated the issue and confirmed the fix.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* npm run build

* npm run build

* fix(ci): resolve rust compilation error in imix agent

- Ensure `implants/imix/src/agent.rs` uses `tokio::runtime::Handle` instead of `std::runtime::Handle`, fixing `error[E0433]: failed to resolve: could not find runtime in std`.
- Re-apply frontend fixes for `AssetNode` interface and `SortContext`.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* some local fixes

* Revert "some local fixes"

This reverts commit b756a42.

* Revert "fix(ci): resolve rust compilation error in imix agent"

This reverts commit b075c0a.

* git is stupid

* Assets Page Improvements (#1760)

* Assets page improvements: styling, validation, filtering, and upload flow.

- Standardized font size in AssetsTable.
- Moved "Expire link" button to link header, updated icon and tooltip.
- Enhanced UploadAssetModal with file size limit (100MB), status indicators, and disabled actions during upload.
- Added client-side validation for CreateLinkModal expiry date using Yup.
- Added filtering by Creator in Assets page.
- Replaced formatRelativeTime with moment.js.
- Added moment dependency.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Assets page improvements: styling, validation, filtering, and upload flow.

- Standardized font size in AssetsTable.
- Moved "Expire link" button to link header, updated icon and tooltip.
- Enhanced UploadAssetModal with file size limit (100MB), status indicators, and disabled actions during upload.
- Added client-side validation for CreateLinkModal expiry date using Yup.
- Added filtering by Creator in Assets page.
- Replaced formatRelativeTime with moment.js.
- Added moment dependency.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* few local changes

* Refactor Assets Modals to use Formik and Update Upload UI (#1762)

* Refactor CreateLinkModal and UploadAssetsModal to use Formik for state management. Update UploadAssetsModal UI to display file cards with status, progress, and renaming capabilities.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Refactor Assets Modals to use Formik and Update Upload UI

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* stuff

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Update CreateLinkModal success view (#1763)

- Replaced input field with text display for the created link.
- Added "Close" and "Copy & Close" buttons.
- "Copy & Close" is the primary action and copies the link to clipboard.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* some cleanup

* fix go tests

* fix tests

* Remove unnecessary useEffect in Assets modals by conditional rendering (#1767)

Refactored Assets.tsx to conditionally render CreateLinkModal and UploadAssetModal, ensuring they unmount when closed. This allowed removing unnecessary useEffect hooks that were resetting state in those components. Added unit tests for CreateLinkModal.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* address feedback

* npm run build

* run build

* Refactor Assets page to use userId instead of creatorId for filtering (#1770)

This change renames `creatorId` to `userId` in the `FilterContext` and related components to allow for more generic user filtering, as requested.
It also updates the `FilterFieldType.CREATOR` to `FilterFieldType.USER`.
Existing tests have been updated and pass.

Changes:
- `tavern/internal/www/src/context/FilterContext/FilterContext.tsx`: Renamed `creatorId` to `userId` and `CREATOR` to `USER`. Updated `STORAGE_KEY`.
- `tavern/internal/www/src/context/FilterContext/FilterControls.tsx`: Updated to use `FilterFieldType.USER`.
- `tavern/internal/www/src/components/UserFilterBar.tsx`: Updated to use `filters.userId`.
- `tavern/internal/www/src/pages/assets/Assets.tsx`: Updated to use `filters.userId`.
- `tavern/internal/www/src/context/FilterContext/__tests__/FilterContext.test.tsx`: Updated tests.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* update AGENTS.md and npm run build

* feat(assets): validate file size on selection in UploadAssetModal (#1774)

- Export MAX_FILE_SIZE constant from upload.ts
- Import MAX_FILE_SIZE in UploadAssetModal.tsx
- Add file size check in handleFileChange
- Set file status to 'error' and display error message immediately if file exceeds limit
- Add unit test for file size validation
- Add data-testid to file input for testing

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* stuff

* remove createLink wrapper

* addressed feedback

* fix test

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
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