diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e925ed8..1288d939 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,10 @@ - can be opened via a new button "View Patch Details" on each item in the list of Patches - panel's title shows the patch description in full if it's short, otherwise truncated to the nearest full word fitting the limit - the following Patch info are shown in the new view - - status + - status (e.g. open, merged, archived, ...) - the status badge's background color is a dynamic color mix of the patch status color and the dynamic editor-foreground inherited from vscode's current theme so as to ensure text contrast reaching at least [WCAAG AA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Perceivable/Color_contrast) level of accessibility at all times while also retaining a relative consistency of the colors across all our UIs - major events like "created", "last updated", "merged" and related info with logic crafting optimal copy for each case (see similar tooltip improvements below) + - checked-out indicator, if the Git branch associated with this Radicle Patch is currently checked out - id (with on-hover button to copy Patch identifier to clipboard) - revision authors - labels @@ -24,6 +25,7 @@ - a "Check Out Default" button that checks out the Git branch marked as default for the Radicle project - shown only if the Patch is checked out - Patch check-out status remains in sync across all views and the actual underlying Git state as the latter changes + - TODO: revision description is hidden under an expandable-on-click control (to avoid showing the same content twice) if the selected revision is the first revision - **commands**: add new command to check out the current Radicle project's default Git branch - **patch-list:** show button to "Check Out Default Git Branch" for the currently checked-out Patch on the list - **patch-list:** auto-retry fetching list of Patches from httpd (with geometric backoff) if an error occured diff --git a/src/types/httpd.ts b/src/types/httpd.ts index 0662ed73..daf777c9 100644 --- a/src/types/httpd.ts +++ b/src/types/httpd.ts @@ -96,7 +96,7 @@ export interface Comment { body: string edits: Edit[] embeds: Embed[] - reactions: [string, string][] + reactions: [string, string][] // TODO: maninak verify updated types timestamp: number replyTo: string | null } diff --git a/src/utils/patch.ts b/src/utils/patch.ts index 42ff01b1..9841448b 100644 --- a/src/utils/patch.ts +++ b/src/utils/patch.ts @@ -1,5 +1,7 @@ import type { Patch, Revision } from '../types' +// TODO: maninak change logic (and rename here and everywhere) to not get the latest revision but the most important one which is `patch.status === merged ? mergedRevision(s) ? latestRevision` + export function getFirstAndLatestRevisions(patch: Patch): { firstRevision: Revision latestRevision: Revision diff --git a/src/webviews/src/assets/index.css b/src/webviews/src/assets/index.css index 0fa3f567..545f90f7 100644 --- a/src/webviews/src/assets/index.css +++ b/src/webviews/src/assets/index.css @@ -2,12 +2,22 @@ @tailwind components; @tailwind utilities; -:is(code, pre, span, b)[title]:hover { +:where(code, pre, span, b)[title]:hover { @apply underline decoration-dotted cursor-default; text-underline-position: under; } -:is(code, pre) { +:where(code, pre) { @apply m-0; display: initial; } + +:where(details) { + & summary { + @apply w-max cursor-pointer select-none; + } +} + +:where(.parsed-md) :last-child { + @apply mb-0; +} diff --git a/src/webviews/src/components/PatchDetail.vue b/src/webviews/src/components/PatchDetail.vue index f59c4110..bfb10f8c 100644 --- a/src/webviews/src/components/PatchDetail.vue +++ b/src/webviews/src/components/PatchDetail.vue @@ -1,20 +1,42 @@ + + diff --git a/src/webviews/src/components/PatchMetadata.vue b/src/webviews/src/components/PatchMetadata.vue index 06bdabac..cd104bc5 100644 --- a/src/webviews/src/components/PatchMetadata.vue +++ b/src/webviews/src/components/PatchMetadata.vue @@ -13,9 +13,15 @@ const { patch, authors } = storeToRefs(usePatchDetailStore()) diff --git a/src/webviews/src/stores/patchDetailStore.ts b/src/webviews/src/stores/patchDetailStore.ts index 5a7b3bfb..eaac4fd6 100644 --- a/src/webviews/src/stores/patchDetailStore.ts +++ b/src/webviews/src/stores/patchDetailStore.ts @@ -30,6 +30,7 @@ export const usePatchDetailStore = defineStore('patch-detail', () => { ) watchEffect(() => { + // TODO: maninak save and restore scroll position vscode.setState(state.value) }) diff --git a/src/webviews/vite.config.ts b/src/webviews/vite.config.ts index 1ab13eb4..0e513129 100644 --- a/src/webviews/vite.config.ts +++ b/src/webviews/vite.config.ts @@ -6,7 +6,9 @@ import vue from '@vitejs/plugin-vue' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ - vue(), + vue({ + template: {compilerOptions: { isCustomElement: (tag) => tag.includes("vscode-") }}, + }), ], resolve: { alias: {