Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions apps/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,37 @@
<link rel="canonical" href="https://kaneo.app">

<script>
// Set the initial direction from the persisted locale (preferred) or
// browser language before the app mounts, so right-to-left locales don't
// flash left-to-right.
(function () {
var dir = "ltr";
try {
var persistedLocale = localStorage.getItem("kaneo:locale");
if (persistedLocale) {
// Common RTL language prefixes: Persian, Arabic, Hebrew, Urdu
dir = ["fa", "ar", "he", "ur"].some(function (prefix) {
return persistedLocale.startsWith(prefix);
}) ? "rtl" : "ltr";
} else {
var lang = (navigator.language || "en").toLowerCase();
// Common RTL language prefixes: Persian, Arabic, Hebrew, Urdu
dir = ["fa", "ar", "he", "ur"].some(function (prefix) {
return lang.startsWith(prefix);
}) ? "rtl" : "ltr";
}
} catch (e) {
// Private browsing; fall back to navigator.language.
var lang = (navigator.language || "en").toLowerCase();
dir = ["fa", "ar", "he", "ur"].some(function (prefix) {
return lang.startsWith(prefix);
}) ? "rtl" : "ltr";
}
if (dir === "rtl") {
document.documentElement.setAttribute("dir", "rtl");
}
})();

if (window.location.hostname === 'demo.kaneo.app') {
const script = document.createElement('script');
script.defer = true;
Expand Down
12 changes: 11 additions & 1 deletion apps/web/src/components/app-sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type * as React from "react";
import { useTranslation } from "react-i18next";

import { NavMain } from "@/components/nav-main";
import { NavProjects } from "@/components/nav-projects";
Expand All @@ -15,10 +16,18 @@ import { VersionDisplay } from "@/components/version-display";
import { WorkspaceSwitcher } from "@/components/workspace-switcher";
import { shortcuts } from "@/constants/shortcuts";
import { useRegisterShortcuts } from "@/hooks/use-keyboard-shortcuts";
import { getLocaleDirection, resolveLocale } from "@/lib/i18n";
import Search from "./search";

export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
const { toggleSidebar } = useSidebar();
const { i18n } = useTranslation();

const side: "left" | "right" =
getLocaleDirection(resolveLocale(i18n.resolvedLanguage ?? null, null)) ===
"rtl"
? "right"
: "left";

useRegisterShortcuts({
modifierShortcuts: {
Expand All @@ -32,8 +41,9 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
<Sidebar
collapsible="offcanvas"
variant="inset"
className="border-none pt-1.5"
{...props}
side={side}
className="border-none pt-1.5"
>
<SidebarHeader className="pt-1 pb-1.5">
<WorkspaceSwitcher />
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/components/common/header/mobile-project-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function MobileProjectNav({
<div className="space-y-3">
<div className="space-y-1">
<p className="px-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase">
View
{t("tasks:view.section")}
</p>
<div className="grid grid-cols-4 gap-1">
<button
Expand All @@ -73,7 +73,7 @@ export default function MobileProjectNav({
: "border-transparent text-muted-foreground hover:bg-accent",
)}
>
Backlog
{t("tasks:view.backlog")}
</button>
<button
type="button"
Expand All @@ -86,7 +86,7 @@ export default function MobileProjectNav({
)}
>
<SquareKanban className="size-3.5" />
Board
{t("tasks:view.board")}
</button>
<button
type="button"
Expand All @@ -112,14 +112,14 @@ export default function MobileProjectNav({
)}
>
<CalendarDays className="size-3.5" />
Gantt
{t("tasks:view.gantt")}
</button>
</div>
</div>

<div className="space-y-1">
<p className="px-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase">
Projects
{t("navigation:sidebar.projects")}
</p>
<div className="max-h-56 space-y-0.5 overflow-y-auto">
{(projects ?? []).map((project) => {
Expand Down Expand Up @@ -154,7 +154,7 @@ export default function MobileProjectNav({
className="flex w-full items-center gap-2 rounded-md border border-border px-2 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent"
>
<Plus className="size-3.5" />
Add project
{t("navigation:projectList.addProject")}
</button>
</div>
</PopoverContent>
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/common/project-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default function ProjectLayout({
)}
>
<SquircleDashed className="size-3.5" />
Backlog
{t("tasks:view.backlog")}
</Button>
<Button
variant={resolvedView === "board" ? "secondary" : "ghost"}
Expand All @@ -183,7 +183,7 @@ export default function ProjectLayout({
)}
>
<SquareKanban className="size-3.5" />
Tasks
{t("tasks:view.tasks")}
</Button>
<Button
variant={resolvedView === "calendar" ? "secondary" : "ghost"}
Expand All @@ -207,7 +207,7 @@ export default function ProjectLayout({
)}
>
<CalendarDays className="size-3.5" />
Gantt
{t("tasks:view.gantt")}
</Button>
</div>
)}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/kanban-board/task-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function TaskCard({ task, disableDragDrop = false }: TaskCardProps) {
)}

{showAssignees && (
<div className="absolute top-3 right-3">
<div className="absolute top-3 end-3">
Comment thread
coderabbitai[bot] marked this conversation as resolved.
{task.userId ? (
<Avatar className="h-5 w-5">
<AvatarImage
Expand All @@ -235,7 +235,7 @@ function TaskCard({ task, disableDragDrop = false }: TaskCardProps) {
</div>
)}

<div className="mb-2.5 pr-6">
<div className="mb-2.5 pe-6">
<div
className="overflow-hidden break-words leading-5 font-medium text-foreground/95 text-[15px]"
style={{
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/nav-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function NavMain() {
>
<span>{item.title}</span>
{item.badge !== null && (
<span className="ml-auto flex h-5 min-w-5 items-center justify-center rounded-sm border border-sidebar-border/60 px-1 text-[11px] font-medium text-sidebar-foreground/80">
<span className="ms-auto flex h-5 min-w-5 items-center justify-center rounded-sm border border-sidebar-border/60 px-1 text-[11px] font-medium text-sidebar-foreground/80">
{item.badge}
</span>
)}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/nav-projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export function NavProjects() {
onPointerDown={(event) =>
event.stopPropagation()
}
className="absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-lg p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground after:-inset-2 after:absolute md:after:hidden peer-data-[size=sm]/menu-button:top-1 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 group-data-[collapsible=icon]:hidden group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0"
className="absolute top-1.5 end-1 flex aspect-square w-5 items-center justify-center rounded-lg p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground after:-inset-2 after:absolute md:after:hidden peer-data-[size=sm]/menu-button:top-1 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 group-data-[collapsible=icon]:hidden group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0"
/>
}
>
Expand Down
24 changes: 12 additions & 12 deletions apps/web/src/components/task/task-properties-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default function TaskPropertiesSidebar({
<TaskMovePopover
task={task}
workspaceId={workspaceId}
triggerClassName="rounded-l-md rounded-r-none border-r-0"
triggerClassName="rounded-s-md rounded-e-none border-e-0"
/>
)}
<TooltipProvider>
Expand All @@ -156,8 +156,8 @@ export default function TaskPropertiesSidebar({
variant="outline"
size="sm"
className={cn(
"text-foreground border-r-0",
canMoveTask ? "rounded-none" : "rounded-r-none",
"text-foreground border-e-0",
canMoveTask ? "rounded-none" : "rounded-e-none",
)}
onClick={() => handleCopyTaskLink()}
>
Expand All @@ -177,7 +177,7 @@ export default function TaskPropertiesSidebar({
<Button
variant="outline"
size="sm"
className="text-foreground rounded-l-none"
className="text-foreground rounded-s-none"
onClick={() => handleCopyTaskBranch()}
>
<GitBranch className="size-4" />
Expand Down Expand Up @@ -337,7 +337,7 @@ export default function TaskPropertiesSidebar({
<TaskMovePopover
task={task}
workspaceId={workspaceId}
triggerClassName="rounded-l-md rounded-r-none border-r-0"
triggerClassName="rounded-s-md rounded-e-none border-e-0"
/>
)}
<TooltipProvider>
Expand All @@ -347,8 +347,8 @@ export default function TaskPropertiesSidebar({
variant="outline"
size="sm"
className={cn(
"text-foreground border-r-0",
canMoveTask ? "rounded-none" : "rounded-r-none",
"text-foreground border-e-0",
canMoveTask ? "rounded-none" : "rounded-e-none",
)}
onClick={() => handleCopyTaskLink()}
>
Expand All @@ -368,7 +368,7 @@ export default function TaskPropertiesSidebar({
<Button
variant="outline"
size="sm"
className="text-foreground rounded-l-none"
className="text-foreground rounded-s-none"
onClick={() => handleCopyTaskBranch()}
>
<GitBranch className="size-4" />
Expand Down Expand Up @@ -529,7 +529,7 @@ export default function TaskPropertiesSidebar({
<TaskMovePopover
task={task}
workspaceId={workspaceId}
triggerClassName="rounded-l-md rounded-r-none border-r-0"
triggerClassName="rounded-s-md rounded-e-none border-e-0"
/>
)}
<TooltipProvider>
Expand All @@ -539,8 +539,8 @@ export default function TaskPropertiesSidebar({
variant="outline"
size="sm"
className={cn(
"text-foreground border-r-0",
canMoveTask ? "rounded-none" : "rounded-r-none",
"text-foreground border-e-0",
canMoveTask ? "rounded-none" : "rounded-e-none",
)}
onClick={() => handleCopyTaskLink()}
>
Expand All @@ -560,7 +560,7 @@ export default function TaskPropertiesSidebar({
<Button
variant="outline"
size="sm"
className="text-foreground rounded-l-none"
className="text-foreground rounded-s-none"
onClick={() => handleCopyTaskBranch()}
>
<GitBranch className="size-4" />
Expand Down
Loading
Loading