Commit Graph

45 Commits

Author SHA1 Message Date
Abhinav Raut e62967b804 isolate remote picker searches 2026-08-28 02:55:15 +05:30
Abhinav Raut e2ca7c7e5f avoid stale lookup results 2026-08-28 02:19:57 +05:30
Abhinav Raut 18514cd021 search and paginate agents, teams, tags and macros instead of loading them all at boot 2026-08-28 01:43:59 +05:30
Abhinav Raut 9106ea1fda fix composer closing on a blocked send, note keyboard focus, and sheet close target
The fullscreen composer closed itself before the send checks ran, so a
blocked send (empty To, missing tags, contact email not in recipients)
collapsed the editor on a phone even though nothing was sent. The close
now happens after all the guards.

The hover rewrite dropped focus-within from the private note delete menu,
so it could not be reached by keyboard on desktop. Put it back.

The mobile contact sheet hides its own close button, so the collapse icon
was the only way out at 28px. It is 44px below md now and stays 28px above.

Also dropped `overflow-wrap: break-all` from .message-bubble. break-all is
not a valid overflow-wrap value, so that line never did anything.

The rest is comment cleanup and switching `../..` imports to `@main` in the
files already being touched.
2026-08-17 16:06:38 +05:30
pat-s 0e8760af7d Merge branch 'main' into pr/mobile-dashboard
Resolve the index.html conflict by keeping the responsive viewport meta
from this branch and the noindex robots meta added on main.
2026-08-17 08:19:09 +00:00
Abhinav Raut f9fcba880a polish mobile layout and touch targets
Bumps taps to 44px across the sidebar, reply box, conversation header and
data tables, adds a `can-hover` Tailwind variant so hover-gated controls
work on touch, and makes the reports page stack on narrow screens.
2026-08-17 13:42:45 +05:30
Abhinav Raut 5c6f44378e fix timezone country mappings, phone error overlap and welcome workflow 2026-08-17 13:18:36 +05:30
Abhinav Raut 911fbe5b7b detect phone country from browser timezone in the pre-chat form
The country code was guessed from navigator.language, which is the UI
language and often has no region, so most visitors got US. It now reads
the browser timezone first and falls back to language, then US.
2026-08-17 13:10:45 +05:30
pat-s 3620ae0313 fix(ui): make dialogs fit a narrow viewport
`DialogContent` and `AlertDialogContent` are `w-full max-w-lg` with no side
inset, no max height and no vertical scrolling, and `sm:rounded-lg` only
applies from 640px. In a window narrower than that they render edge to
edge with square corners, and cannot be scrolled when taller than the
viewport.

Add a 1rem side inset, `max-h-[calc(100dvh-2rem)]` with `overflow-y-auto`,
and make the radius unconditional. At 640px and above `max-w-lg` still
governs the width, so nothing changes there.

Fixing the two primitives covers all 17 dialog call sites.
2026-08-16 23:20:02 +05:30
Abhinav Raut 6f2f046910 Merge remote-tracking branch 'origin/main' into help-center 2026-08-08 00:01:50 +05:30
chahat-101 d180bfbedc Merge remote-tracking branch 'upstream/main' into network-status-banner 2026-08-07 20:57:38 +05:30
pat-s ebce66a928 feat: mobile support for the agent dashboard
Lets an agent triage and reply to conversations from a phone. Admin and
reports are deliberately untouched, per the discussion in #470.

`apps/main/index.html` pinned `width=1280, initial-scale=0.29`, which makes
a phone lay the page out at 1280 CSS pixels and scale the document to 29
percent. Switching it to `width=device-width` requires the layout to cope
with a real viewport:

- Add `useIsMobile`, using `max-width: 767px` so it is the exact complement
  of Tailwind's `md:`. Align the sidebar primitive's own query to match; at
  exactly 768px it previously reported mobile while `md:` already applied.
- Fold the 3rem icon rail into the drawer. The mobile `Sheet` in
  `ui/sidebar/Sidebar.vue` was already implemented but unreachable, since
  the layout viewport could never match its media query. The rail is
  `collapsible="none"`, which returns before the Sheet branch, so its
  destinations move into the one drawer rather than nesting a second.
- Render the inbox one pane at a time below `md`. Both `ResizablePanelGroup`
  minimums are percentages of the window, giving a ~205px thread beside a
  ~117px contact sidebar at 390px, which no class change can fix. The
  routes are already nested, so list-to-detail is push navigation with a
  back affordance; only the desktop branch reads the persisted panel sizes.
- Show the contact sidebar as a `Sheet`. It has no intrinsic width, being
  sized entirely by its panel, and `collapse()`/`expand()` are splitter
  specific, so this is a parallel path off the same emitter event.
- Collapse the composer to a tap target that opens the existing fullscreen
  editor, and make that dialog full-bleed below `sm`; its `max-w-[60%]`
  gave a 234px modal at 390px. Inline it takes ~280px, which with a soft
  keyboard raised leaves the thread nothing.
- Widen message bubbles and trim the hardcoded 47px gutters on phones, and
  use `overflow-wrap: break-word` so ordinary words stop splitting
  mid-character. Reveal the private-note menu on touch via
  `[@media(hover:hover)]`.
- Remove `SmallScreenOverlay`, whose tuned `scale(3)` existed only to
  cancel out the old `initial-scale`.

Desktop is unchanged, verified by screenshot comparison at 1440px.
2026-08-06 06:41:27 +00:00
chahat-101 ee45e87d6b show connection status banner to agents 2026-07-26 00:37:52 +05:30
Abhinav Raut baff30fc28 add help center with public pages, admin management and AI article indexing
Agents can now publish a public knowledge base per help center.

Backend:
- new internal/helpcenter package for help centers, collections and articles
- admin JSON API behind a new help_center:manage permission
- public /hc/{slug} pages, JSON API, search and sitemap, all rate limited
- migration v2.7.0 for the new tables

AI:
- published articles with the AI flag on get embedded, so the agent answers
  from them. Unpublishing or clearing the flag removes the embeddings.

Media:
- media rows now carry a private flag. Help article images are public so the
  public pages can serve them without auth, and only agents with
  help_center:manage can upload them.

Frontend:
- admin help center list, tree view and article editor
- the old TextEditor is split into ArticleEditor and ConversationEditor over a
  shared useTextEditor composable, so article-only tools like callouts,
  collapsibles and YouTube embeds stay out of the reply box
2026-07-25 14:19:38 +05:30
Abhinav Raut d8b73c5877 retheme UI to the green palette and fix form and search bugs
Colors: the brand color moves from indigo to green in both themes, and the
sidebar, tooltip, card and link styles follow it. Three new tokens replace
hardcoded values: foreground-lighter for idle sidebar items, warning-600 for
warning text that needs 4.5:1 contrast on light backgrounds, and link for
anchors inside rendered email content. DESIGN_SYSTEM.md now lists the real
values from main.scss instead of the old indigo ones.

Forms: every button inside a form that is not the submit button now has an
explicit type. Without it the browser treats it as a submit button, so
clicking Cancel on a contact note posted an empty note, "New holiday" saved
the whole business-hours form, and pressing Enter in an SLA field deleted the
first alert row. The login page also highlights an empty password field on a
failed submit, which a broken condition prevented before, and the two
password fields on the set-password page get their own show and hide toggles.

Search: conversation and contact search now drop responses from an older
query, so clearing the box no longer repopulates the list with stale results.

Permissions: /api/v1/ai/summarize now needs messages:write, since it writes a
private note, and the menu item is hidden for agents without it.
2026-07-25 00:49:26 +05:30
Abhinav Raut b8b2b6c9af standardize frontend design system, fix form validation, and skip continuity/CSAT messages in AI context
Design system:
- add semantic success and warning tokens (light + dark) and wire them into Tailwind
- move all hardcoded status colors (green/amber/red) onto tokens across main app and widget; keep file-type icons as identity colors
- give light mode real surface depth: gray chrome sidebars vs white content, deeper canvas gutter, crisper borders, wider gray spread so selected/hover states show
- unify radius (cards rounded-lg, controls rounded-md) and elevation (card shadow-sm, menu shadow-md)
- make reports overview colors uniform: neutral numbers, green met / red breached
- normalize the two page-title heading outliers to text-xl font-semibold

Form fixes:
- require content on AI snippets
- only include non-checkbox prechat fields when they have a value

AI context:
- skip continuity and CSAT messages in AI history, mining, and previous-conversation tools
2026-07-23 03:37:33 +05:30
Abhinav Raut 35d69fc1c3 fix review findings in reports overview and avatar upload
Guard avatar edits while a save is in flight. The AvatarUpload now takes
a disabled prop that blocks the file picker and the remove button, and
the profile view ignores crop/remove events while saving. This stops a
second crop or a remove from racing an ongoing update.

Only clear the pending file after the delete request succeeds, so a
failed remove keeps the cropped preview and the Save button usable.

Do not mark failed report refreshes as fresh. The fetch helpers now
report success, and lastUpdate only advances when every section loads.
A fully failed refresh no longer labels stale data as just updated.

Add an aria-label to the custom range days input so assistive tech can
name it.
2026-07-18 19:55:59 +05:30
Abhinav Raut 94334a02c6 polish reports overview, avatar upload, and conversation list UI
Reports overview now has a single range picker (7/30/90 days plus a
custom input) that drives every card at once, instead of a separate
date dropdown per card. Auto-refresh polls every 5 minutes, pauses
when the tab is hidden, and stops after an hour until you refresh.
Card titles are muted, numbers use tabular figures, and SLA colors use
theme tokens instead of raw green/red. The old DateFilter component is
gone.

Move avatar cropping into the shared AvatarUpload component and reuse
it on the profile page. Save is disabled until a new image is picked.

Conversation list emphasizes unread rows with bolder text and tighter
spacing. Empty state, MenuCard, and chart legend get small style
fixes. Consolidate several one-off i18n strings into shared keys.
2026-07-18 19:42:42 +05:30
Abhinav Raut c030c9ee4b harden AI embedding and agent prompt handling, add tokenizer, and switch to a green theme
Embedding:
- Persist embedding_max_tokens. It was dropped when saving the provider config
  and always reset to the 8192 default, so self-hosted models with a smaller
  limit kept getting rejected.
- Split embedding requests to stay under the provider's item and token caps. A
  large snippet or URL import used to go in one request, hit the cap, fail, and
  get retried every minute forever.
- Skip blank chunks. An empty input string makes the API reject the whole batch.
- Add the tiktoken tokenizer (cl100k_base) with tests for token counting.

Agent prompt:
- Move contact fields, the conversation subject, and custom attributes out of
  the system prompt and into a delimited user-role block, so a crafted name or
  subject can't act as an instruction.

Frontend:
- Switch the primary and sidebar colors to a green theme.
- Show a "summarizing" info toast while the AI summary runs, and add an info
  toast variant.
- Make the snippet content box taller and the snippet dialog wider.
- Drop a hardcoded dark hover color on the scroll-to-bottom button.
2026-07-16 11:20:38 +05:30
Abhinav Raut 976c45df3e add AI provider connection test and self-heal reasoning model param errors
Reasoning models like gpt-5 reject max_tokens and non-default temperature.
The client now reads the structured 400, renames max_tokens to
max_completion_tokens or drops the bad tuning param, and retries. This
removes the old rule that only sent max_completion_tokens when reasoning
effort was set.

Provider form gets a "Test connection" button that makes one live call
with the form values and shows the provider's real error. Embedding test
also checks the returned vector length against the Dimensions field.
Add an Anthropic preset (their OpenAI-compatible endpoint) and stop
pre-filling temperature since blank is safe on every model.

Fix the shared Button loader so the spinner is visible on non-filled
variants, and polish the copilot panel: bot avatars on messages, dot
loader while thinking, cleaner input box, and tab slide-in animation.
2026-07-13 03:01:10 +05:30
Abhinav Raut e56e3d3b0f use distinct icons for online, away and offline status dots 2026-07-09 01:50:20 +05:30
Abhinav Raut 8f658f274d add livechat pre-chat phone field and fix default launcher logo 2026-07-09 01:49:38 +05:30
Abhinav Raut 4dabc84a33 harden contact create, drop set-away-on-login, make status dots colorblind-safe 2026-07-08 12:14:36 +05:30
Abhinav Raut d300ce26e6 feat: show day separators in conversation message list
closes https://github.com/abhinavxd/libredesk/issues/376
2026-06-10 21:20:07 +05:30
Abhinav Raut d1c346d0f8 Style toasts with theme instead of rich colors 2026-05-14 21:16:36 +05:30
Abhinav Raut 123b809be4 Address review feedback on bulk actions 2026-05-14 20:06:56 +05:30
Abhinav Raut 8ebd7d7e2b cap macro command palette list at 200 and scope highlight observer 2026-04-22 15:54:05 +05:30
Abhinav Raut 2d3958fe49 Merge pull request #294 from abhinavxd/more-view-filters
More fields in view filters.
2026-04-21 21:18:38 +05:30
Abhinav Raut bcd93514ef Fix caret overflow in ComboBox trigger for long labels 2026-04-21 19:43:30 +05:30
Abhinav Raut c16ad26d2d Add Range Calendar shadcn component for filters 2026-04-21 18:41:01 +05:30
Abhinav Raut 79dc693cd1 Fix large tag names expanding outside tag badge 2026-04-21 17:01:33 +05:30
Abhinav Raut 00785c6061 WIP: More filters to views
Virtualize agent list and tag list.
2026-04-19 17:22:49 +05:30
Abhinav Raut 6aea4c9895 Removed the Stepper component and replaced it with a simpler MenuCard layout for channel selection in NewInbox.vue.
- Introduced a new SwitchField component for better UI consistency.
- Updated WebSocket client to remove unnecessary token and inbox_id from ping and typing messages.
- Added session duration configuration to the livechat channel settings in the backend.
2026-04-13 01:38:53 +05:30
Abhinav Raut fa2d17ee15 Update conversation list item layout with channel indicator and improve SLA time format 2026-04-09 01:06:24 +05:30
Abhinav Raut 3db51ec02d Fix consolidate duplicate i18n keys that have same values
Polish csat page
2026-04-05 22:05:23 +05:30
Abhinav Raut 8b556d95a6 Polish auth pages, contact detail, and avatar upload UX. 2026-03-25 01:51:05 +05:30
Abhinav Raut 8fd05667ac Improve sidebar semantics, form label hierarchy, and translate remaining hardcoded strings 2026-03-25 00:47:18 +05:30
Abhinav Raut 81847c7f4e i18n: fix localization issues (#231)
Not backported to main due to extensive i18n refactoring changes in this branch.
2026-02-22 15:12:00 +05:30
Abhinav Raut c155fce93b feat: show contact offline / online status on sidebar
- mark contacts offline if not active for > 5 mins.
2026-01-26 03:28:34 +05:30
Abhinav Raut 0aa4cadab1 refactor(sidebar): improve layout and styling of sidebar components, remove unnecessary padding around chil sidebar items 2026-01-18 17:31:08 +05:30
Abhinav Raut 511f46440a fix merge conflict issues 2026-01-15 18:31:00 +05:30
Abhinav Raut bf1cf025e0 Merge branch 'main' into feat/live-chat-channel 2025-10-04 13:38:42 +05:30
Abhinav Raut 3c3709557e feat: Add loading indicators to chat components and improve spinner UI 2025-07-17 02:29:05 +05:30
Abhinav Raut 8ee81c2d64 feat: Widget dark mode and chat reply expectation message in chat title.
feat: Add HTTP utility functions for trusted origin checks

feat: Implement typing status broadcasting for live chat clients and agents.

feat: Add support for signed URLs in media manager

fix: Update database migration to handle duplicate visitors with same email address.

feat: Add conversation subscription and typing message models for WebSocket communication

feat: Implement conversation subscription management in WebSocket hub this is used for broadcasting typing indicator.

feat: Revamp widget JavaScript to improve mobile responsiveness and show unread messages if any.
2025-07-17 01:06:54 +05:30
Abhinav Raut 5b6a58fba0 wip: intercom like live chat with chat widget
- new vue app for serving live chat widget, created subdirectories inside frontend dir `main` and `widget`
- vite changes for both main app and widget app.
- new backend live chat channel
- apis for live chat widget
2025-06-29 04:59:55 +05:30