Skip to content

Commit

Permalink
Merge branch 'main' into v2_docs_announcement_sublime_text
Browse files Browse the repository at this point in the history
  • Loading branch information
mason-at-pieces authored Oct 21, 2024
2 parents 7aa544d + 34d9d45 commit 134e105
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/extensions-plugins/teams.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Need a little help with Pieces for Microsoft Teams? Both the "Help” & "Hi” c

## Where are my saved snippets stored?

_The <a href={pieces_app.links.installation.pieces_suite_manager}>Pieces Suite</a> must be downloaded and installed separately from the Microsoft Teams App in order for the extension to work properly._
_The [Pieces Suite](/installation-getting-started/what-am-i-installing) must be downloaded and installed separately from the Microsoft Teams App in order for the extension to work properly._

When you save code snippets with Pieces, they are stored locally in the Pieces desktop app.
When you save a snippet, Pieces also saves metadata such as the origin of the snippet, tags, a title, a description, and more.
Expand Down
3 changes: 3 additions & 0 deletions docs/installation-getting-started/macos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { pieces_app } from "/src/lib/const";
import { MiniSpacer, Spacer } from "/src/components/Spacers";
import CTAButton from "/src/components/CTAButton";
import ReleasePill from "/src/components/ReleasePill";
import DownloadLinkUpdater from "/src/components/DownloadLinkUpdater";

<DownloadLinkUpdater />

# Getting Started with Pieces for Developers on macOS

Expand Down
3 changes: 3 additions & 0 deletions docs/installation-getting-started/pieces-os.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import GridFlexRow from "/src/components/GridFlexRow";import Tabs from '@theme/T
import TabItem from '@theme/TabItem';
import { MiniSpacer } from '/src/components/Spacers';
import CTAButton from "/src/components/CTAButton";
import DownloadLinkUpdater from "/src/components/DownloadLinkUpdater";

<DownloadLinkUpdater />

# What is Pieces OS?

Expand Down
3 changes: 3 additions & 0 deletions docs/installation-getting-started/windows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { pieces_app } from "/src/lib/const";
import { Spacer } from "/src/components/Spacers";
import CTAButton from "/src/components/CTAButton";
import ReleasePill from "/src/components/ReleasePill";
import DownloadLinkUpdater from "/src/components/DownloadLinkUpdater";

<DownloadLinkUpdater />

# Getting Started with Pieces for Developers on Windows
<ReleasePill>Compatible with Windows 10 Version 1903 or higher</ReleasePill>
Expand Down
2 changes: 1 addition & 1 deletion docs/product-highlights-and-benefits/live-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ We would like to introduce **Live Context** in Pieces for Developers, **powered

[Live Context elevates the Pieces Copilot](https://code.pieces.app/blog/introducing-pieces-copilot-now-with-live-context), allowing it to understand your workflow and discuss how, where, and when you work. As with everything we do here at Pieces, this all happens entirely on-device and is available on [macOS](/installation-getting-started/macos), [Windows](/installation-getting-started/windows), and [Linux](/installation-getting-started/linux). We truly believe the Pieces Copilot+ will revolutionize how you cross off your to-dos.

By using context captured throughout your workflow, Pieces Copilot+ can provide hyper-aware assistance to guide you right back to where you left off. Ask it, “What was I working on an hour ago?” and let it help you get back into flow. Ask it, “How can I resolve the issue I got with Cocoa Pods in the terminal in IntelliJ?” or “What did Mack say I should test in the latest release?” and let Pieces Copilot surface the information that you know you have, but you can’t remember where.
By using context captured throughout your workflow, Pieces Copilot+ can provide hyper-aware assistance to guide you right back to where you left off. Ask it [novel AI prompts](https://pieces.app/blog/20-novel-ai-prompts-made-possible-only-by-pieces-copilot) like, “What was I working on an hour ago?” and let it help you get back into flow. Ask it, “How can I resolve the issue I got with Cocoa Pods in the terminal in IntelliJ?” or “What did Mack say I should test in the latest release?” and let Pieces Copilot surface the information that you know you have, but you can’t remember where.

Pieces Copilot+ is now temporally grounded in exactly what you have been working on, which reduces the need for manual context input, enhances continuity in developer tasks, reduces context switching, and enables more natural, intuitive interactions with the Pieces Copilot.

Expand Down
1 change: 1 addition & 0 deletions docs/resources/live-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Live Context elevates the Pieces Copilot, allowing it to understand your workflo
- Demo Timestamps: 10:18-18:43
- [Live Context Privacy and Security Documentation](https://docs.pieces.app/product-highlights-and-benefits/privacy-security-data#live-context)
- [The Pieces Team Magic Moments](https://www.youtube.com/watch?v=pEHdZyR83BU)
- [Novel AI Prompts](https://pieces.app/blog/20-novel-ai-prompts-made-possible-only-by-pieces-copilot)

## Privacy and Security
The Live Context feature in Pieces enhances the functionality of the Pieces Copilot by utilizing our proprietary Workstream Pattern Engine (WPE). This feature is designed with privacy and efficiency in mind, ensuring that all data processing and storage occur locally on your device.
Expand Down
6 changes: 3 additions & 3 deletions src/components/CTAButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {useColorMode} from '@docusaurus/theme-common';
import Image from "../Image";
import React, { useState, useEffect } from 'react';
import Image from '@site/src/components/Image';

type CTAButtonProps = {
label?: string
Expand All @@ -13,7 +14,7 @@ type CTAButtonProps = {
}

const CTAButton = ({ ...props }: CTAButtonProps) => {
const {colorMode} = useColorMode();
const { colorMode } = useColorMode();

// If the href starts with http, open in a new tab
const newTab = props.href?.startsWith('http');
Expand Down Expand Up @@ -47,7 +48,6 @@ const CTAButton = ({ ...props }: CTAButtonProps) => {
)
) : null
}

{props.label}
</a>
)
Expand Down
43 changes: 43 additions & 0 deletions src/components/DownloadLinkUpdater/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { useEffect } from 'react';

// Define the type for gaGlobal
interface GaGlobal {
vid: string;
from_cookie: boolean;
}

// Check if gaGlobal exists in the global scope
declare const gaGlobal: GaGlobal | undefined;

const DownloadLinkUpdater: React.FC = () => {
useEffect(() => {
// Ensure the window object is available, indicating we're in the browser
if (typeof window !== 'undefined' && typeof gaGlobal !== 'undefined') {
const vid = gaGlobal.vid; // Extract the visitor ID from the global gaGlobal object

// Get all anchor (<a>) elements on the page
const links = document.querySelectorAll('a[href^="https://builds.pieces.app/stages/production"]');

// Loop through each link and update its href
links.forEach(link => {
const currentHref = link.getAttribute('href');

if (currentHref) {
// Construct the new href with the required query parameters
const newHref = `${currentHref}?download=true&product=DOCUMENTATION_WEBSITE${vid && `&ga_visitor=${vid}`}`;

// Update the href attribute on the link
link.setAttribute('href', newHref);
}
});
} else {
if (typeof window && typeof gaGlobal === 'undefined') {
console.warn('gaGlobal is not defined in local development');
}
}
}, []); // Empty dependency array means this effect runs only once after the component mounts

return null; // This component doesn’t need to render anything
};

export default DownloadLinkUpdater;

0 comments on commit 134e105

Please sign in to comment.