Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve code highlighting in web UI #4447

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
04b2b1c
improve code highlightings
pat-s Nov 23, 2024
3662bfc
Merge branch 'main' into fix/code-highlight-colors
pat-s Dec 1, 2024
994b797
consolidate code bg colours
pat-s Dec 1, 2024
c6d7897
Merge branch 'main' into fix/code-highlight-colors
pat-s Dec 18, 2024
a527b4d
only change code-box-inline bg
pat-s Dec 18, 2024
a19c2f1
use wp-code-300 as definition name
pat-s Dec 18, 2024
a3506d8
reset pipeline bg color
pat-s Dec 18, 2024
b9f4e9c
use wp-text instead of wp-code-text
pat-s Dec 18, 2024
f20d355
increase top margin of description text to avoid codebox overlap
pat-s Dec 18, 2024
521a56d
set dark bg color
pat-s Dec 18, 2024
a83368c
Merge branch 'main' into fix/code-highlight-colors
pat-s Dec 18, 2024
cb1d134
use existing color pallette colors for inline code bg
pat-s Dec 21, 2024
f951cf3
align dark colors with palette subcolors
pat-s Dec 21, 2024
69d244f
bump all tailwind classes by +100 to match new logic scheme
pat-s Dec 21, 2024
ed53e18
Merge branch 'main' into fix/code-highlight-colors
pat-s Dec 21, 2024
56c1ff7
downsize border-wp-background-500 to 400
pat-s Dec 21, 2024
3822800
adjust main bg color
pat-s Dec 21, 2024
3b6553f
reduce hover:bg-wp-background-400 to 300
pat-s Dec 21, 2024
d94945e
fix repo list bg color
pat-s Dec 21, 2024
cdbbb8e
add wp-background-500
pat-s Dec 21, 2024
700ba17
fix Header bg colors
pat-s Dec 21, 2024
e080d71
adjust hover bg classes
pat-s Dec 21, 2024
b8918a8
adjust code-box colors
pat-s Dec 21, 2024
9dc2d63
Merge branch 'main' into fix/code-highlight-colors
pat-s Dec 21, 2024
fddcf44
fix repo item background colors
pat-s Dec 21, 2024
a391545
use distinct classes for inline boxes
pat-s Dec 21, 2024
fa6bb0a
define code-inline in windi
pat-s Dec 21, 2024
bb118c4
adjust panel bg color
pat-s Dec 21, 2024
62a3f01
use code-inline for badges
pat-s Dec 21, 2024
6bcdef0
close brackets
pat-s Dec 21, 2024
4daa112
refine inlince code colors
pat-s Dec 21, 2024
b5870a7
use darker bg color for containers
pat-s Dec 21, 2024
81f6521
fix pipeline log upper bg
pat-s Dec 22, 2024
1f4bccf
fix inline code bg for dark
pat-s Dec 22, 2024
0ac1086
add darker bg color for hover
pat-s Dec 22, 2024
154c339
darken hover bg color
pat-s Dec 22, 2024
4576447
fix badge count bg color
pat-s Dec 22, 2024
5d697b9
darken code box bg
pat-s Dec 22, 2024
3181ddb
format
pat-s Dec 22, 2024
337f6ee
add missing windi colors
pat-s Dec 22, 2024
2e2491f
darken border color
pat-s Dec 22, 2024
b40f0c7
background
pat-s Dec 22, 2024
f65262e
bg 600 -> 400
pat-s Dec 22, 2024
252b6ae
remap wp-background to secondary
pat-s Dec 22, 2024
d23f538
.
pat-s Dec 22, 2024
220f5d7
darken hover bg
pat-s Dec 22, 2024
eb503f6
Merge branch 'main' into fix/code-highlight-colors
pat-s Dec 22, 2024
b44a7cf
darken navbar border color
pat-s Dec 22, 2024
0e4d946
adjust light bade counter bg
pat-s Dec 22, 2024
573b306
adjust hover dark
pat-s Dec 22, 2024
aa5a2a7
repolist item hover
pat-s Dec 22, 2024
0ff7abc
lighten light code bg
pat-s Dec 22, 2024
533eaa6
lighter default bg
pat-s Dec 22, 2024
ad485a5
adjust hover light
pat-s Dec 22, 2024
d8b3dda
adjust panel bg
pat-s Dec 22, 2024
1cb0068
bg 100
pat-s Dec 22, 2024
6fcfd0d
lighten forced codebox bg color
pat-s Dec 22, 2024
a95a598
darken forced dark bg color
pat-s Dec 22, 2024
a76f2da
adjust adminqueuestats
pat-s Dec 22, 2024
e7f6100
adjust all border colors
pat-s Dec 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ repos:
rev: v2.13.1-beta
hooks:
- id: hadolint
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
- repo: https://github.com//rbubley/mirrors-prettier
rev: v3.4.2
hooks:
- id: prettier
- repo: https://github.com/adrienverge/yamllint.git
Expand Down
8 changes: 4 additions & 4 deletions web/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div class="app flex flex-col m-auto w-full h-full bg-wp-background-200 dark:bg-wp-background-100">
<div class="flex flex-col bg-wp-background-200 dark:bg-wp-background-300 m-auto w-full h-full app">
<router-view v-if="blank" />
<template v-else>
<Navbar />
<main class="relative flex min-h-0 h-full">
<div id="scroll-component" class="flex flex-col overflow-y-auto flex-grow">
<main class="relative flex h-full min-h-0">
<div id="scroll-component" class="flex flex-col flex-grow overflow-y-auto">
<router-view />
</div>
<transition name="slide-right">
<PipelineFeedSidebar class="shadow-md border-l w-full absolute top-0 right-0 bottom-0 max-w-80 xl:max-w-96" />
<PipelineFeedSidebar class="top-0 right-0 bottom-0 absolute shadow-md border-l w-full max-w-80 xl:max-w-96" />
</transition>
</main>
</template>
Expand Down
18 changes: 9 additions & 9 deletions web/src/components/admin/settings/queue/AdminQueueStats.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<template>
<div v-if="stats" class="flex justify-center">
<div
class="bg-wp-background-200 border border-wp-background-300 dark:bg-wp-background-100 text-wp-text-100 rounded-md py-5 px-5 w-full"
class="border-wp-background-600 bg-wp-background-200 dark:bg-wp-background-100 px-5 py-5 border rounded-md w-full text-wp-text-100"
>
<div class="flex w-full">
<h3 class="text-lg font-semibold leading-tight uppercase flex-1">
<h3 class="flex-1 font-semibold text-lg uppercase leading-tight">
{{ $t('admin.settings.queue.stats.completed_count') }}
</h3>
</div>
<div class="relative overflow-hidden transition-all duration-500">
<div class="relative transition-all duration-500 overflow-hidden">
<div>
<div class="pb-4 lg:pb-6">
<h4 class="text-2xl lg:text-3xl font-semibold leading-tight inline-block">
<h4 class="inline-block font-semibold text-2xl lg:text-3xl leading-tight">
{{ stats.completed_count }}
</h4>
</div>
<div v-if="total > 0" class="pb-4 lg:pb-6">
<div class="overflow-hidden rounded-full h-3 flex transition-all duration-500">
<div class="flex rounded-full h-3 transition-all duration-500 overflow-hidden">
<div
v-for="item in data"
:key="item.key"
Expand All @@ -28,15 +28,15 @@
</div>
</div>
</div>
<div class="flex -mx-4 sm:flex-wrap">
<div class="flex sm:flex-wrap -mx-4">
<div
v-for="(item, index) in data"
:key="item.key"
class="px-4 md:w-1/4 sm:w-full"
class="px-4 sm:w-full md:w-1/4"
:class="{ 'md:border-l border-gray-300 dark:border-gray-600': index !== 0 }"
>
<div class="text-sm whitespace-nowrap overflow-hidden text-ellipsis">
<span class="inline-block w-2 h-2 rounded-full mr-1 align-middle" :class="`${item.color}`">&nbsp;</span>
<div class="text-ellipsis text-sm whitespace-nowrap overflow-hidden">
<span class="inline-block mr-1 rounded-full w-2 h-2 align-middle" :class="`${item.color}`">&nbsp;</span>
<span class="align-middle">{{ item.label }}</span>
</div>
<div class="font-medium text-lg">
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/agent/AgentList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<ListItem
v-for="agent in props.agents"
:key="agent.id"
class="items-center !bg-wp-background-200 !dark:bg-wp-background-100"
class="items-center !bg-wp-background-200 !dark:bg-wp-background-300"
>
<span>{{ agent.name || `Agent ${agent.id}` }}</span>
<span class="ml-auto">
<span class="hidden md:inline-block space-x-2">
<span class="md:inline-block space-x-2 hidden">
<Badge
v-if="props.isAdmin === true && agent.org_id !== -1"
:label="$t('admin.settings.agents.org.badge')"
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/atomic/CountBadge.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<span
class="text-xs font-bold inline-block min-w-5 leading-4 rounded-full bg-wp-background-300 dark:bg-wp-background-100 text-wp-text-100 text-center py-0.5 px-1.5"
class="bg-wp-code-inline-200 text-wp-text-code-inline-100 hover:bg-wp-code-inline-200 inline-block px-1.5 py-0.5 rounded-full min-w-5 font-bold text-center text-xs leading-4"
>
{{ value }}
</span>
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/atomic/ListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<component
:is="to ? 'router-link' : clickable ? 'button' : 'div'"
:to="to"
class="w-full flex border rounded-md bg-wp-background-100 overflow-hidden p-4 border-wp-background-400 dark:bg-wp-background-200"
class="flex border-wp-background-600 bg-wp-background-100 dark:bg-wp-background-400 p-4 border rounded-md w-full overflow-hidden"
:class="{
'cursor-pointer hover:shadow-md hover:bg-wp-background-300 dark:hover:bg-wp-background-300': clickable || to,
'cursor-pointer hover:shadow-md hover:bg-wp-background-300 dark:hover:bg-wp-background-500': clickable || to,
}"
>
<slot />
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/form/InputField.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<div class="flex flex-col mt-2 mb-4">
<div class="flex items-center mb-2">
<label class="text-wp-text-100 font-bold" :for="id" v-bind="$attrs">{{ label }}</label>
<label class="font-bold text-wp-text-100" :for="id" v-bind="$attrs">{{ label }}</label>
<DocsLink v-if="docsUrl" :topic="label" :url="docsUrl" class="ml-2" />
<slot v-else-if="$slots.titleActions" name="titleActions" />
</div>
<slot :id="id" />
<div v-if="$slots.description" class="ml-1 text-wp-text-alt-100">
<div v-if="$slots.description" class="mt-1 ml-1 text-wp-text-alt-100">
<slot name="description" />
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/form/TextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<input
v-if="lines === 1"
v-model="innerValue"
class="w-full border border-wp-control-neutral-200 py-1 px-2 rounded-md bg-wp-background-100 focus-visible:outline-none focus-visible:border-wp-control-neutral-300"
class="border-wp-control-neutral-200 focus-visible:border-wp-control-neutral-300 bg-wp-background-200 px-2 py-1 border rounded-md w-full focus-visible:outline-none"
:class="{ 'opacity-50': disabled }"
:disabled="disabled"
:type="type"
Expand All @@ -11,7 +11,7 @@
<textarea
v-else
v-model="innerValue"
class="w-full border border-wp-control-neutral-200 py-1 px-2 rounded-md bg-wp-background-100 focus-visible:outline-none focus-visible:border-wp-control-neutral-300"
class="border-wp-control-neutral-200 focus-visible:border-wp-control-neutral-300 bg-wp-background-200 px-2 py-1 border rounded-md w-full focus-visible:outline-none"
:class="{ 'opacity-50': disabled }"
:disabled="disabled"
:placeholder="placeholder"
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/layout/Panel.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<div
class="rounded-md w-full shadow overflow-hidden bg-wp-background-100 dark:bg-wp-background-200 border border-wp-background-400"
class="border-wp-background-600 bg-wp-background-100 dark:bg-wp-background-400 shadow border rounded-md w-full overflow-hidden"
>
<component
:is="collapsable ? 'button' : 'div'"
v-if="title"
type="button"
class="flex w-full font-bold gap-2 text-wp-text-100 px-4 py-2 bg-wp-background-300"
class="flex gap-2 bg-wp-background-400 px-4 py-2 w-full font-bold text-wp-text-100"
@click="_collapsed = !_collapsed"
>
<Icon
v-if="collapsable"
name="chevron-right"
class="transition-transform duration-150 min-w-6 h-6"
class="min-w-6 h-6 transition-transform duration-150"
:class="{ 'transform rotate-90': !collapsed }"
/>
{{ title }}
Expand All @@ -24,7 +24,7 @@
}"
class="transition-height duration-150 overflow-hidden"
>
<div class="w-full p-4 text-wp-text-100">
<div class="p-4 w-full text-wp-text-100">
<slot />
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/layout/Settings.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<Panel>
<div class="flex flex-col border-b mb-4 pb-4 justify-center dark:border-wp-background-100">
<div class="flex items-center justify-between">
<h1 class="text-xl text-wp-text-100 flex items-center gap-1">
<div class="flex flex-col justify-center dark:border-wp-background-200 mb-4 pb-4 border-b">
<div class="flex justify-between items-center">
<h1 class="flex items-center gap-1 text-wp-text-100 text-xl">
{{ title }}
<DocsLink v-if="docsUrl" :topic="title" :url="docsUrl" />
</h1>
<slot v-if="$slots.titleActions" name="titleActions" />
</div>

<div class="flex flex-wrap gap-x-4 gap-y-2 items-center justify-between">
<div class="flex flex-wrap justify-between items-center gap-x-4 gap-y-2">
<p v-if="description" class="text-sm text-wp-text-alt-100">{{ description }}</p>
<div v-if="$slots.headerActions">
<slot name="headerActions" />
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/layout/header/Navbar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<nav
class="flex border-wp-background-100 bg-wp-primary-200 dark:bg-wp-primary-300 p-4 border-b font-bold text-neutral-content text-wp-primary-text-100"
class="flex border-wp-background-300 bg-wp-primary-200 dark:bg-wp-primary-300 p-4 border-b font-bold text-neutral-content text-wp-primary-text-100"
>
<div class="flex items-center space-x-2">
<router-link :to="{ name: 'home' }" class="flex flex-col -my-2 px-2">
Expand Down
12 changes: 6 additions & 6 deletions web/src/components/layout/scaffold/Header.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<header
class="bg-wp-background-100 border-b-1 border-wp-background-400 dark:border-wp-background-100 dark:bg-wp-background-300 text-wp-text-100"
class="border-wp-background-600 dark:border-wp-background-600 bg-wp-background-100 dark:bg-wp-background-500 border-b-1 text-wp-text-100"
:class="{ 'md:px-4': fullWidth }"
>
<Container :full-width="fullWidth" class="!py-0">
<div class="flex w-full md:items-center flex-col py-3 gap-2 md:gap-10 md:flex-row md:justify-between">
<div class="flex md:flex-row flex-col md:justify-between md:items-center gap-2 md:gap-10 py-3 w-full">
<div
class="flex items-center content-start min-h-10"
:class="{
Expand All @@ -18,7 +18,7 @@
class="flex-shrink-0 mr-2 <md:hidden md:justify-between w-8 h-8"
@click="goBack"
/>
<h1 class="flex text-xl min-w-0 text-wp-text-100 items-center gap-x-2">
<h1 class="flex items-center gap-x-2 min-w-0 text-wp-text-100 text-xl">
<slot name="title" />
</h1>
</div>
Expand All @@ -32,7 +32,7 @@
/>
<div
v-if="$slots.headerActions"
class="flex items-center md:justify-end gap-x-2 min-w-0"
class="flex md:justify-end items-center gap-x-2 min-w-0"
:class="{
'md:flex-1': searchBoxPresent,
}"
Expand All @@ -41,9 +41,9 @@
</div>
</div>

<div v-if="enableTabs" class="flex md:items-center flex-col py-2 md:flex-row md:justify-between md:py-0">
<div v-if="enableTabs" class="flex md:flex-row flex-col md:justify-between md:items-center py-2 md:py-0">
<Tabs class="<md:order-2" />
<div v-if="$slots.headerActions" class="flex content-start md:justify-end">
<div v-if="$slots.headerActions" class="flex md:justify-end content-start">
<slot name="tabActions" />
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/layout/scaffold/Tabs.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<template>
<div class="flex flex-wrap mt-2 md:gap-4">
<div class="flex flex-wrap md:gap-4 mt-2">
<router-link
v-for="tab in tabs"
:key="tab.title"
v-slot="{ isActive, isExactActive }"
:to="tab.to"
class="border-transparent w-full py-1 md:w-auto flex cursor-pointer md:border-b-2 text-wp-text-100 items-center"
class="flex items-center py-1 border-transparent md:border-b-2 w-full md:w-auto text-wp-text-100 cursor-pointer"
:active-class="tab.matchChildren ? '!border-wp-text-100' : ''"
:exact-active-class="tab.matchChildren ? '' : '!border-wp-text-100'"
>
<Icon
v-if="isExactActive || (isActive && tab.matchChildren)"
name="chevron-right"
class="md:hidden flex-shrink-0"
class="flex-shrink-0 md:hidden"
/>
<Icon v-else name="blank" class="md:hidden" />
<span
class="flex gap-2 items-center md:justify-center flex-row py-1 px-2 w-full min-w-20 dark:hover:bg-wp-background-100 hover:bg-wp-background-200 rounded-md"
class="flex flex-row md:justify-center items-center gap-2 dark:hover:bg-wp-background-300 hover:bg-wp-background-200 px-2 py-1 rounded-md w-full min-w-20"
>
<Icon v-if="tab.icon" :name="tab.icon" :class="tab.iconClass" class="flex-shrink-0" />
<span>{{ tab.title }}</span>
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/pipeline-feed/PipelineFeedSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<aside
v-if="isOpen"
ref="target"
class="flex flex-col z-50 overflow-y-auto items-center bg-wp-background-100 dark:bg-wp-background-200 border-wp-background-400"
class="z-50 flex flex-col items-center border-wp-background-600 bg-wp-background-200 dark:bg-wp-background-400 overflow-y-auto"
:aria-label="$t('pipeline_feed')"
>
<router-link
Expand All @@ -12,12 +12,12 @@
name: 'repo-pipeline',
params: { repoId: pipeline.repo_id, pipelineId: pipeline.number },
}"
class="flex border-b border-wp-background-400 py-4 px-2 w-full hover:bg-wp-background-300 dark:hover:bg-wp-background-400 hover:shadow-sm"
class="flex border-wp-background-600 hover:bg-wp-background-300 dark:hover:bg-wp-background-600 hover:shadow-sm px-2 py-4 border-b w-full"
>
<PipelineFeedItem :pipeline="pipeline" />
</router-link>

<span v-if="sortedPipelines.length === 0" class="text-wp-text-100 m-4">{{ $t('repo.pipeline.no_pipelines') }}</span>
<span v-if="sortedPipelines.length === 0" class="m-4 text-wp-text-100">{{ $t('repo.pipeline.no_pipelines') }}</span>
</aside>
</template>

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/registry/RegistryList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ListItem
v-for="registry in registries"
:key="registry.id"
class="items-center !bg-wp-background-200 !dark:bg-wp-background-100"
class="items-center !bg-wp-background-200 !dark:bg-wp-background-300"
>
<span>{{ registry.address }}</span>
<IconButton
Expand Down
14 changes: 7 additions & 7 deletions web/src/components/repo/RepoItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<router-link
v-if="repo"
:to="{ name: 'repo', params: { repoId: repo.id } }"
class="flex flex-col border rounded-md bg-wp-background-100 overflow-hidden p-4 border-wp-background-400 dark:bg-wp-background-200 cursor-pointer hover:shadow-md hover:bg-wp-background-300 dark:hover:bg-wp-background-300"
class="flex flex-col border-wp-background-600 bg-wp-background-200 hover:bg-wp-background-300 dark:hover:bg-wp-background-600 dark:bg-wp-background-400 hover:shadow-md p-4 border rounded-md cursor-pointer overflow-hidden"
>
<div class="grid grid-cols-[auto,1fr] gap-y-4 items-center">
<div class="text-wp-text-100 text-lg">{{ `${repo.owner} / ${repo.name}` }}</div>
<div class="items-center gap-y-4 grid grid-cols-[auto,1fr]">
<div class="text-lg text-wp-text-100">{{ `${repo.owner} / ${repo.name}` }}</div>
<div class="ml-auto text-wp-text-100">
<div
v-if="repo.visibility === RepoVisibility.Private"
Expand All @@ -21,14 +21,14 @@
</div>
</div>

<div class="col-span-2 text-wp-text-100 flex w-full gap-x-4">
<div class="flex gap-x-4 col-span-2 w-full text-wp-text-100">
<template v-if="lastPipeline">
<div class="flex flex-1 min-w-0 gap-x-1 items-center">
<div class="flex flex-1 items-center gap-x-1 min-w-0">
<PipelineStatusIcon v-if="lastPipeline" :status="lastPipeline.status" />
<span class="whitespace-nowrap overflow-hidden overflow-ellipsis">{{ shortMessage }}</span>
<span class="whitespace-nowrap overflow-ellipsis overflow-hidden">{{ shortMessage }}</span>
</div>

<div class="flex flex-shrink-0 gap-x-1 items-center ml-auto">
<div class="flex flex-shrink-0 items-center gap-x-1 ml-auto">
<Icon name="since" />
<span>{{ since }}</span>
</div>
Expand Down
Loading