Commit Graph

6968 Commits

Author SHA1 Message Date
Nikita Galaiko
ec06b264d2
test repository open 2023-02-20 13:37:44 +01:00
Nikita Galaiko
f21fc69170
run tests on push 2023-02-20 13:12:24 +01:00
Nikita Galaiko
efaba6b342
more session tests 2023-02-20 13:09:41 +01:00
Nikita Galaiko
ab803a12a1
add sessions test and fix list order 2023-02-20 13:03:28 +01:00
Kiril Videlov
f417127263 Update timestamp handling in project routes
- Change timestamp multiplier from `1000` to `1` in `toHumanReadableTime` and `toHumanReadableDate`
- Change date style to `short` in `toHumanReadableDate`
- Update date filter and `startTime` and `endTime` in `WeekBlockEntry` to use the `startTimestampMs` without multiplying by 1000
- Change condition for filtering the sessions from milliseconds to seconds

[src/routes/projects/[projectId]/week/+page.svelte]
- Change the date filter in `sessionsInWeek` to use the `startTimestampMs` without multiplying by 1000
- Change the `startTime` and `endTime` in `WeekBlockEntry` to use the `startTimestampMs` without multiplying by 1000
[src/lib/time.ts]
- Change timestamp multiplier from `1000` to `1` in `toHumanReadableTime`
- Change timestamp multiplier from `1000` to `1` in `toHumanReadableDate`
- Change date style to `short` in `toHumanReadableDate`
[src/routes/projects/[projectId]/day/+page.svelte]
- Change the condition for filtering the sessions from milliseconds to seconds
2023-02-20 12:57:10 +01:00
Kiril Videlov
34ceeaab7f Update project session and layout stores, add Week functions
- Update types and imports across multiple files
- Add derived store for ordered sessions
- Add default session function to sessions import
- Sort sessions based on their `startTs` property
- Add `next` and `previous` functions to the Week namespace
- Add `nThDay` function to the Week namespace
- Change the import statement from `import { ... } from 'date-fns';` to `import { ... } from "date-fns";`

[src/routes/projects/[projectId]/sessions/[sessionId]/+page.ts]
- Change the type of `load` from `PageLoad` to `PageLoad & Delta`
- Remove the `writable` store from the imports
- Remove the `orderedSessions` store
- Change the `session` store from `orderedSessions` to `sessions`
- Change the `previousSession` store from `orderedSessions` to `sessions`
- Change the `nextSession` store from `orderedSessions` to `s
[src/routes/projects/[projectId]/+layout.ts]
- Import `derived` store from `svelte/store`
- Add a derived store for ordered sessions
- Add a default session function to the `sessions` import
- Sort sessions based on their `startTs` property
[src/lib/week.ts]
- Change the import statement from `import { ... } from 'date-fns';` to `import { ... } from "date-fns";`
- Add the `next` and `previous` functions to the Week namespace
- Add the `nThDay` function to the Week namespace
2023-02-20 12:50:59 +01:00
Nikita Galaiko
2e0f757cd9
use ms timestamps everywhere 2023-02-20 12:41:33 +01:00
Nikita Galaiko
bd2c5b5809
use real fs in deltas tests 2023-02-20 12:41:10 +01:00
Nikita Galaiko
137f73848f
refactor sessions mod 2023-02-20 12:41:09 +01:00
Nikita Galaiko
0562bcae5d
test deltas read/write 2023-02-20 12:41:09 +01:00
Nikita Galaiko
ea9fa3dca4
say session does not exist if meta does not exist 2023-02-20 12:41:09 +01:00
Kiril Videlov
f92a2370bd Add date-fns for better date calculations
- Add date-fns package to project
- Update dependencies in pnpm-lock.yaml
- Replace manual date calculations with date-fns functions
- Add functions to Week class for getting the next/previous week and the nth day of the week

[pnpm-lock.yaml]
- Add `date-fns` dependency to `pnpm-lock.yaml`
- Update `@codemirror/state`, `@codemirror/view`, `@tauri-apps/api`, `idb-keyval`, `mm-jsr`, and `seti-icons` dependencies in `pnpm-lock.yaml`
- Add `date-fns` package to `pnpm-lock.yaml`
[src/lib/week.ts]
- Replace manual date calculations with `date-fns` functions
- Make `Week.from` use `weekStartsOn` to set the start of the week
- Add `Week.next`, `Week.previous` and `Week.nThDay` functions
[package.json]
- Add date-fns package
2023-02-20 12:34:07 +01:00
Kiril Videlov
624796ba97 Fix session navigation ordering
- Order sessions by start timestamp
- Update derived states to use ordered sessions state

[src/routes/projects/[projectId]/sessions/[sessionId]/+page.ts]
- Add a derived state to order the sessions by start timestamp
- Update the `session` derived state to use the new ordered sessions state
- Update the `previousSession` and `nextSession` derived states to use the new ordered sessions state
2023-02-20 11:11:30 +01:00
Kiril Videlov
a0b6e82795 Remove sorting of sessions by timestamp in rust 2023-02-20 10:19:06 +01:00
Kiril Videlov
9891263794 Update project page layout and display
- Change the display of the project page from a timeline view to a weekly/daily view
- Change the page title to the project name
- Add two links for the weekly/daily view
- Change the hover color of the Week, Day, and Session links from `text-zinc-300` to `text-zinc-200`

[src/routes/projects/[projectId]/+page.svelte]
- Change the page display from a timeline view to a weekly/daily view
- Change the page title to the project name
- Add two links for the weekly/daily view
[src/routes/projects/[projectId]/+layout.svelte]
- Change the hover color of the Week, Day, and Session links from `text-zinc-300` to `text-zinc-200`
2023-02-19 23:10:32 +01:00
Kiril Videlov
74128145d1 Add day and week pages for project view
- Add a new page for viewing sessions in a day
- Change the link of the 'Day' page
- Change `toHumanReadableTime` to accept a timestamp in seconds
- Add an additional option to `toHumanReadableDate`

[src/app.html]
- Wrap `%sveltekit.body%` in a `<div>` with `display: contents`
[src/routes/projects/[projectId]/day/+page.svelte]
- Add a new page for viewing sessions in a day
- Add navigation buttons to the page header
- Add logic to format the date and display the sessions in the day
- Add logic to determine the display width of each session
- Add an error message if the project is not found
[src/routes/projects/[projectId]/+layout.svelte]
- Change the link of the 'Day' page to `/projects/{$project?.id}/day`
[src/routes/projects/[projectId]/week/+page.svelte]
- Remove `onMount` and `onDestroy` imports from `+page.svelte`
- Add `WeekBlockEntry` import from `$lib/components/week`
[src/lib/time.ts]
- Change `toHumanReadableTime` to accept a timestamp in seconds instead of milliseconds
- Add an additional option to `toHumanReadableDate`
2023-02-19 23:00:27 +01:00
Scott Chacon
2f2acbf1af this calculation wasnt correct, you dont need to divide by 1000. also, lets change the scope to 10 minutes 2023-02-18 15:52:51 +01:00
Scott Chacon
31a01ac693 think I fixed scrolling, changed time to start+duration, fixed ordering of sessions when pushing to commit vector 2023-02-18 15:47:08 +01:00
Scott Chacon
f093da0eb5 add seti icons, simplify file names, make them fit 2023-02-18 15:06:04 +01:00
Scott Chacon
868b78e774 took out refs/heads, brightened the menu font, replace "settings" with cog 2023-02-18 13:26:56 +01:00
Kiril Videlov
c90eb122ca Improve project week page and layout styling
- Add a WeekBlockEntry component to `src/lib/components/week/index.ts`
- Update the body class and remove the `<div>` tag from `src/app.html`
- Add type `Week` with properties `start` and `end` to `src/lib/week.ts`
- Add `week` module to `src/lib/index.ts`
- Add a new WeekBlockEntry component and functions to

[src/lib/components/week/index.ts]
- Add `WeekBlockEntry` component to `src/lib/components/week/index.ts`
[src/app.html]
- Change the body class to `fixed h-full w-full overflow-hidden font-sans antialiased`
- Remove the `<div>` tag around the `%sveltekit.body%`
[src/lib/week.ts]
- Add type `Week` with properties `start` and `end`
- Add methods to `Week` type to get the next, previous and nth day of the week
[src/lib/index.ts]
- Add `week` module to `src/lib/index.ts`
[src/lib/components/week/WeekBlockEntry.svelte]
- Add a new WeekBlockEntry component
- Add functions to convert time and date to grid row and column
- Add a span calculation for the WeekBlockEntry component
- Add a link with label and href attributes for the WeekBlockEntry component
[src/routes/projects/[projectId]/week/+page.svelte]
- Add a week page for projects
- Add navigation for the week page
- Add a grid for the week page
- Show the date of each day in the week
- Show the time of each hour in the day
- Display a list of sessions for the week
- Add a link to each session in the list
[src/routes/projects/[projectId]/+layout.svelte]
- Change the contextProjectStore setter from `getContext('project')` to `getContext("project")`
- Change the nav class from `h-12 p-3 flex justify-between space-x-3 text-zinc-500 text-lg select-none border-b border-zinc-700` to `flex flex-none justify-between h-12 p-3 space-x-3 text-lg border-b select-none
[src/routes/+layout.svelte]
- Change the styling of the header element
- Remove the flex-1 overflow-y-auto div
- Update the footer text
- Add an element with the id `foo`
2023-02-18 00:29:50 +01:00
Kiril Videlov
be935ceddf Improve layout of src/routes/+layout.svelte
- Simplified the layout of the header element
- Adjusted the min-height, class, and flex-row of the div elements
- Improved the flex-shrink of the last div element

[src/routes/+layout.svelte]
- Simplify the class attribute of the header element
- Change the min-height of the div element to a flex-grow
- Change the class of the inner div element to flex-1 and add overflow-y-auto
- Change the class of the last div element to flex-shrink-0 and add flex-row
2023-02-17 16:21:24 +01:00
Nikita Galaiko
95cd818a3f
sort release types to prevent accidental deployment 2023-02-17 16:14:39 +01:00
Nikita Galaiko
b1d6c2fee3 dynamic release versioning 2023-02-17 16:09:24 +01:00
Nikita Galaiko
928b94a031 do semver 2023-02-17 16:09:24 +01:00
Nikita Galaiko
eeec46c092
ignore non-utf8 files when calculating deltas 2023-02-17 16:04:22 +01:00
Scott Chacon
1bc8b80508 add an icon for fun 2023-02-17 16:03:29 +01:00
Nikita Galaiko
e1c47af20d
handle deltas calculation when file is removed 2023-02-17 15:18:32 +01:00
Nikita Galaiko
37a9a6a17c
move to project-id based namespacing 2023-02-17 10:50:30 +01:00
Nikita Galaiko
df950a5608
s3 upload (#14)
Automatically build on build branch, upload to S3 and tell the server.

---------

Co-authored-by: Scott Chacon <schacon@gmail.com>
2023-02-17 07:42:30 +01:00
Kiril Videlov
8a97206f81 Improve layout and completions
- Remove `open` import and `onSelectProjectClick` function from `+layout.svelte` file

[src/routes/+layout.svelte]
- Remove the `open` import from the `+layout.svelte` file
- Remove the `onSelectProjectClick` function from the `+layout.svelte` file
2023-02-16 22:48:47 +01:00
Kiril Videlov
e04440abc4 Add local repos and update page layout
- Add a button to add a local repository
- Update the overview page template
- Remove the `DropDown` component from the layout
- Add a `+` button for adding new repositories
- Add a `Up to date` indicator
- Change the background color of the layout

[src/routes/+page.svelte]
- Add a button to add a local repository
- Add a list of recent projects to the overview page
- Update the overview page template
[src/routes/+layout.svelte]
- Remove the `DropDown` component from the layout
- Add a `+` button for adding new repositories
- Add a `Up to date` indicator
- Change the background color of the layout
- Change the text size of the `Up to date` indicator
2023-02-16 22:47:02 +01:00
Kiril Videlov
f5677447d1 Improve project/session navigation and layout styling
- Add Breadcrumbs component to project page
- Update BackForwardButtons size and colors
- Add context for project and session to the layout
- Change the search bar to a link to the user page
- Change the styling of the header to be more consistent

[src/routes/projects/[projectId]/+layout.svelte]
- Add `getContext` and `onDestroy` functions
- Set `contextProjectStore` to the current project
- Update the `lastSessionId` variable
[src/lib/components/index.ts]
- Add a Breadcrumbs component
- Export the Timeline, CodeViewer, BackForwardButtons and Login components
[src/lib/components/Breadcrumbs.svelte]
- Add a Breadcrumbs component
- Add the ability to link to a project
- Add the ability to link to a session
- Add a human readable timestamp for the session
[src/lib/components/BackForwardButtons.svelte]
- Increase button size from `w-3 h-3` to `w-4 h-4`
- Change the color of the buttons from `text-gray-400` to `text-zinc-400`
- Change the hover color of the buttons from `text-gray-300` to `text-zinc-200`
[src/routes/projects/[projectId]/sessions/[sessionId]/+page.svelte]
- Add `getContext` and `Writable` imports from `svelte`
- Add `onDestroy` to set `contextProjectStore` to `null` when destroyed
- Add `selection` variable
- Add `docsNext` derived variable
[src/routes/+layout.svelte]
- Add context for project and session to the layout
- Add breadcrumbs to the layout
- Change the search bar to a link to the user page
- Change the styling of the header to be more consistent
2023-02-16 21:32:31 +01:00
Nikita Galaiko
e1597c7963
push to git remote 2023-02-16 16:19:09 +01:00
Nikita Galaiko
1b8984c357
make git watcher fetch project on every iteration 2023-02-16 15:30:55 +01:00
Nikita Galaiko
dfa16066c1
make watchers into a struct 2023-02-16 15:30:55 +01:00
Nikita Galaiko
723823bccd
module isolation 2023-02-16 15:30:55 +01:00
Kiril Videlov
2127b0f151 Improve UI/UX for Tauri config window
- Update the title bar style to `Overlay`
- Set `minWidth` and `minHeight` for window

[src-tauri/tauri.conf.json]
- Change title bar style to `Overlay`
- Set `minWidth` and `minHeight` for window
2023-02-16 12:18:50 +01:00
Nikita Galaiko
de0dd25c90
project settings page 2023-02-16 12:16:24 +01:00
Kiril Videlov
374978cc1e Improve session selection UI and logic
- Update the styling and logic of the selection element in the project page
- Replace single class with two classes for the selection element

[src/routes/projects/[projectId]/sessions/[sessionId]/+page.svelte]
- Change the styling of the selection elements
- Change the logic of the selection element to use two different classes instead of one
2023-02-16 09:18:33 +01:00
Nikita Galaiko
bc6ac42a71
make watchers use anyhow 2023-02-15 16:57:22 +01:00
Nikita Galaiko
d2b85e614d
refactor users api to make it rust-first 2023-02-15 16:30:52 +01:00
Nikita Galaiko
a68e520f4d
projects update api 2023-02-15 15:44:47 +01:00
Kiril Videlov
c19e374476 Refactor project page & timeline session components
- Update project page layout to a `div` with a bottom border
- Adjust display width of session timeline based on session duration
- Add timeline session components to project page
- Add logic to determine if project exists
- Update authentication API calls and parse JSON responses
- Add new methods for creating login token and getting user object

[src/routes/+layout.svelte]
- Change div container from `flex` to `grid`
- Increase sidebar height from `10` to `12`
- Change sidebar width from `1/4` to `flex`
- Change main content width from `flex-grow` to `col-span-5`
- Add `dark` class to sidebar and main content
[src/lib/components/timeline/index.ts]
- Change the exported component from `TimelineDay` to `TimelineDaySession`
[src/routes/+layout.ts]
- Add an `add` method to the `projects` object
- Add `user` object to the `load` function
- Update the `projects` object to be initialized from an external source if not building
[src/routes/projects/[projectId]/+layout.svelte]
- Change the layout of the project page from a `div` to a `div` with a bottom border
[src/lib/components/timeline/TimelineDay.svelte]
- Delete the TimelineDay component
- Remove the code related to the component, including the `sessionDisplayWidth` function
[src/routes/projects/[projectId]/sessions/[sessionId]/+page.svelte]
- Replace the `border-y` class with `border-b` in the `+page.svelte` file
[src/routes/projects/[projectId]/+page.svelte]
- Add logic to adjust the display width of the session timeline based on session duration
- Add logic to determine if the project exists
- Add timeline session components to the project page
[src/lib/users.ts]
- Move imports to the top of the file
- Add a check to see if a user is logged in
- Set the store to the user if they are logged in
- Log the user when they are set
- Write the user to the file when they are set
[src/lib/authentication.ts]
- Change the URL for the API calls
- Parse JSON responses from the API
- Add a new method for creating a login token
- Add a new method for getting a user object
- Fix typo in error message
- Update the content-type header for API calls
[src/routes/projects/[projectId]/sessions/[sessionId]/+page.ts]
- Change the logic for finding the current session
- Make the code more precise in finding the current session
- Change the logic for finding the previous session
2023-02-15 15:36:20 +01:00
Kiril Videlov
c5c46e8a25 Increase selection and recording functionality
- Added a button to each delta for selection
- Updated the `session` store to return the first session if the sessionId is not found
- Updated the `previousSession` store to return the session before the current one if it exists
- Updated the `docsNext` derived store to include the `selection` store
- Added an `if` statement for `files` in `+page.svelte`

[src/routes/projects/[projectId]/sessions/[sessionId]/+page.ts]
- Changed the import of `svelte/store` to include `writable`
- Changed the `session` store to return the first session if the sessionId is not found
- Changed the `previousSession` store to return the session before the current one if it exists
[src/routes/projects/[projectId]/sessions/[sessionId]/+page.svelte]
- Move the `Timeline` component import from `+page.svelte`
- Initialize `selection` store in `+page.svelte`
- Update `docsNext` derived store to include the `selection` store
- Add a button to each delta for selection
- Add an `if` statement for `files` in `+page.svelte`
- Delete `contentWithDeltasApplied` function from `+page.
2023-02-15 14:53:14 +01:00
Kiril Videlov
5697b204cb wip 2023-02-15 10:44:49 +01:00
Kiril Videlov
cf34f525bb Update CodeViewer to use internal API for completions
- Update CodeViewer component to call `mergeView?.destroy()` before recreating the merge view
- Add a function to update the two editors when values change

[src/lib/components/CodeViewer.svelte]
- Remove commented out code
- Update code to call `mergeView?.destroy()` before recreating the merge view
- Add a function to update the two editors when the values change
2023-02-15 10:14:37 +01:00
Nikita Galaiko
29e76aa24c
include updater bundle when publishing 2023-02-15 09:18:19 +01:00
Kiril Videlov
692297ed8e Update CodeViewer to use MergeView
- Upgrade CodeViewer component to use MergeView
- Add collapseUnchanged option to MergeView
- Update @codemirror/state and @codemirror/view to latest version
- Add @codemirror/merge to dependencies and packages list

[package.json]
- Add @codemirror/merge dependency to package.json
[src/routes/projects/[projectId]/sessions/[sessionId]/+page.svelte]
- Change the `CodeViewer` value from `contentWithDeltasApplied` to `contentAtSessionStart` and `newValue` to `contentWithDeltasApplied`
[src/routes/projects/[projectId]/sessions/[sessionId]/+page.ts]
- Remove `console.log` line in `src/routes/projects/[projectId]/sessions/[sessionId]/+page.ts`
- Change type of `files` from `Record<string, string>` to `any`
[src/lib/components/CodeViewer.svelte]
- Change the code viewer from an EditorView to a MergeView
- Add a newValue prop to the CodeViewer component
- Update the update function to use the new MergeView
- Add collapseUnchanged option to the MergeView
- Remove unused code related to coloring the last edit
[pnpm-lock.yaml]
- Add `@codemirror/merge` to the dependencies and specifiers
- Update `@codemirror/state` to version `6.2.0`
- Update `@codemirror/view` to version `6.7.3`
- Add `@codemirror/merge` to the packages list with the specified resolution and dependencies
2023-02-14 18:33:55 +01:00
Kiril Videlov
6c62b563c9 Refactor deltas and timeline components
- Export `list()` function from `deltas.ts`
- Update `TimelineDaySession.svelte` to use `list()` and `deltas` instead of `listFiles` and `files`

[src/lib/deltas.ts]
- Change `list()` to `export const list()`
- Add type annotations to `list()` function parameters
[src/lib/components/timeline/TimelineDaySession.svelte]
- Change `listFiles` to `list`
- Change `files` to `deltas`
- Change `file` to `delta`
2023-02-14 17:37:45 +01:00