Skip to content

Commit 2a1f5ff

Browse files
authored
Merge pull request #47 from lumpinif/main
[Major Release]: bumped version to v3.1.0
2 parents 3495a52 + 688a35f commit 2a1f5ff

37 files changed

Lines changed: 793 additions & 828 deletions

.github/workflows/chrome-extension-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
# Don't increment major versions (x.0.0)
7676
echo "version=$current_version" >> $GITHUB_OUTPUT
7777
echo "version_changed=false" >> $GITHUB_OUTPUT
78-
elif git ls-remote --tags origin refs/tags/v$current_version >/dev/null; then
78+
elif git ls-remote --tags origin | grep -q "refs/tags/v$current_version"; then
7979
# If tag exists and it's not a major version, increment patch
8080
IFS='.' read -r major minor patch <<< "$current_version"
8181
new_version="$major.$minor.$((patch + 1))"

extensions/changelog.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
## Changelog of the extensions
22

3+
### feat/fix/ref: - 11/27/2024 - @lumpinif
4+
5+
#### Performance & Code Quality
6+
7+
- Extremely streamline code structure and implementation approach
8+
- Much optimized performance
9+
- Streamline and organize code for thinking-block implementation
10+
11+
#### Bug Fixes
12+
13+
- Fix flash of unstyled content (FOUC)
14+
- Fix stutter when submitting new replies
15+
- Fix FOUC and streaming issues for thinking-block implementation
16+
17+
#### UI Improvements
18+
19+
- Update chevron icon with transition effect
20+
21+
#### Architecture
22+
23+
- Implement ultimate approach with simplest and most effective implementation after experimentation
24+
325
### fix: - 11/17/2024 - @lumpinif
426

527
#### Observer Management and Memory Leak Prevention

extensions/chrome/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,23 @@ We use several tools to maintain code quality:
223223
- **ESLint**: Finds and fixes JavaScript problems
224224
- **Prettier**: Formats your code consistently
225225

226+
### Version Control & Releases
227+
228+
The project uses automated version bumping through CI:
229+
230+
- **Automatic Version Bumping**: When code is merged to main, the CI will:
231+
232+
- Auto-increment the patch version (e.g., 1.0.0 -> 1.0.1)
233+
- Create a new release with the bumped version
234+
- Skip version bump for major versions (x.0.0)
235+
236+
- **Manual Version Control**:
237+
- Developers can manually set both versions in `package.json` and `manifest.json`
238+
- Major version changes (x.0.0) must be set manually
239+
- Manual versions will be respected by CI
240+
241+
> **Note**: If you need to manually set a version, update both `package.json` and `manifest.json` before merging to main.
242+
226243
### Continuous Integration
227244

228245
Our GitHub Actions setup automatically:

extensions/chrome/components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"rsc": false,
55
"tsx": true,
66
"tailwind": {
7-
"config": "tailwind.config.js",
7+
"config": "tailwind.config.cjs",
88
"css": "src/styles/globals.css",
99
"baseColor": "zinc",
1010
"cssVariables": true,

extensions/chrome/eslint.config.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ module.exports = [
3333
setInterval: "readonly",
3434
Node: "readonly",
3535
HTMLButtonElement: "readonly",
36+
MutationRecord: "readonly",
37+
MouseEvent: "readonly",
38+
SVGSVGElement: "readonly",
3639
},
3740
},
3841
plugins: {
@@ -58,6 +61,8 @@ module.exports = [
5861
"react-hooks/rules-of-hooks": "error",
5962
"react-hooks/exhaustive-deps": "warn",
6063
"no-inline-styles": "off",
64+
"no-undef": "off",
65+
"react/prop-types": "off",
6166
},
6267
settings: {
6368
react: {

extensions/chrome/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "thinking-claude",
3-
"version": "3.0.0",
3+
"version": "3.1.0",
44
"description": "Chrome extension for letting Claude think like a real human",
55
"type": "module",
66
"scripts": {
@@ -19,6 +19,12 @@
1919
"type-check": "tsc --noEmit"
2020
},
2121
"dependencies": {
22+
"@radix-ui/react-accordion": "^1.2.1",
23+
"@radix-ui/react-collapsible": "^1.1.1",
24+
"@radix-ui/react-scroll-area": "^1.2.1",
25+
"@radix-ui/react-slot": "^1.1.0",
26+
"@radix-ui/react-tooltip": "^1.1.4",
27+
"class-variance-authority": "^0.7.0",
2228
"clsx": "^2.1.1",
2329
"lucide-react": "^0.460.0",
2430
"react": "^18.2.0",
@@ -46,6 +52,7 @@
4652
"identity-obj-proxy": "^3.0.0",
4753
"lint-staged": "^14.0.1",
4854
"markdownlint-cli2": "^0.15.0",
55+
"mini-css-extract-plugin": "^2.9.2",
4956
"postcss": "^8.4.31",
5057
"postcss-loader": "^7.3.3",
5158
"postcss-nesting": "^12.0.1",
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export default {
1+
module.exports = {
22
plugins: {
33
tailwindcss: {},
44
autoprefixer: {},
55
},
6-
};
6+
}

extensions/chrome/public/manifest.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"manifest_version": 3,
33
"name": "Thinking Claude",
4-
"version": "3.0.0",
4+
"version": "3.1.0",
55
"description": "Chrome extension for letting Claude think like a real human",
66
"content_scripts": [
77
{
88
"matches": ["https://*.claude.ai/*"],
9-
"js": ["content.js"]
9+
"js": ["content.js"],
10+
"css": ["styles.css"]
1011
}
1112
],
1213
"icons": {
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
/* Overwrite original claude thinking block content styles */
2+
.code-block__code {
3+
background: none !important;
4+
white-space: pre-wrap !important;
5+
word-wrap: break-word !important;
6+
overflow-y: auto !important;
7+
overflow-x: hidden !important;
8+
color: var(--text-text-200) !important;
9+
padding: 1em !important;
10+
max-width: 100%;
11+
display: block;
12+
height: auto !important;
13+
min-height: 0vh !important;
14+
max-height: 50vh !important;
15+
visibility: visible !important;
16+
opacity: 1 !important;
17+
transition: all 0.3s ease-out !important;
18+
}
19+
20+
/* collapsed states */
21+
22+
/* Collapsed state */
23+
.code-block__code.collapsed {
24+
height: 0 !important;
25+
padding: 0 !important;
26+
visibility: hidden !important;
27+
opacity: 0 !important;
28+
}
29+
30+
/* Collapsed state */
31+
[data-thinking-block-state="collapsed"] .code-block__code {
32+
height: 0 !important;
33+
padding: 0 !important;
34+
visibility: hidden !important;
35+
opacity: 0 !important;
36+
}
37+
38+
/* Expanded state */
39+
/* [data-thinking-block-state="expanded"] .code-block__code {
40+
height: 50vh !important;
41+
padding: 1em !important;
42+
visibility: visible !important;
43+
opacity: 1 !important;
44+
} */
45+
46+
code {
47+
background: none !important;
48+
white-space: pre-wrap !important;
49+
word-wrap: break-word !important;
50+
text-wrap: balance !important;
51+
color: hsl(var(--text-300)) !important;
52+
font-size: 0.875rem !important;
53+
display: block !important;
54+
max-width: 100% !important;
55+
text-shadow: none !important;
56+
}
57+
58+
/* Add selection styles */
59+
code span::selection {
60+
background: hsl(var(--clay) / var(--tw-text-opacity)) !important;
61+
color: hsl(var(--text-100)) !important;
62+
}
63+
64+
code span::-moz-selection {
65+
background: hsl(var(--clay) / var(--tw-text-opacity)) !important;
66+
color: hsl(var(--text-100)) !important;
67+
}
68+
69+
code span:hover {
70+
transition: color 0.4s ease;
71+
color: hsl(var(--text-100));
72+
}
73+
74+
/* --------------------------------- */
75+
76+
/* Copy button container */
77+
div[data-is-streaming] .pointer-events-none.sticky {
78+
cursor: pointer !important;
79+
pointer-events: auto !important;
80+
}
81+
82+
/* Copy button container */
83+
div[data-is-streaming] .from-bg-300\\/90 {
84+
pointer-events: auto !important;
85+
user-select: none !important;
86+
}
87+
88+
/* --------------------------------- */
89+
90+
/* Update the header text */
91+
/* This is the original header text */
92+
pre .text-text-300.absolute.pl-3.pt-2\.5.text-xs:not(:empty) {
93+
font-size: 0; /* Hide original text */
94+
pointer-events: auto !important; /* Make sure it's clickable */
95+
cursor: pointer !important;
96+
display: inline-flex;
97+
align-items: center;
98+
font-family: var(--font-user-message);
99+
}
100+
101+
/* Update the text of the header */
102+
[data-thinking-block-state="collapsed"]
103+
pre
104+
.text-text-300.absolute.pl-3.pt-2\.5.text-xs:not(:empty)::after {
105+
content: "Open Claude's thinking";
106+
font-size: 0.875rem; /* Restore font size */
107+
cursor: pointer;
108+
font-family: var(--font-user-message);
109+
transition: color 0.15s ease-in-out;
110+
}
111+
112+
pre .text-text-300.absolute.pl-3.pt-2\.5.text-xs:not(:empty)::after {
113+
content: "Claude's thinking";
114+
font-size: 0.875rem; /* Restore font size */
115+
cursor: pointer;
116+
font-family: var(--font-user-message);
117+
transition: color 0.15s ease-in-out;
118+
}
119+
120+
/* Hover state */
121+
[data-thinking-block-state="expanded"]
122+
pre
123+
.text-text-300.absolute.pl-3.pt-2\.5.text-xs:not(:empty):hover::after {
124+
color: hsl(var(--text-100));
125+
content: "Hide Claude's thinking";
126+
}
127+
128+
/* Streaming state styles */
129+
div[data-is-streaming="true"]
130+
pre
131+
.text-text-300.absolute.pl-3.pt-2\.5.text-xs:not(:empty)::after {
132+
content: "Claude is thinking...";
133+
background: linear-gradient(
134+
90deg,
135+
rgba(156, 163, 175, 0.7) 0%,
136+
rgba(209, 213, 219, 1) 25%,
137+
rgba(156, 163, 175, 0.7) 50%,
138+
rgba(209, 213, 219, 1) 75%,
139+
rgba(156, 163, 175, 0.7) 100%
140+
);
141+
background-size: 200% 100%;
142+
animation: gradientWave 3s linear infinite;
143+
-webkit-background-clip: text;
144+
-webkit-text-fill-color: transparent;
145+
background-clip: text;
146+
color: transparent;
147+
cursor: pointer;
148+
font-family: var(--font-user-message);
149+
}
150+
151+
/* Chevron-down icon */
152+
pre .text-text-300.absolute.pl-3.pt-2\.5.text-xs:not(:empty)::before {
153+
content: "";
154+
width: 15px;
155+
height: 15px;
156+
margin-right: 0.25rem;
157+
-webkit-mask-image: url('data:image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="black" fill-rule="evenodd" clip-rule="evenodd"></path></svg>');
158+
mask-image: url('data:image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="black" fill-rule="evenodd" clip-rule="evenodd"></path></svg>');
159+
-webkit-mask-size: contain;
160+
mask-size: contain;
161+
-webkit-mask-repeat: no-repeat;
162+
mask-repeat: no-repeat;
163+
background-color: hsl(var(--text-500));
164+
transform: translateY(-1px);
165+
transition: transform 0.25s ease-out;
166+
}
167+
168+
/* --------------------------------- */
169+
170+
/* Shimmer animation for streaming state */
171+
@keyframes gradientWave {
172+
0% {
173+
background-position: 200% 50%;
174+
}
175+
100% {
176+
background-position: -200% 50%;
177+
}
178+
}
179+
180+
/* --------------------------------- */
181+
182+
/* Chevron animation */
183+
184+
[data-thinking-block-state="collapsed"]
185+
pre
186+
.text-text-300.absolute.pl-3.pt-2\.5.text-xs:not(:empty)::before {
187+
transform: rotate(180deg);
188+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from "react"
2+
3+
export const SampleApp: React.FC = () => {
4+
return (
5+
<div>
6+
<div>Hello World</div>
7+
</div>
8+
)
9+
}

0 commit comments

Comments
 (0)