Skip to content

Commit 514bdbc

Browse files
committed
Refactor code structure for improved readability and maintainability
1 parent bfe5f84 commit 514bdbc

21 files changed

Lines changed: 715 additions & 97 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
applyTo: "**/*.py"
3+
---
4+
5+
# Python Standards
6+
7+
These rules apply automatically whenever Copilot works on a Python file in
8+
this project. They never load for other file types, so a conversation about a
9+
Dockerfile or some JSON stays clutter-free.
10+
11+
## Style
12+
13+
- Follow PEP 8 style conventions.
14+
- Add type hints to every function signature.
15+
- Prefer f-strings over `%` formatting or `str.format()`.
16+
17+
## Error Handling
18+
19+
- Catch specific exceptions; never use a bare `except:`.
20+
- Validate inputs at function boundaries and fail with a clear message.
21+
22+
## Testing
23+
24+
- Put pytest tests in `samples/book-app-project/tests/` using `test_*.py` naming.
25+
- Cover the happy path and edge cases (empty input, missing data).

docs/assets/css/style.css

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ body.home{display:flex;flex-direction:column;min-height:100vh}
178178
/* per-command copy buttons: real HTML <button>s overlaid on the terminal bar
179179
(kept OUTSIDE the role="img" panel SVG so they stay keyboard/AT accessible).
180180
Positioned by % over .panel-wrap, which exactly bounds the fixed-ratio SVG. */
181-
.panel-wrap{position:relative;display:block}
182-
.term-copy{position:absolute;margin:0;padding:0 1.2% 0 0;border:0;background:transparent;
181+
.panel-wrap{position:relative;display:block;container-type:inline-size}
182+
.term-copy{position:absolute;margin:0;padding:0 1.2cqw 0 0;border:0;background:transparent;
183183
display:flex;align-items:center;justify-content:flex-end;cursor:pointer;
184184
-webkit-tap-highlight-color:transparent}
185185
.term-copy .tc-box{position:relative;height:74%;aspect-ratio:1;display:grid;
@@ -198,6 +198,49 @@ body.home{display:flex;flex-direction:column;min-height:100vh}
198198
.term-copy.copied .tc-box{border-color:#3fb950}
199199
/* touch devices have no hover: keep the copy icons visible there */
200200
@media(hover:none){.term-copy .tc-box{opacity:1}}
201+
202+
/* selectable command text: real HTML drawn over the SVG terminal bar (the SVG
203+
paints only the bar + dots). Each line is positioned to sit on the bar and
204+
scales with the panel via the cqw font-size set inline. */
205+
.term-text{position:absolute;inset:0;pointer-events:none}
206+
.term-text .term-line{position:absolute;display:flex;align-items:center;margin:0;
207+
font-family:ui-monospace,Menlo,Consolas,monospace;color:#d1f7c4;line-height:1;
208+
white-space:pre;overflow:hidden;cursor:text;pointer-events:auto;
209+
-webkit-user-select:text;user-select:text}
210+
.term-text .term-comment{color:#6e7681}
211+
212+
/* "view file" pill overlaid on a details card, sized in cqw so it scales with
213+
the panel (matched to the card's ~1.95cqw prose); opens the matching <dialog>.
214+
Kept OUTSIDE the role="img" SVG. */
215+
.file-view-btn{position:absolute;right:3.2cqw;transform:translateY(-50%);
216+
display:inline-flex;align-items:center;gap:0.9cqw;margin:0;cursor:pointer;
217+
border:0;border-radius:999px;padding:0.85cqw 1.8cqw;background:var(--teal);color:#fff;
218+
font-family:'Poppins',Verdana,Segoe UI,sans-serif;font-weight:600;font-size:1.95cqw;
219+
line-height:1;box-shadow:0 0.4cqw 1.1cqw rgba(12,122,122,.32);
220+
transition:transform .12s ease,box-shadow .12s ease,background .12s ease;
221+
-webkit-tap-highlight-color:transparent}
222+
.file-view-btn .fv-ico{width:2.3cqw;height:2.3cqw;flex:0 0 auto}
223+
.file-view-btn:hover{background:#0a6a6a;transform:translateY(-50%) scale(1.03)}
224+
.file-view-btn:focus{outline:none}
225+
.file-view-btn:focus-visible{outline:0.4cqw solid var(--focus);outline-offset:0.3cqw}
226+
227+
/* modal file viewer */
228+
.file-dialog{border:0;border-radius:16px;padding:0;width:min(880px,94vw);
229+
max-height:82vh;overflow:hidden;
230+
color:var(--ink);background:#fff;box-shadow:0 24px 64px rgba(15,23,42,.4)}
231+
.file-dialog[open]{display:flex;flex-direction:column}
232+
.file-dialog::backdrop{background:rgba(15,23,42,.55)}
233+
.fd-head{flex:0 0 auto;display:flex;align-items:center;gap:10px;padding:13px 16px;
234+
background:var(--teal);color:#fff}
235+
.fd-head .fv-ico{width:20px;height:20px;flex:0 0 auto}
236+
.fd-name{font-family:ui-monospace,Menlo,Consolas,monospace;font-weight:600;font-size:1rem}
237+
.fd-close{margin-left:auto;border:0;background:transparent;color:#fff;cursor:pointer;
238+
font-size:1.7rem;line-height:1;padding:0 4px;border-radius:8px}
239+
.fd-close:hover{background:rgba(255,255,255,.18)}
240+
.fd-close:focus-visible{outline:2px solid #fff;outline-offset:2px}
241+
.fd-body{flex:1 1 auto;min-height:0;margin:0;padding:18px 20px;overflow:auto;
242+
background:#0d1117;color:#d1f7c4;font-family:ui-monospace,Menlo,Consolas,monospace;
243+
font-size:.86rem;line-height:1.55;white-space:pre;tab-size:2}
201244
/* ===== homepage entrance: the opening panel comes alive on load ===== */
202245
/* Pure CSS (runs on first paint, no JS). Fill-mode 'both' supplies the hidden
203246
start state, so removing the animation (reduced motion) leaves things visible. */

docs/assets/img/ch01-commands.png

336 KB
Loading
1.87 MB
Loading

docs/assets/img/ch01-plan.png

822 KB
Loading
2.21 MB
Loading

docs/assets/img/ch04-agents.png

-697 KB
Loading

docs/assets/img/ch04-pick.png

1.6 MB
Loading

docs/assets/img/ch04-scope.png

1.67 MB
Loading

docs/assets/img/objectives.png

896 KB
Loading

0 commit comments

Comments
 (0)