Feature/#871 - Markdown Renderer#892
Conversation
| .tabs-list-scrollbar { | ||
| scrollbar-width: thin; | ||
| scrollbar-color: color-mix(in srgb, var(--disabled) 60%, transparent) transparent; | ||
| } | ||
| .tabs-list-scrollbar::-webkit-scrollbar { | ||
| height: 3px; | ||
| } | ||
| .tabs-list-scrollbar::-webkit-scrollbar-track { | ||
| background: transparent; | ||
| } | ||
| .tabs-list-scrollbar::-webkit-scrollbar-thumb { | ||
| background: color-mix(in srgb, var(--disabled) 55%, transparent); | ||
| border-radius: 999px; | ||
| } | ||
| .tabs-list-scrollbar::-webkit-scrollbar-thumb:hover { | ||
| background: color-mix(in srgb, var(--disabled) 75%, transparent); | ||
| } | ||
|
|
There was a problem hiding this comment.
we work with tailwind CSS. Is this custom CSS really needed?
| ...updates, | ||
| variables: useVariableStore.getState().variables, | ||
| environments: useEnvironmentStore.getState().environments, | ||
| } as Collection; |
There was a problem hiding this comment.
why is the cast needed? This kills type checking. A correctly assembled type should be no issue to be used directly on const collection : Collection = ...
| await eventService.saveCollection(collection); | ||
|
|
||
| set((state) => { | ||
| if (state.collection) { |
|
|
||
| updateCollection: async (updates: Partial<Pick<Collection, 'description'>>) => { | ||
| const current = get().collection; | ||
| if (!current) return; |
| const folder = selectFolder(get(), id)!; | ||
| if (folder == null) return; |
There was a problem hiding this comment.
you do a non-null assertion and check on null in next line. Choose either
| <textarea | ||
| value={description} | ||
| onChange={handleDescriptionChange} | ||
| onBlur={handleSaveDescription} | ||
| placeholder="Describe the purpose of this collection..." | ||
| rows={3} | ||
| className="w-full resize-y rounded border bg-muted/30 p-2 text-sm outline-none focus:ring-2 focus:ring-primary/30" | ||
| /> |
There was a problem hiding this comment.
do not use raw HTML elements. We use shadcn in this project: https://ui.shadcn.com/docs/components/radix/textarea
ffc9285 to
9a1cd92
Compare
|
@SoulKa have amended everything as per the suggested changes and the new changes in the main branch. |
|
@SoulKa did you have a chance to look at this? |
|
@aaryaparadkar not yet. I do this in my free time next to a job and family. This is quite a large PR, we probably should've split the implementation into backend PR and frontend PR. |
Ah yes, got it. No worries. Would appreciate feedback anytime you are free, cheers. |
Changes
For #871. Since, quite a few files have been touched, outlining all the files and what has been done in them as follows,
Backend / Core
src/main/environment/service/environment-service.ts-listCollections()now returns thedescriptionfor each collection.src/main/event/main-event-service.ts- Added IPC handlers forsaveRequestInfo()andsaveCollection().src/main/import/service/openapi-importer.ts- Imports descriptions from OpenAPI specifications.src/main/import/service/postman-importer.ts- Imports descriptions from Postman collections, including support for description objects.src/main/persistence/service/info-files/v2-4-0.ts- Added an optionaldescriptionfield to the info-file schema.src/main/persistence/service/persistence-service.ts- AddedsaveRequestInfo()for metadata-only persistence.src/shim/event-service.ts- Added typed methods for request metadata and collection saving.src/shim/objects/collection.ts,folder.ts,request.ts- Added optionaldescriptionfields.Frontend
src/renderer/components/mainWindow/bodyTabs/InputTabs/InputTabs.tsx- Added a Description tab.src/renderer/components/sidebar/CollectionDropdown.tsx- Collection descriptions are now shown as tooltips.src/renderer/components/sidebar/CollectionSettings.tsx- Added collection description editing with live Markdown preview.src/renderer/components/sidebar/SidebarRequestList/Nav/Dropdown/modals/NamingModal.tsx- Added folder description support for create and rename actions.src/renderer/components/ui/tabs.tsx- Improved tab styling and horizontal scrolling to accommodate the new tab.src/renderer/services/event/renderer-event-service.ts- Added renderer-side proxies for the new IPC methods.src/renderer/state/collectionStore.ts- Added actions for folder and collection metadata management.src/renderer/state/interface/CollectionStateActions.ts- Extended the collection state action interface.src/renderer/styles/index.css- Added subtle horizontal scrollbar styling for tabs.New Files
src/renderer/components/mainWindow/bodyTabs/InputTabs/tabs/DescriptionTab.tsx- New request description editor with live Markdown preview.src/renderer/components/shared/MarkdownPreview.tsx- Reusable Markdown preview component.src/renderer/lib/markdown/render-markdown/- In-repository Markdown rendering implementation.Testing
Have added the markdown input fields and renderer's at the following touchpoints.
Checklist