Skip to content

Commit 48362da

Browse files
committed
style: remove emojis and lock dark mode appearance removing theme switch toggle
1 parent cb67382 commit 48362da

9 files changed

Lines changed: 73 additions & 49 deletions

File tree

src/.vitepress/config.mts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default defineConfig({
55
description: 'Soroban Smart Contract Cost Awareness Pipeline',
66
base: process.env.BASE_URL || (process.env.CI ? '/docs/' : '/'),
77
ignoreDeadLinks: true,
8+
appearance: 'force-dark',
89
srcDir: '.',
910
cleanUrls: true,
1011
head: [
@@ -17,14 +18,15 @@ export default defineConfig({
1718
themeConfig: {
1819
logo: undefined,
1920
siteTitle: 'Tollcraft',
21+
darkModeSwitchLabel: 'Appearance',
2022
search: {
2123
provider: 'local'
2224
},
2325
nav: [
2426
{ text: 'Home', link: '/' },
25-
{ text: '🛡️ Cost Linter', link: '/cost-linter/' },
26-
{ text: '🧪 Budget Assert', link: '/budget-assert/' },
27-
{ text: '🔥 Cost Profiler', link: '/cost-profiler/' },
27+
{ text: 'Cost Linter', link: '/cost-linter/' },
28+
{ text: 'Budget Assert', link: '/budget-assert/' },
29+
{ text: 'Cost Profiler', link: '/cost-profiler/' },
2830
{
2931
text: 'Ecosystem',
3032
items: [

src/.vitepress/theme/components/CostTelemetryMatrix.vue

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
:class="['op-tab', { active: selectedOpIndex === idx }]"
1717
@click="selectedOpIndex = idx"
1818
>
19-
<span class="op-tab-icon">{{ op.icon }}</span>
19+
<span class="op-tab-index">0{{ idx + 1 }}.</span>
2020
<span class="op-tab-title">{{ op.title }}</span>
2121
</button>
2222
</div>
@@ -79,7 +79,7 @@
7979
</div>
8080

8181
<div class="protection-callout">
82-
<span class="protect-icon">🛡️</span>
82+
<span class="protect-badge">GUARD</span>
8383
<div class="protect-content">
8484
<strong>Tollcraft Protection:</strong>
8585
<span>{{ currentOp.tollcraftGuard }}</span>
@@ -94,7 +94,6 @@ import { ref, computed } from 'vue'
9494
9595
interface Operation {
9696
id: string
97-
icon: string
9897
title: string
9998
category: string
10099
tierLabel: string
@@ -116,7 +115,6 @@ interface Operation {
116115
const operations: Operation[] = [
117116
{
118117
id: 'storage-loop',
119-
icon: '🔁',
120118
title: 'Storage Write in Loop',
121119
category: 'Storage & I/O',
122120
tierLabel: 'Tier 1 Caught',
@@ -131,20 +129,19 @@ const operations: Operation[] = [
131129
rent: 'Repeated TTL hits',
132130
rentDetail: 'Increases state contention on ledger entries',
133131
badCode: `for item in items.iter() {
134-
// Incurs N writes and N host cross-calls!
132+
// [HAZARD] Incurs N writes and N host cross-calls
135133
env.storage().instance().set(&item.key, &item.val);
136134
}`,
137135
goodCode: `let mut batch = env.storage().instance().get(&BATCH_KEY).unwrap_or(...);
138136
for item in items.iter() {
139137
batch.push_back(item);
140138
}
141-
// Commit once at loop completion
139+
// [OPTIMAL] Commit once at loop completion
142140
env.storage().instance().set(&BATCH_KEY, &batch);`,
143141
tollcraftGuard: 'Linted at build-time by instance_storage_write_in_loop and asserted in tests via #[budget_write_bytes_lt].'
144142
},
145143
{
146144
id: 'cross-contract',
147-
icon: '',
148145
title: 'Cross-Contract Invocation',
149146
category: 'Inter-Contract',
150147
tierLabel: 'Tier 2 & 3 Profiled',
@@ -159,18 +156,17 @@ env.storage().instance().set(&BATCH_KEY, &batch);`,
159156
rent: 'Entry TTL dependent',
160157
rentDetail: 'User balance entry TTL extended if configured',
161158
badCode: `for recipient in recipients.iter() {
162-
// Individual subcall per recipient in loop!
159+
// [HAZARD] Individual subcall per recipient in loop
163160
token_client.transfer(&admin, &recipient, &amount);
164161
}`,
165-
goodCode: `// Batch into multi-transfer or pre-validate authorization
162+
goodCode: `// [OPTIMAL] Batch into multi-transfer or pre-validate authorization
166163
token_client.batch_transfer(&admin, &recipients, &amount);
167164
// Profile subcalls to verify host overhead:
168165
// soroban-cost-profiler --wasm router.wasm --fn batch_transfer`,
169166
tollcraftGuard: 'Contract call inside loop detected by contract_call_in_loop lint; subcall frame traced by soroban-cost-profiler.'
170167
},
171168
{
172169
id: 'crypto-hashing',
173-
icon: '🔐',
174170
title: 'Crypto Hash Operations',
175171
category: 'Host Functions',
176172
tierLabel: 'Tier 3 Hotspot',
@@ -184,12 +180,12 @@ token_client.batch_transfer(&admin, &recipients, &amount);
184180
ioDetail: 'Pure computation; no ledger state modified',
185181
rent: 'None',
186182
rentDetail: 'Transient computation',
187-
badCode: `// Hashing identical invariant data inside inner loop:
183+
badCode: `// [HAZARD] Hashing identical invariant data inside inner loop:
188184
for item in dataset.iter() {
189185
let hash = env.crypto().sha256(&static_header);
190186
verify_item(&hash, item);
191187
}`,
192-
goodCode: `// Pre-compute hash outside loop scope:
188+
goodCode: `// [OPTIMAL] Pre-compute hash outside loop scope:
193189
let hash = env.crypto().sha256(&static_header);
194190
for item in dataset.iter() {
195191
verify_item(&hash, item);
@@ -198,7 +194,6 @@ for item in dataset.iter() {
198194
},
199195
{
200196
id: 'unbounded-vec',
201-
icon: '📈',
202197
title: 'Unbounded Vec Appends',
203198
category: 'Memory & CPU',
204199
tierLabel: 'Tier 1 & 2 Guarded',
@@ -213,11 +208,11 @@ for item in dataset.iter() {
213208
rent: 'Proportional to size',
214209
rentDetail: 'Larger state entries pay higher continuous rent',
215210
badCode: `let mut list = Vec::new(&env);
216-
// Unbounded external loop parameter
211+
// [HAZARD] Unbounded external loop parameter
217212
for i in 0..user_count {
218213
list.push_back(i);
219214
}`,
220-
goodCode: `// Enforce bounded cap and pre-allocate if possible
215+
goodCode: `// [OPTIMAL] Enforce bounded cap and pre-allocate if possible
221216
assert!(user_count <= MAX_BATCH_SIZE, "batch limit exceeded");
222217
let mut list = Vec::new(&env);
223218
for i in 0..user_count {
@@ -502,8 +497,28 @@ const currentOp = computed(() => operations[selectedOpIndex.value])
502497
margin-top: 16px;
503498
}
504499
505-
.protect-icon {
506-
font-size: 1.1rem;
500+
.protect-badge {
501+
font-family: var(--font-mono);
502+
font-size: 0.68rem;
503+
font-weight: 700;
504+
letter-spacing: 0.08em;
505+
color: var(--cyan);
506+
background: rgba(34, 211, 238, 0.15);
507+
border: 1px solid rgba(34, 211, 238, 0.3);
508+
padding: 2px 6px;
509+
border-radius: 4px;
510+
margin-top: 2px;
511+
}
512+
513+
.op-tab-index {
514+
font-family: var(--font-mono);
515+
font-size: 0.72rem;
516+
font-weight: 700;
517+
color: var(--faint);
518+
}
519+
520+
.op-tab.active .op-tab-index {
521+
color: var(--magenta);
507522
}
508523
509524
.protect-content {

src/.vitepress/theme/components/PipelineInteractive.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const stages: Stage[] = [
132132
amm_pool::swap [CPU Instructions]
133133
Measured: 1,420,110 inst. | Limit: 1,500,000 inst. -> PASS
134134
amm_pool::swap [Write Bytes]
135-
Measured: 2,048 bytes | Limit: 1,024 bytes -> FAIL
135+
Measured: 2,048 bytes | Limit: 1,024 bytes -> FAIL
136136
Error: 1 budget check failed. Regression exceeds 10% tolerance.`,
137137
link: '/budget-assert/'
138138
},

src/.vitepress/theme/components/TerminalDemo.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</button>
1919
</div>
2020
<button class="copy-btn" @click="copyCommand" :title="copied ? 'Copied!' : 'Copy Command'">
21-
<span>{{ copied ? '✓ Copied' : '⎘ Copy' }}</span>
21+
<span>{{ copied ? 'COPIED' : 'COPY' }}</span>
2222
</button>
2323
</div>
2424

@@ -59,7 +59,7 @@ const commands: TerminalCommand[] = [
5959
<span class="c-cyan">|</span> <span class="c-yellow">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
6060
<span class="c-cyan">=</span> <span class="c-bold">help</span>: batch storage writes outside the loop iteration
6161
<span class="c-cyan">=</span> <span class="c-bold">cost impact</span>: ~25,000 CPU instructions + 1 ledger write entry per cycle
62-
<span class="c-green"></span> Finished analysis in 0.42s (1 warning, 0 errors)`
62+
<span class="c-green">[OK]</span> Finished analysis in 0.42s (1 warning, 0 errors)`
6363
},
6464
{
6565
id: 'assert',
@@ -75,7 +75,7 @@ const commands: TerminalCommand[] = [
7575
• Memory Bytes : <span class="c-green">14,280</span> / 25,000 B <span class="c-green">[PASS]</span>
7676
• Read Bytes : <span class="c-green">1,024</span> / 2,000 B <span class="c-green">[PASS]</span>
7777
• Write Bytes : <span class="c-green">512</span> / 1,000 B <span class="c-green">[PASS]</span>
78-
<span class="c-green"> All 4 budget limits satisfied within 0% tolerance. CI check passed.</span>`
78+
<span class="c-green">[PASS] All 4 budget limits satisfied within 0% tolerance. CI check passed.</span>`
7979
},
8080
{
8181
id: 'profiler',
@@ -93,7 +93,7 @@ Execution completed in 1,248,310 instructions.
9393
3. <span class="c-yellow">16.4%</span> 204,720 inst. amm_math::compute_constant_product (math.rs:32)
9494
4. <span class="c-dim">13.6%</span> 169,790 inst. other frame calls
9595
96-
<span class="c-green"> Interactive SVG flamegraph exported to ./flamegraph.svg</span>`
96+
<span class="c-green">[OK] Interactive SVG flamegraph exported to ./flamegraph.svg</span>`
9797
}
9898
]
9999

src/.vitepress/theme/custom.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ h1, h2, h3, .VPHomeHero .name, .VPNavBarTitle {
8282
border-bottom: 1px solid rgba(244, 241, 255, 0.08) !important;
8383
}
8484

85+
/* Hide light/dark mode appearance toggle button */
86+
.VPSwitchAppearance,
87+
.VPSwitchAppearance + .VPNavBarExtra,
88+
.VPMenuLink .VPSwitchAppearance {
89+
display: none !important;
90+
}
91+
8592
.VPSidebar {
8693
background: var(--void-2) !important;
8794
border-right: 1px solid rgba(244, 241, 255, 0.08) !important;

src/budget-assert/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Measured on an example contract (`do_expensive_work(10_000)`):
1919

2020
<div class="divergence-box">
2121
<div class="divergence-title">
22-
<span>🔬</span> Empirical Resource Divergence vs. Network Truth
22+
Empirical Resource Divergence vs. Network Truth
2323
</div>
2424
<div class="divergence-grid">
2525
<div class="divergence-item">
@@ -66,9 +66,9 @@ cargo budget-report --check --network testnet
6666
To wire assertions into your test suite, start with the [**End-User Guide**](user_guide.md). To set up automated CI budget gating, see the [**CI/CD Integration Guide**](ci_cd_integration.md).
6767
:::
6868

69-
* 🚀 [**End-User Guide**](user_guide.md) — Step-by-step walkthrough of macros, baseline snapshots, and commands
70-
* ⚙️ [**Complete CLI & Config Reference**](reference.md) — All flags, `budget.toml` schema, and environment variables
71-
* 📐 [**Deriving Limits**](deriving_limits.md) — How to calculate safe Tier A local limits from Tier B network measurements
72-
* 🤖 [**CI/CD Integration Guide**](ci_cd_integration.md) — GitHub Actions workflow and PR summary generation
73-
* 🔧 [**Testnet Troubleshooting**](testnet_troubleshooting.md) — Handling RPC timeouts, sequence numbers, and funding
74-
* 🛠️ [**Developer Guide**](developer_guide.md) — Architecture, internals, and building from source
69+
* [**End-User Guide**](user_guide.md) — Step-by-step walkthrough of macros, baseline snapshots, and commands
70+
* [**Complete CLI & Config Reference**](reference.md) — All flags, `budget.toml` schema, and environment variables
71+
* [**Deriving Limits**](deriving_limits.md) — How to calculate safe Tier A local limits from Tier B network measurements
72+
* [**CI/CD Integration Guide**](ci_cd_integration.md) — GitHub Actions workflow and PR summary generation
73+
* [**Testnet Troubleshooting**](testnet_troubleshooting.md) — Handling RPC timeouts, sequence numbers, and funding
74+
* [**Developer Guide**](developer_guide.md) — Architecture, internals, and building from source

src/cost-linter/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ cargo cost-lint --all-targets
4646
New here? Start with the [**Integration Guide**](integration.md) to wire the linter into your workspace and CI in minutes. Before proposing a new lint, read [**Scope: Clippy vs. soroban-cost-linter**](scope_boundary.md).
4747
:::
4848

49-
* 🔍 [**Lint Catalog**](lint_catalog.md) — complete catalog of all 40+ lints and category breakdown
50-
* 🏷️ [**Lint Categories**](lint_categories.md) — grouping by storage, compute, memory, and authorization
51-
* [**Storage In Loop Rule**](lints/soroban_storage_in_loop.md) — deep dive into our flagship prevention lint
52-
* 🔌 [**Integration Guide**](integration.md)`budget.toml` configuration and GitHub Actions setup
53-
* 📏 [**Scope: Clippy vs. soroban-cost-linter**](scope_boundary.md) — which patterns belong here and which belong to Clippy
54-
* 🧭 [**Troubleshooting**](troubleshooting.md) — library-not-found, toolchain mismatch, and silent failures
55-
* 📋 [**Cost Rationale**](cost_rationale.md) — empirical research backing every lint severity score
49+
* [**Lint Catalog**](lint_catalog.md) — complete catalog of all 40+ lints and category breakdown
50+
* [**Lint Categories**](lint_categories.md) — grouping by storage, compute, memory, and authorization
51+
* [**Storage In Loop Rule**](lints/soroban_storage_in_loop.md) — deep dive into our flagship prevention lint
52+
* [**Integration Guide**](integration.md)`budget.toml` configuration and GitHub Actions setup
53+
* [**Scope: Clippy vs. soroban-cost-linter**](scope_boundary.md) — which patterns belong here and which belong to Clippy
54+
* [**Troubleshooting**](troubleshooting.md) — library-not-found, toolchain mismatch, and silent failures
55+
* [**Cost Rationale**](cost_rationale.md) — empirical research backing every lint severity score

src/cost-profiler/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ Without execution profiling, developers are forced to manually comment out code
9090
Ready to start profiling? Read the [**Overview & Quickstart**](getting-started/quickstart.md) and ensure you configure [**The Debug Precondition**](getting-started/debug_precondition.md) before building your WASM binaries.
9191
:::
9292

93-
* 🚀 [**Overview & Quickstart**](getting-started/quickstart.md) — Profile your first Soroban contract in minutes
94-
* ⚠️ [**The Debug Precondition**](getting-started/debug_precondition.md) — How to preserve DWARF symbols without bloating production mainnet contracts
95-
* 💰 [**Soroban Cost Model & Metering**](cost/cost_model.md) — Detailed breakdown of Soroban cost types, host dispatch, and fee calculations
96-
* 📊 [**Exclusive vs. Inclusive Costs**](cost/exclusive_vs_inclusive.md) — How to interpret self-cost versus child-call costs
97-
* 🔥 [**Generating & Reading Flamegraphs**](guides/flamegraphs.md) — How to read and navigate collapsed stacks and flamegraphs
98-
* 🛠️ [**CLI Tool Reference**](reference/cli.md) — Flags, options, and commands
99-
* 🗺️ [**Development Roadmap**](contributing/roadmap.md) — Current status and upcoming milestones
93+
* [**Overview & Quickstart**](getting-started/quickstart.md) — Profile your first Soroban contract in minutes
94+
* [**The Debug Precondition**](getting-started/debug_precondition.md) — How to preserve DWARF symbols without bloating production mainnet contracts
95+
* [**Soroban Cost Model & Metering**](cost/cost_model.md) — Detailed breakdown of Soroban cost types, host dispatch, and fee calculations
96+
* [**Exclusive vs. Inclusive Costs**](cost/exclusive_vs_inclusive.md) — How to interpret self-cost versus child-call costs
97+
* [**Generating & Reading Flamegraphs**](guides/flamegraphs.md) — How to read and navigate collapsed stacks and flamegraphs
98+
* [**CLI Tool Reference**](reference/cli.md) — Flags, options, and commands
99+
* [**Development Roadmap**](contributing/roadmap.md) — Current status and upcoming milestones
100100

src/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ hero:
1414
link: "https://tollcraft.github.io/soroban-cost-profiler/"
1515

1616
features:
17-
- title: 🛡️ Tier 1 — Prevent
17+
- title: Tier 1 — Prevent
1818
details: Catch structurally expensive anti-patterns (storage in loops, redundant clones) before your code compiles using rustc and Dylint static analysis.
1919
link: /cost-linter/
2020
linkText: Cost Linter Docs →
21-
- title: 🧪 Tier 2 — Detect
21+
- title: Tier 2 — Detect
2222
details: Simulate your contract against live network metering inside cargo test. Pin verified costs and fail CI before regressions hit on-chain.
2323
link: /budget-assert/
2424
linkText: Budget Assert Docs →
25-
- title: 🔥 Tier 3 — Diagnose
25+
- title: Tier 3 — Diagnose
2626
details: When a budget fails, trace WASM execution instruction-by-instruction, map offsets back to Rust lines via DWARF, and inspect visual flamegraphs.
2727
link: /cost-profiler/
2828
linkText: Cost Profiler Docs →

0 commit comments

Comments
 (0)